Application Development and Automation 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: 
Read only

Multiple ALV reports not working in batch mode

Former Member
0 Likes
575

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

2 REPLIES 2
Read only

former_member226519
Active Contributor
0 Likes
525

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.

Read only

Former Member
0 Likes
525

Problem was missing a refresh on a table - so resolved.