Professional Documents
Culture Documents
How To Create Customer Screen On ME21N
How To Create Customer Screen On ME21N
This is manual how to use the BadIs ME_GUI_PO_CUST and ME_PROCESS_PO_CUST to create a customer screen on item
level in ME21/22/23n. And how to fill this screen with a customer field.
Needed Badis:
ME_GUI_PO_CUST (classical)
ME_PROCESS_PO_CUST (enhancement spot)
Helpful information and sample code in example implementation class CL_EXM_IM_ME_GUI_PO_CUST and
CL_EXM_IM_ME_PROCESS_PO_CUST. In both examples all needed information is metioned, but not always easy to
find!
Step by step:
a. MANDT
b. EBELN
c. EBELP
4. Create with screen painter (SE51) a screen with the new field
a. Program should be either your already existing function pool for MM exits or create a copy of the SAP example
SAPLMEPOBADIEX
b. Attributes
c. Element List (referring to your structure fields)!
d. Flow Logic
5. Change the function pool for global data in the top include
i. Import Parameter
ii. Source code: fill your structure with the import parameter
i. Export Parameter
i. Import Parameter:
a. ME_GUI_PO_CUST
i.
Attribute:
1. SUBSCREEN1 / Level: Constant / Visibility: Public / Type: MEPO_NAME / Initial Value
‘ITEMSCREEN1’
2. DYNP_DATA_PBO / Level Instance Attribute / Visibility Private / Associated Type your structure of step
3
3. DYNP_DATA_PAI / Level Instance Attribute / Visibility Private / Associated Type your structure of step
3
c. Method:
Important:
ls_subscriber-position = position of the tab in the position details. According to Note 1910516 it should be
between 30 and 50 to avoid problems with existing screens.
ii. MAP_DYNPRO_FIELDS: : enter copy of source code of
CL_EXM_IM_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS
1. Change source code by entering your field in the when case in line 56
2. Important: mapping one of the following customer fields in Line 58
1. Delete lines for standard fields (line20 – 32 of the example coding are not necessary for custom fields)
2. Change “if case” of line 64 to your own field
3. Change function module of line 66 to your module of step 6a
4. Change line 73 to your own field
5. Change function module of line 74 to your module of step 6d
6. Enter line 78 (move changed value to local structure)
7. Enter call of method set_data
8. BADI Enhancement Spot ME_PROCESS_PO_CUST
Important: you can call only one Enhancement Implementation, if there is already an active implementation you have to either
use this or deactivate it!
a. Method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM
b. Method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM
i. Necessary to pre-fill you customer field with e.g values from material master
ii. Enter e.g. some lines like below:
iii. Important is to use the following lines to get the entered data
data: lwa_mepoitem type mepoitem,
lwa_po_lgfsb type ymm_po_lgfsb.
iv. And after your select to use the following lines to set your selected data
endif.
If you just followed all steps and also put all function modules into the same function pool you should see now your
custom tab and field in the item details:
Problems:
Own tab not displayed in ME21N and ME22N but displayed in ME23N
o You forget to code IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM of ME_PROCESS_PO_CUST
o Compare to Note 1910516, you there is not “display” field you will not see the whole tab
o You forgot to add the include lmeviewsf01 in the top include of your function module
o Ensure that all your function modules are in the same function pool