2009 Jun 02 2:43 PM
All,
I have a report that creates a detail and a summary ALV report in one program.
When run in the foreground it works great - runs the ALV detail first and displays it and you arrow back and then the runs the ALV summary report and displays it.
But when run in the background - I get the ALV detail report sent to the spooler but nothing for the ALV summary report. Well I do get a second report sent to the spooler but it does not have any data displayed.
I ran this in debug mode - faking out the program to believe it was in Batch Mode.
Everything appears to look correct when it does the call to ALV - the outtab table has the summary data in it.
Here is the calls to ALV:
Function Module to display report in ALV List Format
IF l_detail = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_user_command = c_ucomm
i_grid_title = p_title
i_grid_settings = w_alv_grid
is_layout = w_alv_layout
it_fieldcat = w_alv_field
it_sort = w_alv_sort
i_default = 'X'
i_save = ' '
it_events = w_alv_event
is_print = w_alv_print
TABLES
t_outtab = t_detail
EXCEPTIONS
program_error = 1
OTHERS = 2.
ELSEIF l_summry = 'X'.
be sure th file has the new SNO values assigned B4 calling!
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_user_command = c_ucomm
i_grid_title = p_title
i_grid_settings = w_alv_grid
is_layout = w_alv_layout
it_fieldcat = w_alv_field
it_sort = w_alv_sort
i_default = 'X'
i_save = ' '
it_events = w_alv_event
is_print = w_alv_print
TABLES
t_outtab = t_summry
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDIF.
Maybe there something I should be calling or clearing out in the above parms when trying to create to spoolfiles from ALV in background mode.
Any suggestions are most apprecaited.
Thanks.
Scott
2009 Jun 02 2:56 PM
before calling the ALV create a separate spool for each list.
if sy-batch = 'X'.
get the print parameters with FM GET_PRINT_RARAMETERS
pass the parameters (you can change them if you like) to
NEW-PAGE PRINT ON PARAMETERS your_parameters NO DIALOG
endif.
2009 Jun 02 6:00 PM