Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ADDING NEW FIELDS IN me21n - (Screen exit / enhancment)

Former Member

Hi guys,

I would like to add additional custom fields in the TCODE : me21n - purchase order.

kindly suggest me step by step procedure to add this fields. so that if i raise PO , i should have a provision to included this datas also in my statndard table.

thanks in advance.

regards

Girish

*Please provide step by step procedure for achieving the result.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use MM06E005 enhancement to add fields in screen of ME21N

SAPMM06E 0101 CUSTSCR1 SAPLXM06 0101 Subscreen: PO header

SAPMM06E 0111 CUSTSCR1 SAPLXM06 0111 Subscreen: PO item

SAPMM06E 0201 CUSTSCR1 SAPLXM06 0201 Subscreen: agreement header

SAPMM06E 0211 CUSTSCR1 SAPLXM06 0211 Subscreen: agreement item

SAPMM06E 0301 CUSTSCR1 SAPLXM06 0301 Subscreen: RFQ header

SAPMM06E 0311 CUSTSCR1 SAPLXM06 0311 Subscreen: RFQ item

Use the appropriate screen exit depending on where u require to add field

5 REPLIES 5

Former Member
0 Kudos

Use MM06E005 enhancement to add fields in screen of ME21N

SAPMM06E 0101 CUSTSCR1 SAPLXM06 0101 Subscreen: PO header

SAPMM06E 0111 CUSTSCR1 SAPLXM06 0111 Subscreen: PO item

SAPMM06E 0201 CUSTSCR1 SAPLXM06 0201 Subscreen: agreement header

SAPMM06E 0211 CUSTSCR1 SAPLXM06 0211 Subscreen: agreement item

SAPMM06E 0301 CUSTSCR1 SAPLXM06 0301 Subscreen: RFQ header

SAPMM06E 0311 CUSTSCR1 SAPLXM06 0311 Subscreen: RFQ item

Use the appropriate screen exit depending on where u require to add field

0 Kudos

thankz for your reply.

kindly give me step by step procedure for achiving the same, since i am new to userexits and badi'S.

which transaction code to use ?

thanks

girish

0 Kudos

1. Go to SMOD to find the appropriate screen exit suitable for u

give enhancment as MM06E005 press display

press components button

among the existing screen exit choose appropriate one for example if u want to add some fields in PO

header( all the fields u create will be added in customer data tab) use the below screen exit

SAPMM06E 0101 CUSTSCR1 SAPLXM06 0101 Subscreen: PO header

2. Go to se51 give prog name SAPLXM06 screen 0101 press create

Add the fields in the layout

Write the code in PBO and PAI modules to perform any operation to be done on these added fields.

3. Go to se51 give prog name SAPMM06E screen 0101 press display

In PROCESS BEFORE OUTPUT.

double click on CUSTSCR1_HEAD_SET_DATA in flow logic( MODULE CUSTSCR1_HEAD_SET_DATA)

double click on CUSTSCR1_HEAD_SET_DATA_PBO using fc_call.

double click on EXIT_SAPMM06E_006 (CALL FUNCTION 'EXIT_SAPMM06E_006')

double click on ZXM06U36 (INCLUDE ZXM06U36 .)

add code here

IF I_EKKO-EBELN NE G_EBELN. "PBO 101 screen

CLEAR G_IND. " Here G_IND is global variable declare it in top include

ENDIF.

MOVE I_EKKO-EBELN TO G_EBELN.

G_IND = G_IND + 1.

IF G_IND EQ 1.

MOVE : I_EKKO-EBELN TO EKKO-EBELN,

I_EKKO-BUKRS TO EKKO-BUKRS,

I_EKKO-LIFNR TO EKKO-LIFNR,

I_EKKO-EKORG TO EKKO-EKORG,

I_EKKO-EKGRP TO EKKO-EKGRP,

I_EKKO-KUNNR TO EKKO-KUNNR,

ENDIF.

