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

Comming back from function...

Former Member
0 Likes
565

Hello

I have a subscreen with a button on it. When i press the button it's

calling function 'VIEW_MAINTENANCE_CALL' (i'm going to SM30)

Then when i press 'BACK' button it's comming back to my screen, but:

- from this moment every time when i press ENTER it's calling that function.

I've checked the value of SY-UCOMM and it's not changing when comming

back from called function... -> SY-UCOMM = 'my_func'

In USER_COMMAND I have:

CASE SY-UCOMM.

WHEN 'my_func'.

CALL .....

WHEN OTHERS.

ENDCASE.

Can I clear somehow SY-UCOMM after I call my function?

Or can I give some extra condition that i'm pressing my button?

Do You have any ideas?

4 REPLIES 4
Read only

Former Member
0 Likes
516

Hi,

Assign sy-ucomm to another variable and use that in your case..endcase.

Clear sy-ucomm after the variable is assigned.

v_ucomm = sy-ucomm.

clear sy-ucomm.

case v_ucomm.

when 'my_func'.

.....

endcase.

Regards,

Manoj

Read only

Former Member
0 Likes
516

U have to clear ur sy-ucomm.

This is done by giving okcode in the element list of the particular screen.

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.

use okcode instead of using sy-ucomm in case.

Read only

Former Member
0 Likes
516

It's not going to work because when program is going back to main screen,

SY-UCOMM is getting it's old value - that I wanted to clear...

And I cant change main screen - only subscreen...

Read only

0 Likes
516

Hi Arthur,

Check whther you are calling the subscren in a loop.If so dont call it in a loop,call it at the end of loop by making use of flag.

Moreover,while handling the function codes write <b>LEAVE TO SCREEN 0</b> to come back to the previous screen.Dont write SET SCREEN 0.Check it once again..

I am using exactly the same functionnality as you are using.There is no problem for me.And one more thing dont write your own screen numbers while creating table maintenance generator,LET the system propose screen numbers.Since a dump will come when you try to call TMG from the SE11 transaction.

Regards,

Balaji Reddy G

***Rewards if answers are helpful