Вы находитесь на странице: 1из 6

Community

(http://www.sap.com/)
(https://community.sap.com)
(/users/login.html?
redirect_to=%2Fquestions%2F11928298%2Fdownload-
pdf-file-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
Download PDF le to application server
Aug 31, 2015 at 12:47 PM | 2.1k Views
Fquestions%2F11928298%2Fdownload-pdf- le-to-
ata%3D11928298%26s_csrf%3D1607326637876.167)
pplication-
1
Fquestions%2F11928298%2Fdownload-pdf- le-to-
data%3D11928298%26s_csrf%3D1607326637876.167)
pplication-
(/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-server.html%3Fs_action%3Dfollow%26s_csrf%3D1607326637876.167)
Follow RSS Feed

Hi experts,

I have an adobe form created in tcode SFP. I can download the le to local desktop successfully.

But application server download is not working at all.

I have tried the below code.

l_pdf_size = xstrlen( ls_formoutput-pdf ).

lit_pdfcontent = cl_document_bcs=>xstring_to_solix(

ip_xstring = ls_formoutput-pdf ).

OPEN DATASET l_ le FOR OUTPUT IN BINARY MODE.

IF sy-subrc = 0.

LOOP AT lit_pdfcontent INTO lwa_pdfcontent.

TRANSFER lwa_pdfcontent-line TO l_ le.

ENDLOOP.

ENDIF.

CLOSE DATASET l_ le

Can anybody please help me to solve this issue?

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-


server.html%3Fs_action%3Dcomment%26s_data%3D11928298%26s_csrf%3D1607326637876.167) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-
server.html%3Fs_action%3DreportQuestion%26s_data%3D11928298%26s_csrf%3D1607326637876.167)

Assigned Tags

SAP Interactive Forms by Adobe (/tags/582573882271271216439685697820265) |

Related questions

