Application Development and Automation 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: 
Read only

okcode

Former Member
0 Likes
627

how many okcode u can create in modulepool and how to clear okcode?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
571

Hi

In case of dialog programs , each screen has an okcode field associated with it.

okcode captures the user command on PAI .

plz take a look at the code below for further clarification :

Data : ok_code type sy-ucomm.

" in the PAI module MODULE_USER_COMMAND for screen XXX

module module_user_command .

ok_code = sy-ucomm.

CASE ok_code.

WHEN ' ' .

" write the code for the operation to b performed

WHEN ' ' .

" write code 2 for another command

ENDCASE.

endmodule.

use CLEAR ok_code to clear the value of ok_code.

One screen in a module pool program can have a maximum of 1 okcode.

In the same lines , a module pool program can have as many okcode as the number of screens in it.

i hope it helps u..in case of further queries plz revert.

Regards

Pankaj

4 REPLIES 4
Read only

dani_mn
Active Contributor
0 Likes
571

HI,

okcode contains the user command so there can be only one okcode.

CLEAR: okcode.

REgards,

Read only

Former Member
0 Likes
571

for every normal screen u can have one okcode.

we cant have okcode for subscreen.

get the okcode in a variable & clear it.

Eg.

Data : okcode type sy-ucomm,

save_ok like okcode.

Module_user_command.

save_ok = okcode.

clear okcode.

case save_ok.

..

endcase.

Read only

Former Member
0 Likes
571

for eve3ry screen you can create one ok code you can clear it by saying clear okcode. for example like this

data:okcode_100(5) type c.

case okcode_100.

when 'BACK'.

clear okcode.

.............

................

endcase.

Regards,

Manohar.

Read only

Former Member
0 Likes
572

Hi

In case of dialog programs , each screen has an okcode field associated with it.

okcode captures the user command on PAI .

plz take a look at the code below for further clarification :

Data : ok_code type sy-ucomm.

" in the PAI module MODULE_USER_COMMAND for screen XXX

module module_user_command .

ok_code = sy-ucomm.

CASE ok_code.

WHEN ' ' .

" write the code for the operation to b performed

WHEN ' ' .

" write code 2 for another command

ENDCASE.

endmodule.

use CLEAR ok_code to clear the value of ok_code.

One screen in a module pool program can have a maximum of 1 okcode.

In the same lines , a module pool program can have as many okcode as the number of screens in it.

i hope it helps u..in case of further queries plz revert.

Regards

Pankaj