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: 

Problem with sub-screen <actions on Cancel button>

Former Member
0 Kudos

Hi all,

I have a problem with sub-screen.

I created a subscreen (screen sequence in MM01/MM02/MM03). When users leave this screen, I call POPUP_TO_CONFIRM to ask if they want to save the data.

1) My goal is: when they choose Cancel, no actions are performed and users will see the current screen. However, I cannot use command: SET SCREEN 0 or LEAVE TO SCREEN 0 because the system gives an error message:

 SET SCREEN 0 not allowed in subscreens. 

2) How can we determine when the user leaves the screen? which value of SY-UCOMM will be used to check this?

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Same kind of development I've also done, U don't need to give POPUP_TO_CONFIRM explicitly, system itself ask.

Also subscreen can't have OK_CODE so can't use SY-UCOMM in PAI of subscreen.

I think it's sufficient, still if have any doubt pls fill free to ask.

don't forget to reward,

S@meer

4 REPLIES 4

Former Member
0 Kudos

Same kind of development I've also done, U don't need to give POPUP_TO_CONFIRM explicitly, system itself ask.

Also subscreen can't have OK_CODE so can't use SY-UCOMM in PAI of subscreen.

I think it's sufficient, still if have any doubt pls fill free to ask.

don't forget to reward,

S@meer

Former Member
0 Kudos

Hi.

The concept is

-


MAIN -


MAN SCREEN

PBO

- Sub Screen no 100

PAI

MODULE user_command..

END MAIN SCREEN

MODULE user_command INPUT.

CASE SY-UCOMM .

WHEN 'BACK'. "or any bottons on menu bar

IF global_variable_changed = 'X'.

CALL FUNCTION 'POPUP_TO_CONFIRM'

IMPORTING

ANSWER = lv_answer

case lv_answer.

when '1'. "Yes

"Perform Save_data.

leave to screen 0.

when '2'. "No

leave to screen 0.

when 'A'. "Cancel

"Do nothing that it will be at a same subscreen 100

endcase.

ENDIF

when 'SAVE'.

"Perform Save_data.

leave to screen 0.

ENDCASE.

ENDMODULE.

-


END MAIN -


-


SUB SCREEN -


-- user will do something with sub screen 100 and click "BACK" or any bottons which will

-- can be detected in MAIN SCREEN

-- -


SUB SCREEN 100.

PAI

MODULE set_something_changed.

END SUB SCREEN 100

MODULE set_something_changed INPUT.

global_variable_changed = 'X'.

ENDMODULE.

Hope it help.

SayC.

Former Member
0 Kudos

Hi,

After checking the POPUP_TO_CONFIRM -> ANSWER if it is 2 or A.

SY-UCOMM = 'BACK'.

Thanks,

Arunprasad.P

Reward if Useful.

0 Kudos

Hi all,

Thank you for your suggestion. I really appreciate your help.

I want to apologize because I did post one question in 2 threads (due to my mistake. The network connection at my place had problem and I patiently pressed POST twice). So, it made our discussion fragmented.

one thread herein, another:

[|]

I found out the solution and I will post it to that thread. I will close both threads.

Hi Sameer,

Actually, I have to call POPUP_TO_CONFIRM to determine to save or not because it is the requirement

We can use SY-UCOMM, but not OK_CODE for sub screens. In fact, my code is based on SY-UCOMM to check if user leaves my sub-screen.