Академический Документы
Профессиональный Документы
Культура Документы
(http://www.sap.com/)
(https://community.sap.com)
(/users/login.html?
redirect_to=%2Fquestions%2F2760855%2Fneed-to-
download-po-sapscript-in-pdf-format-withou.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
Hi all,
Iam working on a PO SAPSCRIPT, My requirement is to download the PO in PDF format without printing.
I know one SAP program called RSTXPDFT4.In (http://RSTXPDFT4.In) this program i need to specify the Spool number.
Hence without giving Print option how can i get the spool no:, or do we have any other way to get the Spool no: when PO gets saved.
So in Message control which output medium i should give. Do i need to create Z program and then should i need to insert in my output type and declare the Output medium as
Special Function.
Thanks in Advance...
Assigned Tags
Related questions
3 Answers
Rough idea how to download into PDF format, follow the below steps and paa your own parameters
2Fquestions%2F2760855%2Fneed-to-download-po-
data%3D2761805%26s_csrf%3D1607321571986.9707)
tml%3FchildToView%3D2761805%23answer-
2
**Set printer parameters
2Fquestions%2F2760855%2Fneed-to-download-po-
_data%3D2761805%26s_csrf%3D1607321571986.9707)
tml%3FchildToView%3D2761805%23answer-
control_param-no_dialog = 'X'.
control_param-preview = ''.
control_param-getotf = 'X'. /
output_opt-tddest = 'LOCL'.
output_opt-tdimmed = ''.
output_opt-tdnewid = ''.
output_opt-tdnoprint = ''.
output_opt-tdnoprev = 'X'.
EXPORTING
formname = formname
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
endif.
Call smartform
EXPORTING
control_parameters = control_param
output_options = output_opt
wa_head = wa_head
IMPORTING
job_output_info = job_info
TABLES
int_detail = int_detail
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
Note pass the job info le you got from above function module
IMPORTING
TABLES
otf = job_info-otfdata
doctab_archive = int_docs
lines = int_line
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
others = 3.
exporting
lename = lename
letype = 'BIN'
changing
data_tab = int_line
Regards,
SaiRam
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F2760855%2Fneed-to-download-po-sapscript-in-pdf-format-
withou.html%3Fs_action%3Dcomment%26s_data%3D2761805%26s_csrf%3D1607321571986.9707) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F2760855%2Fneed-to-download-po-sapscript-in-pdf-format-
withou.html%3Fs_action%3Dreport%26s_data%3D2761805%26s_csrf%3D1607321571986.9707) |
Share
Former Member
Hi
2Fquestions%2F2760855%2Fneed-to-download-po-
data%3D2762327%26s_csrf%3D1607321571986.9707)
tml%3FchildToView%3D2762327%23answer-
0
See the sample code to download the Script in PDF format
2Fquestions%2F2760855%2Fneed-to-download-po-
_data%3D2762327%26s_csrf%3D1607321571986.9707)
tml%3FchildToView%3D2762327%23answer-
REPORT zzz_jaytest .
Types Declaration
END OF ty_pa0001.
"parameters
"interface
Variable Declaration
v_size TYPE i.
Constants Declaration
"File Name
START-OF-SELECTION.
EXPORTING
form = c_form
device = c_printer
language = sy-langu
OPTIONS = w_options /
IMPORTING
RESULT = w_res.
EXPORTING
element = 'MAIN'
window = 'MAIN'.
ENDLOOP.
IMPORTING
RESULT = w_res
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
ENDIF.
INTO w_pdf.
ENDLOOP.
EXPORTING
format_src = c_otf
format_dst = c_pdf
devtype = c_printer
CHANGING
transfer_bin = w_transfer_bin
/
content_txt = i_content_txt
content_bin = i_content_bin
objhead = i_objhead
len = v_len_in
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
v_size = v_len_in.
EXPORTING
lename = c_name
letype = c_bin
TABLES
data_tab = i_content_bin.
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
or u can use the standard program RSTXPDFT4 to download the script into PDF format onto a particular location
http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html (http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html)
Regards
Anji
Former Member
Hi,
2Fquestions%2F2760855%2Fneed-to-download-po-
data%3D2762342%26s_csrf%3D1607321571986.9707)
tml%3FchildToView%3D2762342%23answer-
0
Here is the sample code of converting smartform output to pdf.
2Fquestions%2F2760855%2Fneed-to-download-po-
_data%3D2762342%26s_csrf%3D1607321571986.9707)
tml%3FchildToView%3D2762342%23answer-
REPORT zswar.
INITIALIZATION.
AT SELECTION-SCREEN.
ws_ucomm = sy-ucomm.
CASE ws_ucomm.
WHEN '&PDF'.
PERFORM f1000_download_form.
EXIT.
WHEN '&BACK'.
SET SCREEN 0.
EXIT.
WHEN '&EXIT'.
SET SCREEN 0.
EXIT.
WHEN '&canc'.
SET SCREEN 0.
LEAVE TO SCREEN 0.
ENDCASE.
&----
&----
text
----
--> p1 text
<-- p2 text
/
----
FORM f1000_download_form.
EXPORTING
formname = 'ZSMARTFORM_SWAR'
IMPORTING
fm_name = form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
IF sy-subrc <> 0.
ENDIF.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = wa_ctrlop
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = wa_outopt
user_settings = 'X'
mydate = p_date
reason = p_rea
/
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = t_otfdata
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
ENDIF.
t_otf[] = t_otfdata-otfdata[].
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4
IF sy-subrc <> 0.
ENDIF.
EXPORTING
/
letype = 'BIN'
IMPORTING
lelength = w_ lesize
TABLES
data_tab = t_pdf_tab
FIELDNAMES =
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.
ELSE.
'under D drive'.
ENDIF.
Regards
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F2760855%2Fneed-to-download-po-sapscript-in-pdf-format-
withou.html%3Fs_action%3Dcomment%26s_data%3D2762342%26s_csrf%3D1607321571986.9707) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F2760855%2Fneed-to-download-po-sapscript-in-pdf-format-
withou.html%3Fs_action%3Dreport%26s_data%3D2762342%26s_csrf%3D1607321571986.9707) |
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)
Please provide a distinct answer and use the comment option for clarifying purposes.
Find us on