‎2012 Mar 14 4:20 AM
Dear Friends,
I have developed alv report with check boxes.
i have a 'execute' button, for selected records one bapi and bdc are running
then invoice number & sales order num. I am displaying it using another alv grid(without check box and some other fields).
My requirement is when i click on back button it has to take me to selection screen instead of checkbox alv screen.
I used another status and it_events for the second.. and wrote the code for 'Back' button.
it is not working fine.. can any one help me please...
{code}
when 'EXECUTE'.
.. BAPI_SALERORDER_CREATEFROMDAT2..
...................................................................
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = c_prog
i_grid_title = 'Invoices & Sales Orders Raised List'
is_layout = is_layout
it_fieldcat = it_fcat1
i_default = 'X'
i_save = 'A'
it_events = it_events
tables
t_outtab = it_main1
endcase.
{code}
‎2012 Mar 14 4:39 AM
Check this link
*&---------------------------------------------------------------------*
*& Form GOTO_SELECTION_SCREEN
*&---------------------------------------------------------------------*
form goto_selection_screen.
*
data: seltab like rsparams occurs 5,
repid like rsvar-report.
*
repid = sy-repid.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = repid
tables
selection_table = seltab
exceptions
not_found = 1.
if sy-subrc = 0.
submit (sy-repid) via selection-screen
with selection-table seltab.
else.
leave program.
endif.
*
endform. " GOTO_SELECTION_SCREEN
‎2012 Mar 14 4:30 AM
At start of selection use this FM to collect all the selection screen parameters
data: gi_selection type standard table of rsparams.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = sy-repid " Program Name
tables
selection_table = gi_selection " Selection screen details
exceptions
not_found = 1
no_report = 2
others = 3.
After Calling FM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = c_prog
i_grid_title = 'Invoices & Sales Orders Raised List'
is_layout = is_layout
it_fieldcat = it_fcat1
i_default = 'X'
i_save = 'A'
it_events = it_events
tables
t_outtab = it_main1
importing
es_exit_caused_by_user = gs_exit_caused_by_user
apply this code
if sy-subrc eq 0.
if gs_exit_caused_by_user-back eq gc_x.
submit (sy-repid) with selection-table gi_selection
via selection-screen.
else.
if gs_exit_caused_by_user-exit eq 'X'.
submit (sy-repid) with selection-table gi_selection
via selection-screen.
else.
if gs_exit_caused_by_user-cancel eq 'X'.
leave program.
endif.
endif.
endif.
endif.
Hope it solves ur problem..
‎2012 Mar 14 4:39 AM
Check this link
*&---------------------------------------------------------------------*
*& Form GOTO_SELECTION_SCREEN
*&---------------------------------------------------------------------*
form goto_selection_screen.
*
data: seltab like rsparams occurs 5,
repid like rsvar-report.
*
repid = sy-repid.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = repid
tables
selection_table = seltab
exceptions
not_found = 1.
if sy-subrc = 0.
submit (sy-repid) via selection-screen
with selection-table seltab.
else.
leave program.
endif.
*
endform. " GOTO_SELECTION_SCREEN
‎2012 Mar 14 6:00 AM
Dear Madhu,
Your code snippet solved my issue.
Thnak you so much.