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

How To Download From Spool To Application Server - 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)
365 views7 pages

How To Download From Spool To Application Server - 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%2F1264395%2Fhow-to-
download-from-spool-to-application-server.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 from spool to application server
Mar 20, 2006 at 06:34 AM | 621 Views
estions%2F1264395%2Fhow-to-download-from-spool-
ata%3D1264395%26s_csrf%3D1607332317320.9941)
application-
0
estions%2F1264395%2Fhow-to-download-from-spool-
data%3D1264395%26s_csrf%3D1607332317320.9941)
application-
(/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
Follow
server.html%3Fs_action%3Dfollow%26s_csrf%3D1607332317320.9941) RSS Feed

Hi all,

Can any one tell me how to download from spool to application server. Quick response would be appreciated.

thanks

mahesh

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-


server.html%3Fs_action%3Dcomment%26s_data%3D1264395%26s_csrf%3D1607332317320.9941) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3DreportQuestion%26s_data%3D1264395%26s_csrf%3D1607332317320.9941)

Assigned Tags

ABAP Development (/tags/833755570260738661924709785639136) |

Related questions

How to send spool output to application server ? (https://answers.sap.com/questions/9582287/how-to-send-spool-output-to-application-server-.html)


By Azeem Quadri Mohammed Abdul ( https://people.sap.com/azeemquadri.mohammedabdul) Oct 05, 2012

Form output in PDF format in a speci c server (https://answers.sap.com/questions/2978718/form-output-in-pdf-format-in-a-speci c-server.html)


By Former Member ( https://people.sap.com/former.member) Sep 19, 2007

4 Answers

Sort by: Votes | Newest | Oldest

Former Member

Mar 20, 2006 at 06:46 AM

Hi Kilaru,
uestions%2F1264395%2Fhow-to-download-from-spool-
%3FchildToView%3D1264432%23answer-
data%3D1264432%26s_csrf%3D1607332317320.9941)
0
Please nd the sample code for your req,t and let me know if you found any di culty on the same.
uestions%2F1264395%2Fhow-to-download-from-spool-
%3FchildToView%3D1264432%23answer-
_data%3D1264432%26s_csrf%3D1607332317320.9941)

<b>Just copy paste the code :</b>

This will Convert spool to PDF format and download.

data: w_ident like tsp01-rqident,

w_doctype like tsp01-rqdoctype,

w_bytecount type i.

data: itab_pdf like tline occurs 0 with header line. /


parameter spoolnum like tsp01-rqident obligatory.

selection-screen begin of block a2 with frame.

parameters: to_pc radiobutton group a2 default 'X',

pc le like rlgrap- lename lower case,

to_unix radiobutton group a2,

unix le(255) lower case.

selection-screen end of block a2.

********************************

at selection-screen on block a2.

********************************

if to_pc = 'X' and pc le is initial.

message e398(00) with 'Enter PC File Name.'.

elseif to_unix = 'X' and unix le is initial.

message e398(00) with 'Enter Unix File Name.'.

endif.

*******************************

at selection-screen on spoolnum.

*******************************

select single rqident rqdoctype

into (w_ident, w_doctype)

from tsp01

where rqident = spoolnum.

if sy-subrc ne 0.

message e398(00) with 'Spool' spoolnum 'not found'.

endif.

************************************************

at selection-screen on value-request for pc le.

************************************************

call function 'WS_FILENAME_GET'

exporting

mask = ',.,..'

importing

lename = pc le

exceptions

others = 1.

if sy-subrc <> 0.

message id sy-msgid type 'I' number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

*******************
/
start-of-selection.

*******************

if w_doctype = 'LIST'.

perform get_abap_spool_in_pdf.

elseif w_doctype = 'OTF'.

perform get_otf_spool_in_pdf.

endif.

if to_pc = 'X'.

perform write_pdf_spool_to_pc.

else.

perform write_pdf_spool_to_unix.

endif.

message i398(00) with 'Completed OK'.

*********************************************************

form get_abap_spool_in_pdf.

refresh itab_pdf.

call function 'CONVERT_ABAPSPOOLJOB_2_PDF'

exporting

src_spoolid = w_ident

importing

pdf_bytecount = w_bytecount

tables

pdf = itab_pdf

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.

if sy-subrc ne 0.

message e398(00) with 'Cannot convert to PDF. Error =' sy-subrc.

endif.

endform.
/
*********************************************************form get_otf_spool_in_pdf.

refresh itab_pdf.

call function 'CONVERT_OTFSPOOLJOB_2_PDF'

exporting

src_spoolid = w_ident

importing

pdf_bytecount = w_bytecount

tables

pdf = itab_pdf

exceptions

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 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.

if sy-subrc <> 0.

message e398(00) with 'Cannot convert to PDF. Error =' sy-subrc.

endif.

endform.

*********************************************************form write_pdf_spool_to_unix.

open dataset unix le for output in binary mode.

if sy-subrc ne 0 .

message e398(00) with 'Cannot open unix le for output:' unix le.

endif.

loop at itab_pdf.

transfer itab_pdf to unix le.

if sy-subrc ne 0 .

message e398(00) with 'Cannot write to unix le:' unix le.

endif.

endloop.

close dataset unix le.

endform.

*********************************************************form write_pdf_spool_to_pc.
/
call function 'WS_DOWNLOAD'

exporting

bin_ lesize = w_bytecount

lename = pc le

letype = 'BIN'

tables

data_tab = itab_pdf

exceptions

le_open_error = 1

le_write_error = 2

invalid_ lesize = 3

invalid_type = 4

no_batch = 5

unknown_error = 6

invalid_table_width = 7

gui_refuse_ letransfer = 8

customer_error = 9

others = 10.

if sy-subrc <> 0.

message e398(00) with 'Cannot download to PC. Error =' sy-subrc.

endif.

endform.

Hope this will help you.

Cheers

Sunny

Rewrd points, if found helpful


Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3Dcomment%26s_data%3D1264432%26s_csrf%3D1607332317320.9941) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3Dreport%26s_data%3D1264432%26s_csrf%3D1607332317320.9941) |
Share

