0% found this document useful (0 votes)
103 views7 pages

How To Download A Huge Spool Into PDF - SAP Q&A

Uploaded by

phogat project
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views7 pages

How To Download A Huge Spool Into PDF - SAP Q&A

Uploaded by

phogat project
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Community

(http://www.sap.com/)
(https://community.sap.com)
(/users/login.html?
redirect_to=%2Fquestions%2F10106338%2Fhow-to-
download-a-huge-spool-into-pdf.html)
Ask a Question (https://answers.sap.com/questions/ask.html) Write a Blog Post (https://blogs.sap.com/wp-admin/post-new.php) Login (/users

Search the SAP Community

Former Member
How to download a huge spool into PDF
Jun 27, 2013 at 09:43 PM | 959 Views
uestions%2F10106338%2Fhow-to-download-a-huge-
spool-into-
ta%3D10106338%26s_csrf%3D1607311451872.954)
0
uestions%2F10106338%2Fhow-to-download-a-huge-
spool-into-
ata%3D10106338%26s_csrf%3D1607311451872.954)
(/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-pdf.html%3Fs_action%3Dfollow%26s_csrf%3D1607311451872.954)
Follow RSS Feed

Hi Team,

I have a huge data in the spool and it contains around 1740 Pages and need to download the same in PDF. Is there any standard program does download or any FM.

Regards,

Sunil Kumar.

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-


pdf.html%3Fs_action%3Dcomment%26s_data%3D10106338%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3DreportQuestion%26s_data%3D10106338%26s_csrf%3D1607311451872.954)

Assigned Tags

ABAP Development (/tags/833755570260738661924709785639136) |

Related questions

how to get the spool id or how to create a spool id for the report . (https://answers.sap.com/questions/2547888/how-to-get-the-spool-id-or-how-to-create-a-spool-i.html)
By Former Member ( https://people.sap.com/former.member) Jun 22, 2007

emailing scripts & forms (https://answers.sap.com/questions/1357643/emailing-scripts--forms.html)


By Former Member ( https://people.sap.com/former.member) May 12, 2006

7 Answers

Sort by: Votes | Newest | Oldest

Best Answer

Arindam Mondal ( https://people.sap.com/arindam.mondal)


(/users/51676/arindammondal.html)

Jun 27, 2013 at 11:24 PM

Hi,
Fquestions%2F10106338%2Fhow-to-download-a-huge-
data%3D10106445%26s_csrf%3D1607311451872.954)
hildToView%3D10106445%23answer-
2
Please check the report RSTXPDFT4. This converts spool to PDF.
Fquestions%2F10106338%2Fhow-to-download-a-huge-
s_data%3D10106445%26s_csrf%3D1607311451872.954)
hildToView%3D10106445%23answer-

Cheers,

Arindam
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dcomment%26s_data%3D10106445%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dreport%26s_data%3D10106445%26s_csrf%3D1607311451872.954) |
/
Share

4 Comments

Arindam Mondal ( https://people.sap.com/arindam.mondal)  Former Member

Jul 01, 2013 at 10:14 AM (/comments/10111856/view.html)


Hi,

Try following the steps mentioned here might help. Its a combination of use of both the reports mentioned.

http://wiki.sdn.sap.com/wiki/display/ABAP/Creating+or+Converting+Large+PDF+Files (http://wiki.sdn.sap.com/wiki/display/ABAP/Creating+or+Converting+Large+PDF+Files)

Cheers,

Arindam

Like (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-pdf.html%3FchildToView%3D10111856%23comment-
10111856%26s_action%3Dlike_comment%26s_data%3D10111856%26s_csrf%3D1607311451872.954) 0 |
Share
|
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3DreportComment%26s_data%3D10111856%26s_csrf%3D1607311451872.954)

Show all

Comment on This Answer (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-


pdf.html%3Fs_action%3Dcomment%26s_data%3D10106445%26s_csrf%3D1607311451872.954)

K.Arun Prabhu ( https://people.sap.com/karun.prabhu)


(/users/306661/karunprabhu.html)
Jul 01, 2013 at 07:24 AM

Hi Sunil Kumar,
Fquestions%2F10106338%2Fhow-to-download-a-huge-
childToView%3D10111137%23answer-
data%3D10111137%26s_csrf%3D1607311451872.954)
2
Make use of Standard program RSTXPDFT4 to convert spool to pdf.
Fquestions%2F10106338%2Fhow-to-download-a-huge-
s_data%3D10111137%26s_csrf%3D1607311451872.954)
childToView%3D10111137%23answer-

For instance,

rsp-selname = 'SPOOLNO'.

rsp-kind = 'P'.

rsp-sign = 'I'.

rsp-option = 'EQ'.

rsp-low = spool_no.

append rsp.

submit RSTXPDFT4 with selection table rsp AND RETURN.

Regards.
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dcomment%26s_data%3D10111137%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dreport%26s_data%3D10111137%26s_csrf%3D1607311451872.954) |
Share

