04-25-2007 11:19 AM
04-25-2007 11:21 AM
The function code / variable representing the user command on the screen (see also SY-UCOMM) in dialog programming/
regards,
Hans
Please reward all helpful answers !!!!!
04-25-2007 11:21 AM
Hi
OK codes are nothing but the Function codes what we define for each Buttons on the screen or Menu
OK code is nothing but the SY-UCOMM
reward points if useful
regards,
Anji
04-25-2007 11:21 AM
The function code / variable representing the user command on the screen (see also SY-UCOMM) in dialog programming/
regards,
Hans
Please reward all helpful answers !!!!!
04-25-2007 11:23 AM
Hi,
Refer the link:
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801e61454211d189710000e8322d00/frameset.htm
Assign points if it helps.
-Gaurang
04-25-2007 11:24 AM
SAP recommends that in dialog program always use OK_Code instead of sy-ucomm. Here is what the help says
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. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
also chk this
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba99935c111d1829f0000e829fbfe/content.htm
Message was edited by:
Chandrasekhar Jagarlamudi
04-25-2007 11:24 AM
OK code is like function code. Where u assign the function codes PAI.
e.g: In the GUI Status if u have defined a EXIT button and u have assigned say 'EXT for that.
Then EXT will become ur OK_CODE.
In PAI under this OK_CODE u will execute some code.
when u press the EXIT button in your screen the logic will be executed.
This is the use of OK_CODE.
Thanks & Regards
Santhosh
04-25-2007 11:26 AM
Hi,
OK_CODE is nothing but function code for Screen.It Stores Function Code of screen.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>
04-25-2007 11:29 AM
hi SaI,
OK Codes are nothing but Function code defined for any click on the screen esp in module pools programs . You capture the function codes / OK Codes in SY-UCOMM . that means the value for any click during runtime is saved in SY-UCOMM .
you can do operations accordingly ....
eg: ok_code = sy-ucomm .
if ok_code EQ 'EXIT' or ok_code EQ 'CANCEL'.
leave program .
endif.
that means when you click on EXIT or Cancel icon the system will leave the current program .
Reward if helpful!
Thanks
Ranjita
04-26-2007 10:08 AM
12-21-2020 1:08 PM
Hi,
OK_CODE is a variable which is used to collect the screen attributes related Function codes. Whenever click on Push buttons or some Action, the Action related function code will be captured into OK_CODE variable. OK_CODE is type of system variable SY-UCOMM. Every button related action will be written basing on this OK_CODE value (Function code).
Regards,
Nasreen