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: 

OK CODE

Former Member
0 Kudos

Can any one please explain the meaning of OK code and what is its significance

7 REPLIES 7

former_member195383
Active Contributor
0 Kudos

ok code is to capture the sy-ucomm value. U can use sy-ucomm for the same purpose.

Search in SDN. U will get mutiplae threads reg: this

Former Member
0 Kudos

Hello,

OK Code stores the action/command of the user.

You can search the SCN for the same. Lot of threads which can help you think practically for question.

Thanks,

Jayant

former_member1245113
Active Contributor
0 Kudos

Hi, this is variable and captures the system field sy-ucomm.

which is the action that you performed.

like enter, save, choose, back, find etc.

to distinguish the user actions and correspondingly writing the code we use the ok code inturn the sy-ucomm.

hope this small explanation is useful to you.

for detailed notes as our other freinds mentioned please go through the documenations or search for it.

in its minute details the above is mentioned.

regards

Ramchander Rao.K

abdul_hakim
Active Contributor
0 Kudos

Hi

OK Code is used to capture the function that the user has last executed.

Generally we will define OK Code using DATA OK_CODE LIKE SY-UCOMM.

You could use other name as well but the standard practice is to use OK_code.

Cheers,

Hakim

Former Member
0 Kudos

Hi,

OK_CODE has special significance in module pool programming. It needs to be specified in screen elements tab in se51 for a module pool. If specified in screen elements and in abap code with data statement. OK_CODE will contain the value of SY-UCOMM automatically.

Many a time need arises that we need to clear SY-UCOMM. But it is not recommended to clear system variables. So we can clear OK_CODE instead of SY-UCOMM and in coding we can place conditions on OK_CODE rather than using SY-UCOMM.

Regards,

Amit

former_member206439
Contributor
0 Kudos

Hi

<<Text cut and pasted from here http://www.sap-img.com/abap/sy-ucomm-and-ok-code-in-dialog-program.htm >>

Edited by: Matt on Nov 20, 2008 1:01 PM

0 Kudos

Naresh - stop cutting and pasting answers from other places.