0% found this document useful (0 votes)
285 views6 pages

How To Download PDF Output Forms To Presentation Server Without Display - 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)
285 views6 pages

How To Download PDF Output Forms To Presentation Server Without Display - 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/ 6

Community

(http://www.sap.com/)
(https://community.sap.com)
(/users/login.html?
redirect_to=%2Fquestions%2F11278895%2Fhow-to-
download-pdf-output-forms-to-presentation-s.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 PDF output forms to presentation server without display
Oct 16, 2014 at 09:04 AM | 630 Views
Fquestions%2F11278895%2Fhow-to-download-pdf-
ms-to-presentation-
%3D11278895%26s_csrf%3D1607321565247.0588)
0
Fquestions%2F11278895%2Fhow-to-download-pdf-
ms-to-presentation-
a%3D11278895%26s_csrf%3D1607321565247.0588)
(/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
Follow
s.html%3Fs_action%3Dfollow%26s_csrf%3D1607321565247.0588) RSS Feed

Hi All,

My requirement is to download the Sales Order forms and save it in local system.

I have created a custom program where I am passing a range of Sales Order no, Partner Function, Output type and Application as my input in selection screen.

Logic:

I am calling my Sales Order Abodeform using the FM: 'FP_FUNCTION_MODULE_NAME' and thereby I got the function module name of my form.

Then I am calling the FM:

Input to the FM:

ls_outputparams-nodialog = abap_true.

ls_outputparams-authority = 'X'.

ls_outputparams-getpdf = 'X'.

ls_outputparams-dest = 'LP03'.

ls_outputparams-nopreview = abap_true.

ls_outputparams-reqimm = abap_true.

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

ie_outputparams = ls_outputparams

EXCEPTIONS

cancel = 1

usage_error = 2

system_error = 3

internal_error = 4

OTHERS = 5.

followed by, CALL FUNCTION (FM name)

EXPORTING

archive_index = toa_dara

archive_parameters = arc_params

control_parameters = ls_control_param

mail_recipient = ls_recipient

mail_sender = ls_sender
/
_ _

output_options = ls_output_param

user_settings = ' '

is_nast = nast

is_vbdka = vbdka

is_addres = addr_key

IMPORTING

document_output_info = document_output_info

job_output_info = job_output_info

job_output_options = job_output_options

TABLES

it_vbdpa = tvbdpa "Item information

it_vbdpau = tvbdpau "Subitem numbers

it_vedpa = tkomservp "Contract Item Validity

it_vedka = tkomservh "Contract Header Validity

it_vedpn = tkomservpn "Contract Item Cancellation Data

it_vedkn = tkomservhn "Contract Header Cancellation DA

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

then , CALL FUNCTION 'FP_JOB_CLOSE'

IMPORTING

e_result = ls_result

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

then i am using the below FM to get the OTF data if any available.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

IMPORTING

bin_ lesize = lv_bin lesize

bin_ le = lv_bin_ le

TABLES

otf = ls_output_info-otfdata-> i am not sure which data to pass here. i am getting sy-subrc value as 4.

lines = lt_lines
/
_

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5.

Now I dont no how to link the PDF forms to below method.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

bin_ lesize = v_size

lename = D://x.pdf (http://x.pdf)

letype = 'BIN'

CHANGING

data_tab = lt_pdf.

Because in smartforms, we will convert the OTF output to PDF and that value is passed to GUI_DOWNLOAD FM as input (lt_pdf) , whereas in adobeforms the output itself is in PDF
so i dont how to retreive the values from adobeforms and pass it to the above FM, so that I can save 'N' no. of sales order outputs in one PDF le.

Kindly help me out in this.

Thanks & Regards,

Karthikeyan G.

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-


s.html%3Fs_action%3Dcomment%26s_data%3D11278895%26s_csrf%3D1607321565247.0588) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3DreportQuestion%26s_data%3D11278895%26s_csrf%3D1607321565247.0588)

Assigned Tags

ABAP Development (/tags/833755570260738661924709785639136) |

Related questions

XSTRING to PDF with out GUI_Download (https://answers.sap.com/questions/763061/xstring-to-pdf-with-out-guidownload.html)


By Arun Panigrahy ( https://people.sap.com/arun_panigrahy) Feb 26, 2019

Downloading Adobe PDF based form into Presentation server from Spool (https://answers.sap.com/questions/11589864/downloading-adobe-pdf-based-form-into-presentation.html)
By Former Member ( https://people.sap.com/former.member) Mar 13, 2015

3 Answers

Sort by: Votes | Newest | Oldest

Former Member

Oct 16, 2014 at 09:36 AM

The parameters you are passing to function module (FM Name) does not look right. Are you sure you have an Adobe Form? (The correct paramaters can be found in
uestions%2F11278895%2Fhow-to-download-pdf-output-
data%3D11278951%26s_csrf%3D1607321565247.0588)
%3FchildToView%3D11278951%23answer-
0 the Form Interface, transaction SFP).
uestions%2F11278895%2Fhow-to-download-pdf-output-
_data%3D11278951%26s_csrf%3D1607321565247.0588)
%3FchildToView%3D11278951%23answer-
The exporting parameter of the function module is /1bcdwb/formoutput. It contains a rawstring named PDF. You can convert the rawstring to binary by calling function
module SCMS_XSTRING_TO_BINARY. Once you have it in binary you can call function module gui_download as usual, and it will be saved as a PDF le on yor local system.

Hope that helps.


/
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3Dcomment%26s_data%3D11278951%26s_csrf%3D1607321565247.0588) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3Dreport%26s_data%3D11278951%26s_csrf%3D1607321565247.0588) |
Share

