03-29-2009 9:46 AM
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
03-29-2009 11:35 AM
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
03-29-2009 10:38 AM
HI,
In the PAI of the 5th screen use this statments to call the screen 4
SET SCREEN <4>.
LEAVE SCREEN.
03-29-2009 10:40 AM
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
03-29-2009 11:35 AM
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
03-30-2009 1:07 PM
hi !
in from user-coomand
when 'back'.
submit ztest(your reprt name) via selection screen