In PROCESS AFTER INPUT.

I u want to write any code u want to perform on the fields which u r creating

double click on CUSTSCR1_HEAD_SET_DATA ( MODULE CUSTSCR1_HEAD_SET_DATA.)

double click on CUSTSCR1_HEAD_SET_DATA_PAI

double click on EXIT_SAPMM06E_007

and write code in include ZXM06U38.

4. Go to CMOD tcode

give project name eg, ZSSCRPUR press create button

give short desc

press enhancement assignment button

give MM06E005 and press enter

press component button

Activate it

5. Run the tcode u get the all the 6 fields with data which you have added .

0 Kudos

Hello

Gold

Former Member
0 Kudos

hi kumar,

Functional Requirement: A new tab is needed to add in Purchase Order Transaction at the header level. This tab is needed to accommodate five fields for which user can enter Term IDs to update in Create and Change Modes.

Technical Requirements: This functionality can be achieved using Customer-Exits where in SAP provides certain hooks for modifying standard SAP transactions. The enhancement MM06E005 is required to enhance standard screen. This enhancement consists of following exits.

A Function Exits.

B Screen Exits.

C Include Tables

A List of Function Exits are.

EXIT_SAPMM06E_006

EXIT_SAPMM06E_007

EXIT_SAPMM06E_008

EXIT_SAPMM06E_009

EXIT_SAPMM06E_012

EXIT_SAPMM06E_013

EXIT_SAPMM06E_014

EXIT_SAPMM06E_016

EXIT_SAPMM06E_017

EXIT_SAPMM06E_018

B List of Screen Exits are.

SAPMM06E 0101 CUSTSCR1 SAPLXM06 0101

SAPMM06E 0111 CUSTSCR1 SAPLXM06 0111

SAPMM06E 0201 CUSTSCR1 SAPLXM06 0201

SAPMM06E 0211 CUSTSCR1 SAPLXM06 0211

SAPMM06E 0301 CUSTSCR1 SAPLXM06 0301

SAPMM06E 0311 CUSTSCR1 SAPLXM06 0311

C List of Include Tables are.

CI_EKKODB

CI_EKPODB

From the above List those exits in red colored are only required for our purpose

Technical Solution.

The below steps are required to follow to accomplish the task.

1.Find the package name of the transaction by going to system->status.

2.Double click on Transaction name (for e.g. ME21N) look for package name.

Or

3.Double click on Program name (for e.g. SAPLMEGUI) ->click GO TO on menu bar->attributes, look for package name.

Or

4.Double click on Screen no (for e.g. 14) ->attributes, look for package name

5.Go to TCODE SMOD and press F4. Click on Information system and enter Package name

( for e.g. package Name ME was found from above points )

6.We see a list of exits for the mentioned package.

7 Go to TCODE CMOD->Enter a project name (for e.g. MMPRICE).

8 Press->create. If the enhancement MM06E005 is already assign to another project either deactivate it by pressing . Deactivate project button OR we can use that project itself.

9 Enter short text and save the project. Click on button. Type the required enhancement

And press Enter. Press button and save the project. Now we can see the list of exits which are

Required to enhance the screen. Activate the project by pressing activate project button . Check that all the Exits turn into green color.

10 First include fields in the structure CI_EKKODB. This will automatically update Po header Table (EKKO)

11 Use screen exit SAPMM06E 0101 CUSTSCR1 SAPLXM06 0101. Double click on it and activate to get customer ..Design your layout with five fields in screen editor. Name them taking

Dictionary fields as reference (EKKO).Use the custom include programs which are provided for coding purpose.

12 Use exit EXIT_SAPMM06E_006 to get data from existing purchase order. This Function exit consist of import parameters I_EKKO which contains data for corresponding purchase order.

13 Use exit EXIT_SAPMM06E_008 to transport data from purchase order customer screen to changing parameter E_CI_EKKO.The data which is entered on custom screen will be send to this structure and when saved, updates the table EKKO.