generating a pdf form through webdynpro application (https://answers.sap.com/questions/1731177/generating-a-pdf-form-through-webdynpro-applicatio.html)


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

problem with pdf display downloaded from application server (https://answers.sap.com/questions/7748917/problem-with-pdf-display-downloaded-from-applicati.html)


By Sasi Kiran Upadrasta ( https://people.sap.com/sasikiran.upadrasta2) Sep 29, 2010

/
2 Answers

Sort by: Votes | Newest | Oldest

Suneel uggina ( https://people.sap.com/suneel.uggina)


(/users/3471/suneeluggina.html)
Sep 01, 2015 at 08:44 AM

Hi Lakshmi,
%2Fquestions%2F11928298%2Fdownload-pdf- le-to-
data%3D11930143%26s_csrf%3D1607326637876.167)
FchildToView%3D11930143%23answer-
1
Please follow the below steps..
%2Fquestions%2F11928298%2Fdownload-pdf- le-to-
FchildToView%3D11930143%23answer-
_data%3D11930143%26s_csrf%3D1607326637876.167)

Call the Form crated in SFP through driver Program..

Using OPEN DATASET TRANSFER CLOSE DATASET upload the form to application server.

Download the Form from Application server to presentation server using OPEN DATASET READ CLOSE DATASET.

Please check the below code for your reference.it (http://reference.it) is working ne..,

PARAMETERS: p_matnr TYPE mara-matnr.

DATA: fm_name TYPE char30,

fp_docparams TYPE sfpdocparams,

fp_outparams TYPE sfpoutputparams,

ls_formoutput TYPE fpformoutput,

ip_xstring TYPE xstring,

lit_pdfcontent TYPE TABLE OF solix,

lwa_pdfcontent TYPE solix,

l_ le(100) VALUE '/SAP-LOAD/data/DE1/SCB/test_form',

length like sy-tabix,

lengthn like sy-tabix.

* Sets the Output parameters and opens the Spool Job

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

ie_outputparams = fp_outparams

EXCEPTIONS

cancel = 1

usage_error = 2

system_error = 3

internal_error = 4

OTHERS = 5.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

*Get the name of the generated function module

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

i_name = 'ZAF_TEST'
/
IMPORTING

e_funcname = fm_name.

** Initiliase the language and Country values

fp_docparams-langu = 'E'.

fp_docparams-country = 'US'.

* Call generated Function Module

CALL FUNCTION fm_name

EXPORTING

/1bcdwb/docparams = fp_docparams

i_matnr = p_matnr

IMPORTING

/1bcdwb/formoutput = ls_formoutput

EXCEPTIONS

usage_error = 1

system_error = 2

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

* Output data in PDF

IF ls_formoutput-pdf IS NOT INITIAL.

lit_pdfcontent = cl_document_bcs=>xstring_to_solix(

ip_xstring = ls_formoutput-pdf ).

OPEN DATASET l_ le FOR OUTPUT IN BINARY MODE .

IF sy-subrc = 0.

LOOP AT lit_pdfcontent INTO lwa_pdfcontent.

TRANSFER lwa_pdfcontent-line TO l_ le.

ENDLOOP.

ENDIF.

CLOSE DATASET l_ le.

ENDIF.

CLEAR lit_pdfcontent.

REFRESH lit_pdfcontent.

*To crosscheck if it went well download the le.

OPEN DATASET l_ le FOR INPUT IN BINARY MODE.

DO.

READ DATASET l_ le INTO lwa_pdfcontent-line.

IF sy-subrc = 0.

APPEND lwa_pdfcontent to lit_pdfcontent.


/
ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET l_ le.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

lename = 'C:\Users\suneelu\Desktop\Standrd_PO\test.pdf (http://test.pdf)'

letype = 'BIN'

*bin_ lesize = length

IMPORTING

lelength = lengthn

TABLES

data_tab = lit_pdfcontent.

* Close the Spool Job.

CALL FUNCTION 'FP_JOB_CLOSE'

* IMPORTING

* E_RESULT =

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Regards,

Suneel.uggina

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-


server.html%3Fs_action%3Dcomment%26s_data%3D11930143%26s_csrf%3D1607326637876.167) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-
server.html%3Fs_action%3Dreport%26s_data%3D11930143%26s_csrf%3D1607326637876.167) |
Share

Suneel uggina ( https://people.sap.com/suneel.uggina)


(/users/3471/suneeluggina.html)
Aug 31, 2015 at 01:02 PM

Hi Lekshmi,
%2Fquestions%2F11928298%2Fdownload-pdf- le-to-
data%3D11928398%26s_csrf%3D1607326637876.167)
FchildToView%3D11928398%23answer-
0
Please refer the below link.. It may help
%2Fquestions%2F11928298%2Fdownload-pdf- you to reslove the issue..
le-to-
FchildToView%3D11928398%23answer-
_data%3D11928398%26s_csrf%3D1607326637876.167)

Download PDF File to SAP Application Server | SCN (https://scn.sap.com/thread/70445)

Regards,

Suneel. /
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-
server.html%3Fs_action%3Dcomment%26s_data%3D11928398%26s_csrf%3D1607326637876.167) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-
server.html%3Fs_action%3Dreport%26s_data%3D11928398%26s_csrf%3D1607326637876.167) |
Share

1 Comment

Former Member
Aug 31, 2015 at 01:30 PM (/comments/11928487/view.html)
Hi Suneel,

I had already tried the above code, it is not working. I would save the le in application server; but when we check the same le after downloading it to local machine; it would give error message that "the
le is damaged or could not be repaired".

Thanks,

Like (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-server.html%3FchildToView%3D11928487%23comment-


11928487%26s_action%3Dlike_comment%26s_data%3D11928487%26s_csrf%3D1607326637876.167) 0 |
Share
|
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F11928298%2Fdownload-pdf- le-to-application-
server.html%3Fs_action%3DreportComment%26s_data%3D11928487%26s_csrf%3D1607326637876.167)

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%2F11928298%2Fdownload-pdf- le-to-


application-server.html%3Fs_action%3DanswerQuestion%26s_csrf%3D1607326637876.167) 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)

Вам также может понравиться