11-22-2014 12:52 AM
Hi,
I have added a custom field and tab in ECC PO using the user exits EXIT_SAPMM06E_016 and EXIT_SAPMM06E_018.
The problem I'm facing is that I need to make the field DISPLAY only for ME23N transaction and input enabled only for ME22N.
How can I achieve this?
I saw few threads pointing to BADI ME_PROCESS_PO_CUST and method FIELDSELECTION_ITEM but dont know what would be the code for impacting the custom field.
Thanks.
11-22-2014 2:26 AM
You can set the active or read only in exit ZXM06O01.
In the screen where you created the fields set a PBO MODULE end define it in the exit ZXM06O01
IF sy-tcode = 'ME23N'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'YOUR FIELD'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
The problem is that you can navigate from display ME23N to Change (ME22N) using the menu and Im not sure if the sy-tcode is refreshed. If is not you could use this parameter to get the real sy-tcode
DATA: l_tcode TYPE SHKONTEXT-TCODE.
CALL ‘GET_PARAM_TCOD’ ID ‘PTCOD’ FIELD l_tcode.
Im not sure if will work.I usually use this PARAMETER ID for the FI transaction FB60 (but if you check the sy-tcode = FB01 and not FB60, that parameter show the real sy-tcode used)
Regards.
11-23-2014 5:49 PM
I have never used this T-code approach, so not sure if it works.
But a better way to fix this problem is to save the value of I_TRTYP which gives correct results always.
A Display
V Change
11-22-2014 12:58 PM
Hello srm_tech,
You may find inspiration in the following links :
http://www.saptechnical.com/Tutorials/ExitsBADIs/ME22N/Index.htm
http://www.saptechnical.com/Tutorials/ExitsBADIs/ME22N/Page1.htm
In the first link, you will find ideas on how to disable a field for input in ME22n because in the example the field is populated automatically.
I guess this should help you achieve the desired behavior in ME23n.
The second is more for completness.
Regards,
Alex
07-15-2016 9:24 AM
In fact using sy-tcode is not valuable in PO transactions, because it doesn't capture the display/change switch user function (button).
So the correct procedure is:
transaction SE11:
1. create field "zfield" in EKKO, include CI_EKKODB
then transaction SE80, function group XM06:
2. define global variables in top include ZXM06TOP
TABLES: CI_EKKODB.
DATA wa_i_aktyp. " display/change mode
3. write this code in user exit EXIT_SAPMM06E_006, include ZXM06U36
wa_i_aktyp = i_trtyp. " assign value
MOVE i_ekko-zfield TO ci_ekkodb-zfield.
4. add this code in user exit EXIT_SAPMM06E_008, include ZXM06U37
IF ci_ekkodb-zfield NE e_ci_ekko-zfield.
e_ci_ekko-zfield = ci_ekkodb-zfield.
e_ci_update = 'X'. " save
ENDIF.
5.in screen 0101 (layout editor)
design field "CI_EKKODB-ZFIELD" in screen, add group 'Z1' to field properties
6. in dynpro 0101 flow logic, create a PBO module and put this code
LOOP AT SCREEN.
IF screen-group1 = 'Z1'.
IF wa_i_aktyp = 'A'. " display
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
7. test it. In ME22N digit some text into ZFIELD and save. Check data saved
06-17-2019 9:13 AM