‎2007 Jan 30 5:02 PM
hi.
this is arijit.i have a doubt.
can anyone tell m the purpose & diffrence between this two statement???
LEAVE LIST PROCESSING
LEAVE TO LIST PROCESSING.....
bye
i wil give point to appropiate answer
‎2007 Jan 30 5:05 PM
Hi Arijit,
Check these links to know about LEAVE LIST-PROCESSING and LEAVE TO LIST-PROCESSING.
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/leave_01.htm
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/leave_li.htm
<b>LEAVE TO LIST PROCESSING:</b> Switches from "dialog processing" (module pool, screens) of the current transaction to "list processing". You can then use all the usual list layout commands ( WRITE , SKIP , ...).
LEAVE LIST-PROCESSING continues with "Processing Before Output" ( PBO ) of the screen which controls the list processing.
<b>LEAVE LIST-PROCESSING:</b> returns from list processing and re-processes the return screen (LEAVE TO LIST-PROCESSING) .
<b>Diffrence betwenn two statements:</b>
LEAVE TO LIST PROCESSING switches from dialog processing to list processing, whereas LEAVE LIST-PROCESSING returns from list processing and comes back to dialog process specified by the return screen of LEAVE TO LIST-PROCESSING.
Thanks,
Vinay
‎2007 Jan 30 5:13 PM
LEAVE TO LIST-PROCESSING
Basic form 5
LEAVE TO LIST-PROCESSING.
Addition
... AND RETURN TO SCREEN scr.
Effect
Switches from "dialog processing" (module pool, screens) of the current transaction to "list processing". You can then use all the usual list layout commands ( WRITE , SKIP , ...).
After leaving the current screen, the list formatted in this way is displayed implicitly or explicitly by LEAVE SCREEN . Here, all list programming options are possible, e.g. line selection, F keys , windows.
LEAVE LIST-PROCESSING continues with "Processing Before Output" ( PBO ) of the screen which controls the list processing.
Note
After switching to list processing mode with SET PF-STATUS ... , you are recommended to define a GUI (Graphical User Interface) of type List or List in dialog box .
Addition
... AND RETURN TO SCREEN scr.
Effect
LEAVE LIST-PROCESSING continues with "Processing Before Output" ( PBO ) of the screen scr.
Note
Using LEAVE LIST-PROCESSING to leave list processing explicitly is only necessary in exceptional cases; normally, the standard F keys (F3 Back and F15 Exit ) are sufficient.
Basic form
LEAVE LIST-PROCESSING.
Effect
Returns from list processing and re-processes the return screen (LEAVE TO LIST-PROCESSING) .
Note
LEAVE LIST-PROCESSING is not required if you use the standard F keys in list processing (F3 Back and F15 Exit ).
‎2007 Jan 30 5:13 PM
Hi arijit,
leave list processing allows the control from list--->screen
leave to list processing( can be returned) from screen----> list
however the following link clearly states the difference
http://help.sap.com/saphelp_46c/helpdata/en/9f/db9d2f35c111d1829f0000e829fbfe/content.htm
hope this helps u a bit,
all the best,
regards,
sampath
mark helpful answers
‎2007 Jan 30 5:29 PM
Hi,
<b>Leave To List Processing :</b> If you need to display your output in a List while working with Dialog Programming, you have to use Leave To List Processing. There are various options like Suppress Dialog (which suppresses the dialog of the called screen) and Return To Screen dynnr (which when pressed Back on the List will return to the screen mentioned by dynnr).
<b>Leave List Processing :</b> After displaying your list in dialog programming, it will end the list processing and will return to the screen number mentioned while calling Leave To List Processing or whichever screen has been set).
Reward points if the answer is helpful.
Regards,
Mukul
‎2007 Jan 30 5:57 PM
hi
good
go through this
o pass control from the dialog processor to the list processor, you must include the following statement in one of the dialog modules:
LEAVE TO LIST-PROCESSING [AND RETURN TO SCREEN <nnnn>].
You can include this statement in either the PBO or the PAI event. Its effect is to start the list processor and display the basic list after the PAI processing of the current screen. The basic list contains any list output from all PBO and PAI modules that have been executed up to that point.
If detail lists are defined in the corresponding event blocks of the ABAP program (AT LINE-SELECTION, AT USER-COMMAND), user actions on the basic list will lead to the detail list, and further interaction will lead to further list levels.
You can leave list processing in two ways:
By leaving the basic list using the Back, Exit, or Cancel function.
By using the following statement during list processing:
LEAVE LIST-PROCESSING.
In both cases, control returns from the list processor to the dialog processor. Each time this occurs, the entire list system is initialized. Any subsequent list output statements in PBO and PAI modules apply to an empty basic list.
By default, the dialog processor returns to the PBO processing of the screen from which the list processor was called. The optional addition AND RETURN TO SCREEN allows you to specify a different screen in the current screen sequence at whose PBO event you want to resume processing. In particular, the statement
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
can be used to end the current screen sequence and return to the point from which it had originally been called.
Recommended Procedure
If you want to display lists during screen processing, you should create a separate screen for each list system that you want to call. This screen encapsulates the creation and display of the basic list. It can then be called from anywhere in the program using CALL SCREEN.
The actual screen mask of this screen can remain empty. You do not need any PAI modules, and only a single PBO module. In the PBO module, you define the basic list of the list system and call the list processor.
First, use the
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
statement to call the list display at the end of the screen, and to ensure that, after leaving the list, you return to the point from which the screen was called.
Next, set a GUI status for the list; for example, the default list status SPACE or a list status of your own.
Use one of the following statements to ensure that the empty screen is not displayed:
SUPPRESS DIALOG.
or
LEAVE SCREEN. Instead, the list is displayed immediately at the end of the screen.
Now define the entire basic list, and place any necessary data in the HIDE area.
If you want to process user actions on the list, you need to define the relevant event blocks in your ABAP program. If you want to call more than one independent list system in the program, you must ensure that you can tell them apart in the list event processing. You cannot do this using SY-DYNNR, since the container screen for a list is always number 120. Instead, you could assign a different GUI status to each list, and distinguish between the list systems using the value of SY-PFKEY, or you could place some unique information in the HIDE area of each list system.
Example
REPORT demo_leave_to_list_processing .
TABLES sdyn_conn.
DATA: wa_spfli TYPE spfli,
flightdate TYPE sflight-fldate.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE user_command_0100.
CALL SCREEN 500.
SET SCREEN 100.
ENDMODULE.
MODULE call_list_500 OUTPUT.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SET PF-STATUS space.
SUPPRESS DIALOG.
SELECT carrid connid cityfrom cityto
FROM spfli
INTO CORRESPONDING FIELDS OF wa_spfli
WHERE carrid = sdyn_conn-carrid.
WRITE: / wa_spfli-carrid, wa_spfli-connid,
wa_spfli-cityfrom, wa_spfli-cityto.
HIDE: wa_spfli-carrid, wa_spfli-connid.
ENDSELECT.
CLEAR: wa_spfli-carrid.
ENDMODULE.
TOP-OF-PAGE.
WRITE text-001 COLOR COL_HEADING.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE sy-lisel COLOR COL_HEADING.
ULINE.
AT LINE-SELECTION.
CHECK not wa_spfli-carrid is initial.
SELECT fldate
FROM sflight
INTO flightdate
WHERE carrid = wa_spfli-carrid AND
connid = wa_spfli-connid.
WRITE / flightdate.
ENDSELECT.
CLEAR: wa_spfli-carrid.
This example switches to list processing during the screen processing for screen 100. Screen 100 has a single input field - the component CARRID from the ABAP Dictionary structure SDYN_CONN.
It has the following flow logic:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
MODULE USER_COMMAND_0100.
The PAI module USER_COMMAND_100 calls screen 500 using the CALL SCREEN statement. This screen encapsulates a basic list. It has the following flow logic:
PROCESS BEFORE OUTPUT.
MODULE CALL_LIST_500.
PROCESS AFTER INPUT.
The module CALL_LIST_500 defines the basic list and switches to list processing. Since the next screen after list processing is screen 0, screen 500 is a one-screen screen chain. After list processing, control returns to the position in USER_COMMAND_100 from which screen 500 was called.
If the user selects a line on the basic list, a detail list appears. This is achieved through the event block AT LINE-SELECTION. The program also contains event blocks for TOP-OF-PAGE and TOP-OF-PAGE DURING LINE-SELECTION, which define page headers for both the basic list and detail list.
Since there is only one list system in this program, there is no need for case distinctions within the list events.
thanks
mrutyun^