Former Member

Jun 28, 2013 at 05:15 AM

see the following example:


Fquestions%2F10106338%2Fhow-to-download-a-huge-
data%3D10106765%26s_csrf%3D1607311451872.954)
hildToView%3D10106765%23answer-
1
*Tables
Fquestions%2F10106338%2Fhow-to-download-a-huge-
s_data%3D10106765%26s_csrf%3D1607311451872.954)
hildToView%3D10106765%23answer-
TABLES: tsp01, rststype.
* Internal table
DATA: it_tsp01 TYPE STANDARD TABLE OF tsp01 WITH HEADER LINE,
it_table TYPE STANDARD TABLE OF soli WITH HEADER LINE,
it_table1 TYPE STANDARD TABLE OF soli WITH HEADER LINE,
it_otf TYPE STANDARD TABLE OF itcoo WITH HEADER LINE,
/
it_doc LIKE TABLE OF docs,
it_pdf LIKE TABLE OF tline,
it_pdf1 LIKE TABLE OF tline WITH HEADER LINE.
* Work area
DATA: wa_tsp01 LIKE LINE OF it_tsp01,
wa_pdf LIKE LINE OF it_pdf1.
* Varialbles
DATA: v_string(11) TYPE c VALUE '%',
v_lines TYPE i,
v_size TYPE i,
v_client LIKE tst01-dclient,
v_name LIKE tst01-dname,
v_objtype LIKE rststype-type,
v_type TYPE rststype-type,
v_otf TYPE c.
* Constants
CONSTANTS: c_eof TYPE soli VALUE '//'.
**&---------------------------------------------------------------------*
INITIALIZATION.
*---Selection Screen
SELECT-OPTIONS: s_spool FOR tsp01-rqident. "Spool id
PARAMETERS: p_date LIKE sy-datum DEFAULT sy-datum, "Today's date
p_dept LIKE tsp01-rqdivision, "Department
p_ le TYPE string DEFAULT 'C:\temp\test1.pdf (http://test1.pdf)'.
*---Start of selection
START-OF-SELECTION.
CONCATENATE p_date v_string INTO v_string.
*---get the list of spool nummbers
SELECT *
INTO TABLE it_tsp01
FROM tsp01
WHERE rqident IN s_spool
AND rqdivision EQ p_dept
AND rqcretime LIKE v_string.
IF sy-subrc <> 0.
PERFORM bd_textbox_err(rstxpdft) USING 80
'Spool not exist'(003).
EXIT.
ENDIF.
IF NOT it_tsp01[] IS INITIAL.
LOOP AT it_tsp01 INTO wa_tsp01.
CLEAR: v_client, v_name, v_type, v_otf, v_objtype.
v_client = wa_tsp01-rqclient.
v_name = wa_tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = v_client
name = v_name
part = 1
IMPORTING
type = v_type
objtype = v_objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4.
IF v_objtype(3) = 'OTF'.
v_otf = 'X'.
ELSE.
v_otf = space.
ENDIF.
IF v_otf = 'X'.
*---convert the spool to an internal table
REFRESH it_table.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = wa_tsp01-rqident
rst_line = 1
last_line = 0
TABLES
bu er = it_table
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
/
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR v_lines.
DESCRIBE TABLE it_table LINES v_lines.
DELETE it_table INDEX v_lines.
* merge the spools to one big table
LOOP AT it_table.
APPEND it_table TO it_table1.
ENDLOOP.
AT LAST.
APPEND c_eof TO it_table1.
ENDAT.
ENDIF.
ENDLOOP.
LOOP AT it_table1.
CLEAR it_otf.
it_otf = it_table1.
APPEND it_otf.
ENDLOOP.
*---Convert OTF into PDF
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
use_otf_mc_cmd = 'X'
IMPORTING
bin_ lesize = v_size
TABLES
otf = it_otf
doctab_archive = it_doc
lines = it_pdf
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*---Dowload to le
IF sy-batch NE 'X'.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
lename = p_ le
letype = 'BIN'
CHANGING
data_tab = it_pdf.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

