Application Development 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: 

Return to Selection-screen from ALV

Former Member
0 Kudos

Hi All,

I have a report that call an ALV and in this there is a button that call another ALV. I need to return on SELECTION-SCREEN from second ALV when user clicks on button BACK.

Can you help me, please?

Thank you.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

In the first ALV program, you have a USER_COMMAND or a handle method form where you call the second ALV, just after the call set the exit flag (user_command) or force function code back (ooalv) and the first ALV will close, and user will be directed to previous (selection) screen.

So after the call of the second ALV :

- REUSE ALV - in USER_COMMAND form set parameter subfield rs_selfield-exit

- OOALV - in PAI USER_COMMAND or double_click handle method, add a LEAVE TO SCREEN 0

Regards,

Raymond

12 REPLIES 12

Former Member
0 Kudos

Hi,

are you using oops ALV.

capture function code in PAI and write call screen 1000.

raymond_giuseppi
Active Contributor

In the first ALV program, you have a USER_COMMAND or a handle method form where you call the second ALV, just after the call set the exit flag (user_command) or force function code back (ooalv) and the first ALV will close, and user will be directed to previous (selection) screen.

So after the call of the second ALV :

- REUSE ALV - in USER_COMMAND form set parameter subfield rs_selfield-exit

- OOALV - in PAI USER_COMMAND or double_click handle method, add a LEAVE TO SCREEN 0

Regards,

Raymond

0 Kudos

Good.. this is the perfect answer for this issue.

0 Kudos

I am searching for this, and your answer perfect for me, Thanks bro..

Former Member

when user clicks on button BACK.

write following 1 line

SUBMIT ZREPORT via SELECTION-SCREEN.

Former Member

Hi,

write the below code on back button comm.

LEAVE TO SCREEN 0.

Former Member
0 Kudos

Hi

if you have a module pool screen for your selection screen then you need to fetch the function code of the back button on ALV list and call your screen on clicking that back button.

like

case sy-ucomm.

when 'BACK'.

call screen 1000 <your selection screen number>.

endcase.

other wise if you have created your selection screen using select-options, then write.

case sy-ucomm.

when 'BACK'.

leave to screen 0.

endcase.

leave to screen 0 always goto the previous screen from where you reached to the current screen.

Thanks

Lalit Gupta

Former Member
0 Kudos

Hi leo,

If you want to navigate to the selection-screen from your 2nd secondary list or any in ALV, just try below code after you call the ALV function module.

IF SY-UCOMM = '&F03'.
  LEAVE TO SCREEN 0.
ENDIF.

Regards,

Kavitha.

former_member506713
Participant
0 Kudos

write the below code for back button press for 2nd ALV.

case sy-ucomm.

when 'BACK'.
leave to screen 0.
endcase. 

Former Member
0 Kudos

Hi,

If you are using OOPS ALV then write the below code in PAI event

case SY-UCOMM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

olsathappan
Explorer
0 Kudos

Hi

Case SY-UCOMM will not work directly i think. First, copy the Standard GUI and use it in your report. now use the SY-UCOMM.

To find Standard GUI, while the ALV is displayed, goto System -> Status -> GUI status.

regards,

Sathappan

Former Member
0 Kudos

thank you