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

LEAVE TO LIST-PROCESSING call back

rt50896
Participant
0 Likes
1,491

Dear all,

I have a situation: A program was coded by "Execute type(type 1)" and have the input criteria as report, and then get data to make a dialog transaction to display. After change some data in dialog screen,call transaction to post document and display the document no. by "LEAVE TO LIST-PROCESSING". But when press 'BACK','EXIT' want to go to the input criteria screen,it seems not work and occurs dump. Can you tell me how to go back to initial screen directly? Tks!

ABAP code flow:


init.scr(criteria)--> dialog trans. --> List    
                  <- --- how to? ------

Regina

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,033

Hi,

If you want to go back to the original screen from where you called the list processing, use the following syntax:

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

this returns back to the original screen and then you can use the BACK button to go back to the input screen.

Regards,

Jagath

4 REPLIES 4
Read only

Former Member
0 Likes
1,033

Hi Regina,

i have two suggestions:

1) use the additional command "AND RETURN TO SCREEN XXX"

of "LEAVE TO LIST-PROCESSING"

or

2) try "LEAVE TO SCREEN XXX"

Regards

Olaf

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,033

Hi,

In PAI of the screen,

if the sy-ucomm value equals the ok-code for the BACK & EXIT,code like this.

SET SCREEN '0'.

LEAVE SCREEN.

Read only

Former Member
0 Likes
1,034

Hi,

If you want to go back to the original screen from where you called the list processing, use the following syntax:

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

this returns back to the original screen and then you can use the BACK button to go back to the input screen.

Regards,

Jagath

Read only

Former Member
0 Likes
1,033

Hi,

Sample from ALV

Try this out

CASE sy-ucomm.

WHEN 'BACK' OR 'EXIT' OR 'CANC'.

PERFORM exit_program.

ENDCASE.

FORM exit_program.

CALL METHOD o_grid_container->free.

CALL METHOD cl_gui_cfw=>flush.

IF sy-subrc NE 0.

  • Error in FLush

ENDIF.

<b>SET SCREEN '0'.</b> Or

<b>LEAVE TO SCREEN 0.</b>

ENDFORM. " EXIT_PROGRAM

OR

<b>CASE sy-ucomm.

WHEN 'EXIT' OR 'CANC'.</b>

PERFORM f9005_free_objects :

USING o_alvgrid 'ALV' text-e02 ,

USING o_dockingcontainer 'DOCKING' text-e01.<b>

LEAVE PROGRAM.</b>

<b>WHEN 'BACK'.</b>

PERFORM f9005_free_objects :

USING o_alvgrid 'ALV' text-e02 ,

USING o_dockingcontainer 'DOCKING' text-e01.

<b>SET SCREEN '0'.</b>

FORM f9005_free_objects USING pobject

value(ptype)

value(ptext).

CASE ptype.

WHEN 'ALV'.

DATA lobjectalv TYPE REF TO cl_gui_alv_grid.

lobjectalv = pobject.

IF NOT ( lobjectalv IS INITIAL ).

CALL METHOD lobjectalv->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3.

CLEAR: pobject ,

lobjectalv.

PERFORM f9006_error_handle USING ptext.

ENDIF.

WHEN 'DOCKING'.

DATA lobjectdock TYPE REF TO cl_gui_docking_container.

lobjectdock = pobject.

IF NOT ( lobjectdock IS INITIAL ).

CALL METHOD lobjectdock->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3.

CLEAR: pobject ,

lobjectdock.

PERFORM f9006_error_handle USING ptext.

ENDIF.

WHEN 'CONTAINER'.

DATA lobjectcontainer TYPE REF TO cl_gui_container.

lobjectcontainer = pobject.

IF NOT ( lobjectcontainer IS INITIAL ).

CALL METHOD lobjectcontainer->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3.

CLEAR: pobject ,

lobjectcontainer.

PERFORM f9006_error_handle USING ptext.

ENDIF.

WHEN OTHERS.

sy-subrc = 1.

PERFORM f9006_error_handle USING text-e04.

ENDCASE.

ENDFORM. " f9005_free_objects

Hope this helps.