ELSE.
DATA: BEGIN OF it_mess_att OCCURS 0,
i_bu er TYPE string,
END OF it_mess_att.
DATA : gd_bu er TYPE string.
DATA: wa_mess_att LIKE gd_bu er.
CLEAR it_mess_att.
REFRESH it_mess_att[].

LOOP AT it_pdf INTO wa_pdf.


APPEND wa_pdf TO it_pdf1.
CLEAR wa_pdf.
ENDLOOP.
* Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf1.
TRANSLATE it_pdf1 USING ' ~'.
CONCATENATE gd_bu er it_pdf1 INTO gd_bu er.
ENDLOOP.
/
TRANSLATE gd_bu er USING '~ '.
DO.
wa_mess_att = gd_bu er.
APPEND it_mess_att.
SHIFT gd_bu er LEFT BY 255 PLACES.
IF gd_bu er IS INITIAL.
EXIT.
ENDIF.
ENDDO.
OPEN DATASET p_ le FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
EXIT.
ELSE.
* LOOP AT it_pdf1.
* TRANSFER it_pdf1 TO p_ le.
* ENDLOOP.
CLOSE DATASET p_ le.
ENDIF.
ENDIF.
ENDIF.
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dcomment%26s_data%3D10106765%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dreport%26s_data%3D10106765%26s_csrf%3D1607311451872.954) |
Share

Ramesh T ( https://people.sap.com/ramesh.t6)
(/users/12107/ramesht6.html)

Jul 01, 2013 at 09:07 AM

Hi Sunil,
Fquestions%2F10106338%2Fhow-to-download-a-huge-
childToView%3D10111582%23answer-
data%3D10111582%26s_csrf%3D1607311451872.954)
0
Please try in this programs
Fquestions%2F10106338%2Fhow-to-download-a-huge-
s_data%3D10111582%26s_csrf%3D1607311451872.954)
childToView%3D10111582%23answer-

RSTXPDFT2

RSTXPDFT3

RSTXPDFT4

RSTXPDFT5
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dcomment%26s_data%3D10111582%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dreport%26s_data%3D10111582%26s_csrf%3D1607311451872.954) |
Share

Venkat B ( https://people.sap.com/venky9.se)
(/users/113164/venky9se.html)
Jul 01, 2013 at 09:12 AM

Hi Sunil,
Fquestions%2F10106338%2Fhow-to-download-a-huge-
childToView%3D10111583%23answer-
data%3D10111583%26s_csrf%3D1607311451872.954)
0
Open the spool which you want to download and execute a Tcode PDF! in the same window and will show you form in print preview mode there you can nd save
Fquestions%2F10106338%2Fhow-to-download-a-huge-
s_data%3D10111583%26s_csrf%3D1607311451872.954)
childToView%3D10111583%23answer-
button. By click on that you can save in your desk top.

Regards,

Venakt.
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dcomment%26s_data%3D10111583%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dreport%26s_data%3D10111583%26s_csrf%3D1607311451872.954) |
Share

