‎2006 Dec 08 8:20 AM
Hi All,
Can any one give me what is the difference between set screen (screen number) ,leave screen and call screen (screen number.
Thanks&Regards
Ramu.
‎2006 Dec 08 8:24 AM
Please check the document.
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbab1c35c111d1829f0000e829fbfe/frameset.htm
‎2006 Dec 08 8:26 AM
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.
CALL SCREEN.
-If you want to call any screen from current screen or program you can give this command
ex: CALL SCREEN 100.
Regards,
pankaj singh.
reward if helpful.
‎2006 Dec 08 8:26 AM
hi Ramu,
2. SET SCREEN 5000 (in pai module)
a) will first complete the pai processing
b) the it will swith to screen number 5000
3. leave SCREEN.
A) immediately it will swith to NEXT screen number
(which is specified in NEXT SCREEN attribute )
4. leave to screen 5000
a) IMMEDIATELY LEAVES THE CURRENT SCREEN
AND SWITCHES TO SCREEEN 5000
(DOES NOT COMPLETE PAI PROCESSING)
Regards,
Santosh
‎2006 Dec 08 8:27 AM
Hi,
SET SCREEN:
SET SCREEN dynnr :
This statement sets thescreen with the screen number specified in dynnr, as the next screen for processing of the current screen. For dynnr, a data object of type n and length 4 is expected. It must contain either the screen number of a screen in the main program of the current program group or the value 0, otherwise a non-catchable exception will be triggered. The specified next screen overwrites the previously-set next screen.
The next screen is automatically called when the system finishes the PAI processing of the current screen. If the screen number of the next screen is 0, the current next screen is ended.
One next screen is always set during the processing of a screen. After you call a screen, the next screen whose characteristics are defined statically, applies; this next screen can be overwritten with the SET SCREEN statement for the duration of the actual next screen processing.
LEAVE SCREEN:
LEAVE { SCREEN | {TO SCREEN dynnr} }.
Variants:
1. LEAVE SCREEN.
2. LEAVE TO SCREEN dynnr.
This statement ends the processing of the current screen. The current processing block of the ABAP program and the current processing block of the dynpro are left immediately.
Variant 1
LEAVE SCREEN.
The variant LEAVE SCREEN calls the current next screen. This is either statically specified in the properties of the current screen or has been set before using the statement SET SCREEN.
Variant 2
LEAVE TO SCREEN dynnr.
The variant LEAVE TO SCREEN calls the screen with the number dynnr as the next screen. A data object of the type n of the length 4 is expected for dynnr. It must contain either the screen number of a screen in the main program of the current program group or the value 0. Otherwise, an exception that cannot be handled is raised. This statement is a short form of the statements SET SCREEN dynnr and LEAVE SCREEN.
This statement does not terminate the entire dynpro sequence; it branches to an additional screen in the same sequence. Only if the number 0 is used to branch to the next screen, LEAVE SCREEN terminates the screen sequence.
CALL SCREEN:
CALL SCREEN dynnr
[STARTING AT col1 lin1
[ENDING AT col2 lin2]].
This statement calls the dynpro with the dynpro number specified in dynnr. For dynnr, a data object of type n and length 4 is expected. The call starts a new dynpro sequence, which is embedded into the current dynpro sequence. The dynpro with dynpro number dynnr is the initial dynpro of the dynpro sequence. In a dynpro sequence started by a transaction code, you can nest up to 50 other dynpro sequences.
The called dynpro sequence is terminated as soon as one of the involved dynpros branches to a next dynpro with number 0. The program continues after CALL SCREEN.
The statement CALL SCREEN accesses the dynpros of the relevant main program of the current program group and these use the global data and dialog modules of the main program. Except when calling a dynpro in an externally called subroutine, the main program usually is the current program. If the specified dynpro does not exist in the main program of the program group, an untreatable exception occurs.
regards
Rakesh
‎2006 Dec 08 8:28 AM
SET SCREEN :
For dynamically changing next screen paramter in screen ( dialogue programing ).
LEAVE SCREEN:
ends the current screen and calls the subsequent screen.
CALL SCREEN:
calls other screen and process go that screen and When the screen sequence ends, control returns to the statement after the original CALL SCREEN statement.
‎2006 Dec 08 8:28 AM
Hi Ramu,
If u Call screen 200 from screen 100 it will take u to screen 200 without killing 100.
with set screen 200 from screen 100 it will kill 100(u cant come back) it will go to 200
LEAVE SCREEN is to leave screen.
Here is example to know about leave and set screens..
CALL SCREEN <DYNPRO>.
- SET SCREEN <DYNPRO>. LEAVE SCREEN.
- LEAVE TO SCREEN <DYNPRO>.
these stataments do the same thing: to go screen <DYNPRO>.
But if you use CALL SCREEN, everytime a screen is called it is placed in a new internal mode, so you can use LEAVE TO SCREEN 0 to back to calling screen automatically:
- CALL SCREEN 100: it goes to screen 100;
- LEAVE TO SCREEN 0: it back to calling screen from screen 100.
If you use LEAVE SCREEN you can't use LEAVE TO SCREEN 0, but you have to indicate the number of calling screen.
The problem with CALL SCREEN is that the system can only run some internal modes at the same time, after a dump occurs.
So if you have to develop a module pool with many screens it's better to use LEAVE SCREEN.
Regards,
Kumar
‎2006 Dec 08 9:38 AM
Hi Mitta Ramu ,
CALL SCREEN scr .
goes in the PBO(Process Before Output) of screen "scr" .
SET SCREEN scr .
Sets the number of the NEXT screen.
LEAVE SCREEN .
Leaves the current screen and controls goes to the NEXT screen .
-
Say the current screen number is "1000"
and you use the statement
CALL SCREEN '2000'
in the code of screen 1000 , then you will be taken to the screen 2000 .
Then in the code of the screen '2000' , if the following code is encountered :
SET SCREEN 0 .
LEAVE SCREEN .
The control of the execution will get transferred to the next statement after
"CALL SCREEN '2000'" statement in the code for screen 1000 .
-
This means that by setting the next screen as "0" , the NEXT screen in the
sequence is the screen which called the current screen .
-
You can also try SET SCREEN scr , with scr not equal to "0" . In that case , on
encountering LEAVE SCREEN statement , control will get transferred to screen "scr" .
Regards ,
Dhera Kamlesh H. R.
‎2006 Dec 08 9:40 AM
ex:
There are 2 screens 100 , 200 & 500 .
if text_field <= 1000 .
call screen 200 . " This calls the screen 200 .
else .
leave screen . " Leaves the present screen .
set screen 500 . " It over writes the present screen i.e., screen 100 .
endif .