2 Comments

Former Member  Former Member


Oct 18, 2014 at 07:41 PM (/comments/11284068/view.html)
Hi Eric,

I tried using the FM to convert Xstring to binary, Now I can able to save the documents, but I can able to save the last Sales Order no if I am giving a range of Sales Order Nos as input.

Data: gt_pdf_ le TYPE STANDARD TABLE OF solix_tab.

In Debug mode, I can see all the inputs Xstring data is converted into Binary format. I passed the table directly in GUI FM where I stored the converted values, I got a dump. So I looped the table and I
passed using a workarea, but only the last sales order output is getting saved. kindly share your ideas.

Thanks & Regards,

Karthikeyan G.
 pdf1.PNG (/storage/attachments/1219001-pdf1.PNG) (10.2 kB)

 pdf2.PNG (/storage/attachments/1219002-pdf2.PNG) (6.6 kB)

Like (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-s.html%3FchildToView%3D11284068%23comment-
11284068%26s_action%3Dlike_comment%26s_data%3D11284068%26s_csrf%3D1607321565247.0588) 0 |
Share
|
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3DreportComment%26s_data%3D11284068%26s_csrf%3D1607321565247.0588)

Show all

Comment on This Answer (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-


s.html%3Fs_action%3Dcomment%26s_data%3D11278951%26s_csrf%3D1607321565247.0588)

vishnu venugopal ( https://people.sap.com/vishnu.venugopal)


(/users/255182/vishnuvenugopal.html)
Oct 20, 2014 at 07:45 PM

Hi karthik,
uestions%2F11278895%2Fhow-to-download-pdf-output-
data%3D11287214%26s_csrf%3D1607321565247.0588)
%3FchildToView%3D11287214%23answer-
0
can you try FUNCTION 'CONVERT_OTF with table parameter otf with the type itcoo with a work area,
uestions%2F11278895%2Fhow-to-download-pdf-output-
_data%3D11287214%26s_csrf%3D1607321565247.0588)
%3FchildToView%3D11287214%23answer-
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3Dcomment%26s_data%3D11287214%26s_csrf%3D1607321565247.0588) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3Dreport%26s_data%3D11287214%26s_csrf%3D1607321565247.0588) |
Share

3 Comments

Gerald Lyle ( https://people.sap.com/gerald.lyle)  Former Member


/
Oct 21, 2014 at 03:09 PM (/comments/11289809/view.html)
Remove the LOOP AT gt_pdf_ le.

Pass the gt_pdf_ le to GUI_DOWNLOAD and you should be golden 😊

Like (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-s.html%3FchildToView%3D11289809%23comment-
11289809%26s_action%3Dlike_comment%26s_data%3D11289809%26s_csrf%3D1607321565247.0588) 0 |
Share
|

Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-


s.html%3Fs_action%3DreportComment%26s_data%3D11289809%26s_csrf%3D1607321565247.0588)

Show all

Comment on This Answer (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-


s.html%3Fs_action%3Dcomment%26s_data%3D11287214%26s_csrf%3D1607321565247.0588)

vishnu venugopal ( https://people.sap.com/vishnu.venugopal)


(/users/255182/vishnuvenugopal.html)

Oct 21, 2014 at 03:53 PM

hi karthikeyan,
uestions%2F11278895%2Fhow-to-download-pdf-output-
data%3D11289799%26s_csrf%3D1607321565247.0588)
%3FchildToView%3D11289799%23answer-
0
since you want to download it into your local system make use of the FM in order as below
uestions%2F11278895%2Fhow-to-download-pdf-output-
_data%3D11289799%26s_csrf%3D1607321565247.0588)
%3FchildToView%3D11289799%23answer-

1. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME',get the fm name in exporting parameter formname


2. call the forname
3. CALL FUNCTION 'GUI_DOWNLOAD'.
4. CALL FUNCTION 'CONVERT_OTF'
5. CALL METHOD cl_gui_frontend_services=> le_save_dialog.
6. CALL FUNCTION 'GUI_DOWNLOAD'.

hope it helps.....
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3Dcomment%26s_data%3D11289799%26s_csrf%3D1607321565247.0588) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3Dreport%26s_data%3D11289799%26s_csrf%3D1607321565247.0588) |
Share

3 Comments

Former Member  vishnu venugopal


Oct 29, 2014 at 10:09 AM (/comments/11305486/view.html)

Hi Vishnu,

I dont what should be the input provided for the function module CALL FUNCTION 'CONVERT_OTF', because by calling FM 'Formname' I am having the PDF string stored in /1bcdwb/formoutput -pdf,
then using function module, SCMS_XSTRING_TO_BINARY I am converting the Xstring into binary format. Can you guide me on this?

Thanks & Regards,

Karthikeyan G.

Like (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-s.html%3FchildToView%3D11305486%23comment-
11305486%26s_action%3Dlike_comment%26s_data%3D11305486%26s_csrf%3D1607321565247.0588) 0 |
Share
|
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-
s.html%3Fs_action%3DreportComment%26s_data%3D11305486%26s_csrf%3D1607321565247.0588)

Show all

Comment on This Answer (/users/login.html?redirect_to=%2Fquestions%2F11278895%2Fhow-to-download-pdf-output-forms-to-presentation-


s.html%3Fs_action%3Dcomment%26s_data%3D11289799%26s_csrf%3D1607321565247.0588)

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%2F11278895%2Fhow-to-download-pdf-output-


forms-to-presentation-s.html%3Fs_action%3DanswerQuestion%26s_csrf%3D1607321565247.0588) 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