3 Comments

Ramesh T ( https://people.sap.com/ramesh.t6)  Former Member

Jul 02, 2013 at 03:56 AM (/comments/10113525/view.html) /


Hi Sunil,

PDF! tcode is there see this link you can understand how to use it.

http://www.saptechnical.com/Tutorials/Smartforms/PDF/Simple.htm (http://www.saptechnical.com/Tutorials/Smartforms/PDF/Simple.htm)

Regards,

Ramesh.T

Like (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-pdf.html%3FchildToView%3D10113525%23comment-
10113525%26s_action%3Dlike_comment%26s_data%3D10113525%26s_csrf%3D1607311451872.954) 0 |
Share
|
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3DreportComment%26s_data%3D10113525%26s_csrf%3D1607311451872.954)

Show all

Comment on This Answer (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-


pdf.html%3Fs_action%3Dcomment%26s_data%3D10111583%26s_csrf%3D1607311451872.954)

Former Member

Jul 01, 2013 at 10:18 AM

hi,
Fquestions%2F10106338%2Fhow-to-download-a-huge-
childToView%3D10111836%23answer-
data%3D10111836%26s_csrf%3D1607311451872.954)
0
install cute pdf which is third pary software. now print your spool and when asking for network print give name cute pdf which is in your printer list.
Fquestions%2F10106338%2Fhow-to-download-a-huge-
s_data%3D10111836%26s_csrf%3D1607311451872.954)
childToView%3D10111836%23answer-

regards,

Rakesh

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-


pdf.html%3Fs_action%3Dcomment%26s_data%3D10111836%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dreport%26s_data%3D10111836%26s_csrf%3D1607311451872.954) |
Share

Former Member

Jul 02, 2013 at 05:05 AM

Hi,
Fquestions%2F10106338%2Fhow-to-download-a-huge-
childToView%3D10113681%23answer-
data%3D10113681%26s_csrf%3D1607311451872.954)
0
Issue Resolved or not ?
Fquestions%2F10106338%2Fhow-to-download-a-huge-
s_data%3D10113681%26s_csrf%3D1607311451872.954)
childToView%3D10113681%23answer-

regards,

Rakesh Pampaniya
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dcomment%26s_data%3D10113681%26s_csrf%3D1607311451872.954) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-spool-into-
pdf.html%3Fs_action%3Dreport%26s_data%3D10113681%26s_csrf%3D1607311451872.954) |
Share

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please
leave a comment instead, requesting additional details. When answering, please include speci cs, such as step-by-step instructions, context for the solution, and links to
useful resources. Also, please make sure that you answer complies with our Rules of Engagement.

Rules of Engagement (https://www.sap.com/community/resources/rules-of-engagement.html)

Know someone who can answer? Share a link to this question.

/
You must be Logged in (/users/login.html?redirect to=%2Fquestions%2F10106338%2Fhow-to-download-a-huge-
You must be Logged in (/users/login.html?redirect_to %2Fquestions%2F10106338%2Fhow to download a huge
spool-into-pdf.html%3Fs_action%3DanswerQuestion%26s_csrf%3D1607311451872.954) to submit an answer.

Please provide a distinct answer and use the comment option for clarifying purposes.

Submit your Answer

Find us on

(https://www.facebook.com/sapcommunity) (https://twitter.com/SAPCommunity) (https://www.youtube.com/c/SAPCommunities)

(https://www.linkedin.com/company/sap) (https://instagram.com/sap/) (http://www.slideshare.net/SAP) (mailto:?subject='SAP Community')

Privacy (http://sap.com/about/legal/privacy.html) Terms of Use (http://sap.com/corporate/en/legal/terms-of-use.html)

Legal Disclosure (http://sap.com/about/legal/impressum.html) Copyright (http://sap.com/about/legal/copyright.html)

Trademark (http://sap.com/about/legal/trademark.html) Cookie Preferences

Newsletter (https://www.sap.com/cmp/nl/sap-community-voice/index.html) Support (mailto:[email protected])

You might also like