Prashant Patil ( https://people.sap.com/prashant.patil14)


(/users/23421/prashantpatil14.html)
Mar 20, 2006 at 07:29 AM

Hi,
uestions%2F1264395%2Fhow-to-download-from-spool-
%3FchildToView%3D1264503%23answer-
data%3D1264503%26s_csrf%3D1607332317320.9941)
0
If you do not want the Spool to be converted into PDF, then use the following alternative :
uestions%2F1264395%2Fhow-to-download-from-spool-
%3FchildToView%3D1264503%23answer-
_data%3D1264503%26s_csrf%3D1607332317320.9941)

1. Use FM RSPO_RETURN_ABAP_SPOOLJOB to get all the details of the spool into an internal table. The only input is Spool Number. Use FM BP_JOB_READ to get the Spool
Number .

2. Now Use OPEN Dataset & write the data from internal table to this le.

Best regards,

Prashant

Message was edited by: Prashant Patil


/
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3Dcomment%26s_data%3D1264503%26s_csrf%3D1607332317320.9941) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3Dreport%26s_data%3D1264503%26s_csrf%3D1607332317320.9941) |
Share

Former Member

Mar 20, 2006 at 07:37 AM

Hi,
2Fquestions%2F1264395%2Fhow-to-download-from-
ml%3FchildToView%3D1264527%23answer-
data%3D1264527%26s_csrf%3D1607332317320.9941)
0
Try this FM RSPO_DOWNLOAD_SPOOLJOB.. pass the spool number and then use open dataset stmts for uploading to appln. server.
2Fquestions%2F1264395%2Fhow-to-download-from-
ml%3FchildToView%3D1264527%23answer-
_data%3D1264527%26s_csrf%3D1607332317320.9941)

hope this helps,

priya
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3Dcomment%26s_data%3D1264527%26s_csrf%3D1607332317320.9941) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3Dreport%26s_data%3D1264527%26s_csrf%3D1607332317320.9941) |
Share

Former Member

Mar 20, 2006 at 11:21 AM

Hi Kilaru,
uestions%2F1264395%2Fhow-to-download-from-spool-
%3FchildToView%3D1265029%23answer-
data%3D1265029%26s_csrf%3D1607332317320.9941)
0
As per form etiquette's
uestions%2F1264395%2Fhow-to-download-from-spool-
%3FchildToView%3D1265029%23answer-
_data%3D1265029%26s_csrf%3D1607332317320.9941)

If satis ed , please close the thread by rewarding appropriate points to the helpful answers.

Cheers

Sunny

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-


server.html%3Fs_action%3Dcomment%26s_data%3D1265029%26s_csrf%3D1607332317320.9941) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F1264395%2Fhow-to-download-from-spool-to-application-
server.html%3Fs_action%3Dreport%26s_data%3D1265029%26s_csrf%3D1607332317320.9941) |
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%2F1264395%2Fhow-to-download-from-spool-


to-application-server.html%3Fs_action%3DanswerQuestion%26s_csrf%3D1607332317320.9941) 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:sapnetwork@sap.com)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy