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: 

Clearing sy-ucomm in subscreen

Former Member
0 Kudos

Dear all,

I found several messages at the forum to this problem but no one solved my problem:

We defined a customer subscreen on a tab at QM - Change notification (TA qm01/qm02).

At the customer subscreen there is a function code defined to add and delete lines to an alv list. Everything works fine, except that the funktion code at sy-ucomm is kept alive. Means: If I trigger the function, clear it after processing the code and hit i.e. "Enter" the old funtioncode is used again. The code is only cleared if I switch to another tab.

I tried several ways to clear the code of the main report but everytime I'm leaving my subscreen module and come to the mainreport the sy-ucomm is filled again.

Any ideas?

Thank you!

Klaus

6 REPLIES 6

former_member182371
Active Contributor
0 Kudos

Hi,

i´ve used this and it worked for me:

In module user_command_0100 of PAI


* Here i get the OK-CODE of the main screen
CONSTANTS: c_okcode(17) TYPE c VALUE '(SAPLMR1M)OK-CODE'.
DATA: wa_okcode TYPE sy-ucomm.
CLEAR wa_okcode.
FIELD-SYMBOLS: <fs_okcode> TYPE any.
ASSIGN (c_okcode) TO <fs_okcode>.
data: l_okcode like sy-ucomm.
clear l_okcode.
l_okcode = <fs_okcode>.

IF l_okcode = 'DOSOMETHING'.
perform do_something.
To initialize the OK-CODE of the main screen
clear l_okcode.
<fs_okcode> = l_okcode.
ENDIF.

Best regards.

0 Kudos

This solved my problem.

Former Member
0 Kudos

Hi Vince,

Try this way:

FIELD-SYMBOLS: <fs_ucomm> TYPE t185f-fcode.

ASSIGN: ('(SAPLIQS0)OK-CODE') TO <fs_ucomm>.

IF <fs_ucomm> IS ASSIGNED.

CLEAR: <fs_ucomm>.

ENDIF.

Regards,

Paganini

Former Member
0 Kudos

Hi Vince,

Try this way:


FIELD-SYMBOLS: <fs_ucomm> TYPE t185f-fcode.

ASSIGN: ('(SAPLIQS0)OK-CODE') TO <fs_ucomm>.
IF <fs_ucomm> IS ASSIGNED.
CLEAR: <fs_ucomm>.
ENDIF.

Regards,

Paganini

0 Kudos

It's not necessary to do this if function code begins by '$$'.

Best regards,

Josep

0 Kudos

Hi José Francisco Belloc García,

Could you please elaborate ?