In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM.
There are two reasons for this:
Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field.
Global data declarations:
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM.
Your ABAP program must contain a field with the same name as the OK_CODE field on the screen. To specify the type, you should refer to the system field SY-UCOMM, since this always corresponds to the type of the OK_CODE field on the screen. At the same time, you should declare an appropriate auxiliary variable.
PAI module:
MODULE USER_COMMAND_100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN...
...
ENDCASE.
ENDMODULE.
In the first PAI module, you should assign the contents of the OK_FIELD to the auxiliary variable and then clear the OK_CODE field and carry on working with the auxiliary variable.
I hope it will be helpful for you.
| < Prev | Next > |
|---|





