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 issue

Former Member
0 Likes
894

Please use more informative subject in future

Hi,

I've developed an ALV Report containing ceratin events.

Now can anyone explain how to generate a spool request for an ALV Report and view it's output in the form of a Spool.

Thanks,

Reshmi G.

Edited by: Matt on Mar 4, 2009 2:25 PM

9 REPLIES 9
Read only

Former Member
0 Likes
874

This message was moderated.

Read only

keerthy_k
Product and Topic Expert
Product and Topic Expert
0 Likes
874

Hi,

U can use the below FMs for that:

CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'

EXPORTING

dest = 'LOCL'

layout =

name =

suffix1 =

suffix2 =

copies =

prio =

immediate_print =

auto_delete =

titleline =

receiver =

division =

authority =

posname =

acttime =

lifetime = '8'

append =

coverpage =

codepage =

doctype =

importing

handle = v_handle

spoolid = gd_spool_nr

rc = v_rc

errmessage = v_errmessage.

LOOP AT i_mara.

v_text = i_mara-matnr.

CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'

EXPORTING

handle = v_handle

text = v_text

length =

codepage =

truncate =

importing

rc = v_rc

errmessage = v_errmessage

EXCEPTIONS

handle_not_valid = 1

OTHERS = 2.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDLOOP.

CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'

EXPORTING

handle = v_handle

IMPORTING

rc = v_rc

errmessage = v_errmessage

EXCEPTIONS

handle_not_valid = 1

OTHERS = 2.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

EXPORTING

src_spoolid = gd_spool_nr

no_dialog = c_no

dst_device = c_device

IMPORTING

pdf_bytecount = gd_bytecount

TABLES

pdf = it_pdf_output

EXCEPTIONS

err_no_abap_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_destdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11

OTHERS = 12.

CHECK sy-subrc = 0.

Keerthi

Edited by: Keerthy K on Mar 4, 2009 1:09 PM

Read only

Former Member
0 Likes
874

This message was moderated.

Read only

Former Member
0 Likes
874

SEARCH IN SCN BEFORE POSTING

Read only

Former Member
0 Likes
874

Please [search|https://www.sdn.sap.com/irj/scn/advancedsearch?query=generatespoolof+ALV&cat=sdn_all] in SCN.

Read only

dev_parbutteea
Active Contributor
0 Likes
874

Hi,

run the report in background, it will automatically create a spool request for the output of the report.

Read only

Former Member
0 Likes
874

This message was moderated.

Read only

Former Member
0 Likes
874

This message was moderated.

Read only

matt
Active Contributor
0 Likes
874

Please use more informative subject in future