SY-UCOMM IS A system variable. It contains the latest user action triggered. Whereas ok_code is generally a variable that we declare as a type of sy-ucomm. Usually in ABAP programing it is a good practice not to refer to sy-ucomm directly, or sometimes we need to store a user interaction for later validation, these are the scenarios where an ok_code value comes handy.
eg.
data: ok_code type sy-ucomm.
clear ok_code.
ok_code = sy-ucomm.
case ok_code.
when 'XYZ'.
..........
..........
WHEN OTHERS.
ENDCASE.
Hope that clears the matter.
No comments:
Post a Comment