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: 

Going back to earlier screen (navigation) in ALV interactive screen

Former Member
0 Kudos

Hi all,

I have requirement of going to 4th alv screen on clicking back on screen 5.(all 5 screens are ALV).But it comes out to selection screen instea going to screen 4(ALV).Please guide me for the same.

Thank you.

Edited by: sanu debu on Mar 29, 2009 10:51 AM

Edited by: sanu debu on Mar 29, 2009 10:53 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

use it this way....

firstly set flag for each screen when you dislpay them say for the first screen you set the flag = 1 and for second u set it to 2 and so on.... then in the call function use as used below... important user_command to be passed

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'        " this is the subroutine of your program where you control the navigations....
i_callback_pf_status_set = 'PF_STATUS'
it_fieldcat = it_field
TABLES
t_outtab = i_final
EXCEPTIONS
program_error = 1
OTHERS = 2.


FORM USER_command using rs_ucomm type sy-ucomm rs_selfield type slis-selfield.
   case rs_ucomm.
     when 'BACK' or 'RW' or '%EX'.
           if flag = 5. 
               flag = 4.
"               call the subroutine which displays the fourth ALV screen or  call the FM reuse with the table used in fourth screen.
          elseif flag = 4.
             flag = 3.
"               call the subroutine which displays the third ALV screen or  call the FM reuse with the table used in third screen.

          elseif flag = 3.
             flag = 2.
"               call the subroutine which displays the second ALV screen or  call the FM reuse with the table used in second screen.

          elseif flag = 2.
             flag = 1.
"               call the subroutine which displays the first ALV screen or  call the FM reuse with the table used in first screen.

          elseif flag = 1.
leave to screen 0.
   endcase.

endform.

Hope this resolves the issue

Regards,

Siddarth

4 REPLIES 4

Former Member
0 Kudos

HI,

In the PAI of the 5th screen use this statments to call the screen 4

SET SCREEN <4>.

LEAVE SCREEN.

Former Member
0 Kudos

you can use PF-STATUS activate the BACK buttion in the PF Status.

Pass this ALV PF status in the function module "REUSE_ALV_GRID_DISPLAY".

FORM pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'Z_STATUS'.

ENDFORM.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

i_callback_pf_status_set = 'PF_STATUS'

it_fieldcat = it_field

TABLES

t_outtab = i_final

EXCEPTIONS

program_error = 1

OTHERS = 2.

thanks

Former Member
0 Kudos

Hi ,

use it this way....

firstly set flag for each screen when you dislpay them say for the first screen you set the flag = 1 and for second u set it to 2 and so on.... then in the call function use as used below... important user_command to be passed

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'        " this is the subroutine of your program where you control the navigations....
i_callback_pf_status_set = 'PF_STATUS'
it_fieldcat = it_field
TABLES
t_outtab = i_final
EXCEPTIONS
program_error = 1
OTHERS = 2.


FORM USER_command using rs_ucomm type sy-ucomm rs_selfield type slis-selfield.
   case rs_ucomm.
     when 'BACK' or 'RW' or '%EX'.
           if flag = 5. 
               flag = 4.
"               call the subroutine which displays the fourth ALV screen or  call the FM reuse with the table used in fourth screen.
          elseif flag = 4.
             flag = 3.
"               call the subroutine which displays the third ALV screen or  call the FM reuse with the table used in third screen.

          elseif flag = 3.
             flag = 2.
"               call the subroutine which displays the second ALV screen or  call the FM reuse with the table used in second screen.

          elseif flag = 2.
             flag = 1.
"               call the subroutine which displays the first ALV screen or  call the FM reuse with the table used in first screen.

          elseif flag = 1.
leave to screen 0.
   endcase.

endform.

Hope this resolves the issue

Regards,

Siddarth

Former Member
0 Kudos

hi !

in from user-coomand

when 'back'.

submit ztest(your reprt name) via selection screen