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: 

Issue with sy-ucomm in PO customer-function EXIT_SAPMM06E_012 .

spinellll
Participant
0 Kudos
495

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

4 REPLIES 4

raymond_giuseppi
Active Contributor
437

Look in online help for Reading Function Codes (picture)

0 Kudos
437

Raymond

Unless I use indirect addressing, OK_CODE is not available to the customer function.

Leo

0 Kudos
437

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.

spinellll
Participant
0 Kudos
437

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.