2023 Jan 31 2:29 PM
I’m having an issue with PO change (ME22N) customer function EXIT_SAPMM06E_012.
The very first action I perform after entering the PO in ME22N, I press the check icon. By the time the customer function is hit, sy-ucomm changes from “MECHECKDOC” TO “ENTE”. That’s bad.
If I press the check icon again, sy-ucomm remains “MECHECKDOC.”. That’s good.
I need to check certain actions in that customer-function and am confused as to why sy-ucomm changes but once.
Leo
2023 Jan 31 4:18 PM
2023 Jan 31 6:17 PM
Raymond
Unless I use indirect addressing, OK_CODE is not available to the customer function.
Leo
2023 Jan 31 8:21 PM
spinellll
EXIT_SAPMM06E_012 is not meant to permit the custom code to do different checks according to the button pressed, so you can't expect the standard to initialize SY-UCOMM as you wish.
As Raymond commented, SY-UCOMM should not be used because its value is potentially incorrect if ENTER is pressed.
You need to get the information about the button pressed by your own means (like accessing the global variable (maybe) which stores the button pressed), but nothing guarantees that it will continue working in the next releases.
2023 Feb 01 12:01 PM
Clarification: I recognize that sy-ucomm will at times get initialized or set to another value within SAP code. What I'm questioning is why in this particular scenario, the value is changed from MECHECKDOC to ENTE the first time an icon is pressed in ME22N, and not subsequent times.