How To Download From Spool To Application Server - SAP Q&A
How To Download From Spool To Application Server - SAP Q&A
(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
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
Assigned Tags
Related questions
4 Answers
Former Member
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)
w_bytecount type i.
********************************
********************************
endif.
*******************************
at selection-screen on spoolnum.
*******************************
from tsp01
if sy-subrc ne 0.
endif.
************************************************
************************************************
exporting
mask = ',.,..'
importing
lename = pc le
exceptions
others = 1.
if sy-subrc <> 0.
endif.
*******************
/
start-of-selection.
*******************
if w_doctype = 'LIST'.
perform get_abap_spool_in_pdf.
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.
*********************************************************
form get_abap_spool_in_pdf.
refresh itab_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.
endif.
endform.
/
*********************************************************form get_otf_spool_in_pdf.
refresh itab_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.
endif.
endform.
*********************************************************form write_pdf_spool_to_unix.
if sy-subrc ne 0 .
message e398(00) with 'Cannot open unix le for output:' unix le.
endif.
loop at itab_pdf.
if sy-subrc ne 0 .
endif.
endloop.
endform.
*********************************************************form write_pdf_spool_to_pc.
/
call function 'WS_DOWNLOAD'
exporting
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.
endif.
endform.
Cheers
Sunny
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
Former Member
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)
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
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
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.
Please provide a distinct answer and use the comment option for clarifying purposes.
/
Submit your Answer
Find us on