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

Module Pool Doubt!

Former Member
0 Likes
604

Hi!

can u pls explain the following code

case ok_code.

when 'cancel'.

clear ok_code.

set screen 0.

leave screen.

endcase.

Questions:

1) SET screen 0 does what?

does it goes to the previous screen i am right or wrong.

2 . Following set screen LEAVE SCREEN DOES WHAT?

what i understand of leave screen is leaves the current screen and goes to the next screen. what does the leave screen does in the above case.

pls solve my issues guys

hoping for your reply.

Thanks

5 REPLIES 5
Read only

Former Member
0 Likes
584

HI,

before leave screen if we won't write set screen 0(or set screen <num>).it will goto the screen u have mention the attributes of that screen u r in at present.

if u give set screen 0 means it will go to the program screen(not to previous screen)

rgds,

bharat.

Read only

Former Member
0 Likes
584

Hi

1) Call Screen: Calling a single screen can be used for embedding a screen sequence. If you want to prevent the called screen from covering the current screen completely (say u want 2 display both screen) you can use the CALL SCREEN statement with the STARTING AT and ENDING AT

CALL SCREEN 200

If we write this statement in screen 100 ,it will goto screen 200 and it will retain screen 100(ie u can come back)

and moreover u have options using this

CALL SCREEN 200 STARTING AT x1 y1 ENDING AT x2 y2

2) If we use set screen first the processing blocks in the present screen will be executed and control goes to the screen which is called.

in this control remains in that calling screen only, it doesnt come back to our screen.

3)In screen 100,we call screen 200.The PBO and PAI of screen 200 is processed.Now in screen 200,if we use leave to screen 100,the processing starts from screen 100 after the call screen 200 statement.The PBO and the PAI of screen 100 need not be processed again from the beginning in this case.

4) That is if we use leave to screen,the control goes back to the screen from which the present screen was called and continues with the processing.

SET SCREEN 200

1) With the above statement , it will goto screen 200 and screen 100 no more remains

2) Screen No 0 : This special screen number causes the screen to jump back to the calling screen.

set screen 0 used to go back to the previous screen.

With SET SCREEN the current screen simply specifies the next screen in the chain , control branches to this next screen as sonn as th e current screen has been processed .Return from next screen to current screen is not automatic .It does not interrupt processing of the current screen.If we want to branch to the next screen without finishing the current one ,use LEAVE SCREEN.

With CALL SCREEN , the current (calling) chain is suspended , and a next screen (screen chain) is called .The called can then return to the suspended chain with the statement LEAVE SCREEN TO SCREEN 0 .Sometime we might want to let an user call a pop up screen from the main application screen to let him enter secondary information.After they have completed their enteries, the users should be able to close the popup and return directly to the place where they left off in the main screen.Here comes CALL SCREEN into picture .This statement lets us insert such a sequence intp the current one

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
584

Hi,

SET SCREEN.

- by default in screen attributes you have defined what will be the next screen, but if you want to change the next screen dynamically we use the statement SET SCREEN.

for ex: SET SCREEN 100.

LEAVE SCREEN.

- if you want to quit from the current screen, you use this option. so by default the next screen from attributes will be picked but if you have defined the next screen using SET SCREEN that it will overwrite.

ex: SET SCREEN 100.

LEAVE SCREEN.

LEAVE TO SCREEN.

- Leave to screen is combination of above two statements.

Just refer to these links..

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbab3635c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbab1c35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbab0235c111d1829f0000e829fbfe/content.htm

Reward if helpful.

Regards,

Umasankar.

Read only

daniel_carvalho
Active Contributor
0 Likes
584

Hi Rahul,

You don't need to insert in your Module Pool (for your case):

SET SCREEN 0.

LEAVE SCREEN.

While SET SCREEN 0 moves you to the previous screen, the LEAVE SCREEN can do the same, but, remember, if you are placing these statements in the first screen of your module pool, it will terminate the Module Pool execution.

I hope you can understand my explanation.

Regards,

Daniel.

Read only

former_member150733
Contributor
0 Likes
584

SET SCREEN 0. sets the next screen of this screen (from where you are calling this statement to 0).

LEAVE SCREEN will leave the current screen to the next screen. In this case screen 0. (which leaves the program/transaction).

Ex.

1.

SET SCREEN 0.

LEAVE SCREEN .

goes to screen 0. Can be ending program / transaction.

2.

SET SCREEN 2000.

LEAVE SCREEN .

goes to screen 2000.