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

Regarding leaving a subscreen

Former Member
0 Likes
3,307

Hi all,

In my program, I called a subscreen via CALL SUBSCREEN DYNAMIC whereby DYNAMIC will have the screen number. When I'm in the DYNAMIC subscreen, what can I do to leave this screen and go back to the main screen? I tried using LEAVE TO SCREEN 0, LEAVE SCREEN, SET SCREEN 0, but all was not working and the program keep telling me that "SET SCREEN is not allowed in subscreens". What can I do to exit the subscreen?

Hi all,

In my program, I called a subscreen via CALL SUBSCREEN DYNAMIC whereby DYNAMIC will have the screen number. When I'm in the DYNAMIC subscreen, what can I do to leave this screen and go back to the main screen? I tried using LEAVE TO SCREEN 0, LEAVE SCREEN, SET SCREEN 0, but all was not working and the program keep telling me that "SET SCREEN is not allowed in subscreens". What can I do to exit the subscreen?

7 REPLIES 7
Read only

varma_narayana
Active Contributor
0 Likes
1,652

Hi..

Subscreens Cannot Call other Screens, bcoz a Subscreen is always ebedded inside another screen.

So the Statments like SET SCREEN, LEAVE TO SCREEN <N> will not be allowed in a subscreen.

Instead of that you place the Same statments inside the PAI module of the Main screen.

<b>Reward if Helpful</b>

Read only

0 Likes
1,652

Thanks, but however, in my subscreen, there's a button for me to quite that screen. I have assign a FCODE to that button in the status screen of the main screen, so whenever I press on it, the main screen PAI will trigger. I have tried to put the LEAVE TO SCREEN statements in it, but still it keep coming back with the same error message.

Read only

Former Member
0 Likes
1,652

LEAVE TO SCREEN 200.

Read only

Former Member
0 Likes
1,652

Not working

Read only

0 Likes
1,652

Hi,

u have a sub screen means that will be a part of some main screen.so in the PAI of that main screen u just write the code for the function code of that button.

rgds,

bharat.

Read only

Former Member
0 Likes
1,652

Hi Mil,

The flow logic of a subscreen screen has certain limitations, so it may not contain any dialog modules containing the statements SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN, or LEAVE TO SCREEN. Any of these statements causes a runtime error. You cannot change the GUI status of a main screen in a subscreen screen and the flow logic of a subscreen screen may not contain a MODULE ... AT EXIT-COMMAND statement. Type E functions may only be handled in the main screen.

So, You can not exit the sub screen dynamically.

Thanks,

Vinay

Read only

Former Member
0 Likes
1,652
"please  see this  link for  Creating subscreen  in your dialog  program and 
"in report  program, .

<a href="http://">http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm</a>

<a href="http://">http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm</a>

reward points if it is usefull ...

Girish