Tuesday, October 12, 2010

what is difference between sy-ucomm and ok_code ?

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:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites