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

ok code not getting cleared

Former Member
0 Likes
1,444

CLEAR ok_code.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'ADD'.

TABLE_CONTROL-LINES = TABLE_CONTROL-LINES + new_row.

WHEN 'DEL'.

DELETE TCTRL WHERE SEL_FIELD = 'X'.

WHEN 'PROC'.

PERFORM chk_tctrl.

PERFORM code_gen.

WHEN 'CODP'.

PERFORM chk_tctrl.

PERFORM code_prev.

WHEN 'GENR'.

PERFORM chk_tctrl.

PERFORM gen_prg.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

In this coding the ok_code is not getting cleared. whenever an option is selected, and after if 'ENTER' is clicked the ok_code remains the previous option chosen and not getting cleared. please help.

7 REPLIES 7
Read only

Former Member
0 Likes
984

In which section of the screen did you cal this module?

Is it in the PAI?

ok_code will have the last user action's code.

When you say, "an option is selected" what do you actually mean?

Regards,

Ravi

Read only

0 Likes
984

It is called in PAI module.When an user action is made as in the coding say 'PROC'. after which if i give 'ENTER' the previous event 'PROC' is triggered again.

Read only

Former Member
0 Likes
984

HI,

remove the statement, ok_code = sy-ucomm.

There is no need of passing sy-ucomm value again.

Just set the ok_code in the attributes of the screen.

Regards,

Sailaja.

Read only

shishupalreddy
Active Contributor
0 Likes
984

Hi ,

If you already declared OK_CODE like SY-UCOMM in data declarations then remove

ok_code = sy-ucomm

and ensure that the triggring should happend in PAI module

regards,

Read only

Former Member
0 Likes
984

hi,

add this statement in bold.

case ok_code.

when 'PROC'.

...

<b> clear ok_code.</b>

when 'ABCD'.

endcase.

Regards,

Sailaja.

Read only

0 Likes
984

we have tried that also before itself. it is not working. 'CLEAR ok_code' after each event

Read only

Former Member
0 Likes
984

Hi,

check whether your code is in PAI module.

Regards

Amole