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

spool list in background

Former Member
0 Likes
2,281

Hii everybody,

I am not able to generate the background spool list for this report. When executed in background, the job shows successful execution, but when I see spool status, it shows waiting and the spool has incomplete list. The bottom part of the spool list has all vertical lines... Any guesses what might be the problem? I am able to see the output when report ran in foreground. It is an ALV grid report.

PLese reply me fast as it is urgent.

M A

1 ACCEPTED SOLUTION
Read only

Former Member
1,683

YOu cannot get the correct output if you use GRID ALV and run it in background.

Background mode and ALV GRID doesn't go together.

YOu have to use an alv list to get the output in background mode.

like:

if sy-batch = 'X'.

call function 'REuse_alv_list_display'

else.

call function 'REUSE_ALV_GRID_DISPLAY'

endif.

Hii everybody,

I am not able to generate the background spool list for this report. When executed in background, the job shows successful execution, but when I see spool status, it shows waiting and the spool has incomplete list. The bottom part of the spool list has all vertical lines... Any guesses what might be the problem? I am able to see the output when report ran in foreground. It is an ALV grid report.

PLese reply me fast as it is urgent.

M A

7 REPLIES 7
Read only

Former Member
1,684

YOu cannot get the correct output if you use GRID ALV and run it in background.

Background mode and ALV GRID doesn't go together.

YOu have to use an alv list to get the output in background mode.

like:

if sy-batch = 'X'.

call function 'REuse_alv_list_display'

else.

call function 'REUSE_ALV_GRID_DISPLAY'

endif.

Read only

0 Likes
1,683

Thanks a lot to all of you.

Read only

0 Likes
1,683

Ravi-

Can you please let me know how is this checkbox named "Printout with date, title and Page number" in the display tabstrip of change layout option is checked by default? I am using normal ALV grid/list function modules.

Thanks

M A

Read only

Former Member
0 Likes
1,683

generally ALV in foreground works fine...in background it sometimes gives problem...instead of ALV try using normal report and execute in background...This will generate complete spool list.

Read only

Former Member
0 Likes
1,683

HI,

Just wait for some more time to generate the Spool 100%, then see the spool,

Regards

Sudheer

Read only

Former Member
0 Likes
1,683

Hi Ahmed,

if you are on Lower Versions, then Try to Call the ALV_LIST_DISPLAY FM instead of Grid in Background.

which version you are in.

if sy-batch = 'X'.

call 'LISTFM'.

else.

Call "GRIDFM'.

endif.

if you are below 4.7 or equal 4.7 try the above solution.

Regards

Vijay

Read only

Former Member
0 Likes
1,683

Hope you have end spool writing with new-page print off.

form write_to_spool.

data : l_params type pri_params, "new spool params

l_destination type pri_params-pdest value 'LOCL'. "printer name

*Get the print parameters.

call function 'GET_PRINT_PARAMETERS'

EXPORTING

copies = 1

department = 'SYSTEM'

destination = l_destination

expiration = 2

immediately = ' '

layout = 'X_65_255'

line_count = 65

line_size = 255

list_name = 'XYZ'

list_text = 'ABC'

mode = ' '

new_list_id = 'X'

no_dialog = 'X'

receiver = 'SAP*'

release = 'X'

sap_cover_page = 'X'

user = sy-uname

IMPORTING

out_parameters = l_params

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

others = 4.

case sy-subrc.

when 1.

raise get_print_info_not_found.

when 2.

raise get_print_invalid_prt_params.

when 3.

raise get_print_invalid_arch_params.

when 4.

raise get_print_others.

endcase.

*start spool writing.

new-page print on parameters l_params no dialog.

uline.

skip.

        • write your contents

uline.

*end spool writing.

new-page print off.

endform. " write_to_spool