0% found this document useful (0 votes)
146 views

PDF Stored in Table Using ABAP Program - SAP Q&A

Uploaded by

phogat project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views

PDF Stored in Table Using ABAP Program - SAP Q&A

Uploaded by

phogat project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Community

(http://www.sap.com/)
(https://community.sap.com)
(/users/login.html?
redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-
stored-in-table-using-abap-program.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

(/users/306407/liangws.html) Liang WS ( https://people.sap.com/liang.ws)


Download PDF stored in table using ABAP program
Jun 28, 2012 at 03:05 PM | 1.3k Views
estions%2F9387342%2Fdownload-pdf-stored-in-table-
data%3D9387342%26s_csrf%3D1607326639461.743)
sing-abap-
0
estions%2F9387342%2Fdownload-pdf-stored-in-table-
sing-abap-
_data%3D9387342%26s_csrf%3D1607326639461.743)
(/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-
Follow
program.html%3Fs_action%3Dfollow%26s_csrf%3D1607326639461.743) RSS Feed

Dear all,

I'd like to download PDF that is stored in table as rawstring using ABAP program. Here's the scenario.

Users upload the PDF using webdynpro application. The PDF is then saved into a custom table with eld of type rawstring. I need to create an ABAP program to retrieve the PDF
and save into local pc. I've no authorization to run or test to debug the webdynpro application.

I'd like to know how do I convert the rawstring back into PDF using ABAP program and eventually download into local pc? I've tried using several FM like
SCMS_XSTRING_TO_BINARY and etc., and download it using GUI_DOWNLOAD or cl_gui_frontend_services=>gui_download but it always dump giving error about the rawstring.

Basically what I want to achieve is using table control to list all the PDF, then users can double click on the le they want to see or save into local pc. Kindly advise on how to
convert rawstring back to PDF. Is it even possible to download the PDF using ABAP program or this function is speci c to webdynpro only?

Thanks in advance.

Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-


program.html%3Fs_action%3Dcomment%26s_data%3D9387342%26s_csrf%3D1607326639461.743) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-
program.html%3Fs_action%3DreportQuestion%26s_data%3D9387342%26s_csrf%3D1607326639461.743)

Assigned Tags

ABAP Development (/tags/833755570260738661924709785639136) |

Related questions

Print Document stored inExternal Server. (https://answers.sap.com/questions/1341809/print-document-stored-inexternal-server.html)


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

UPload MSG extension le and convert to PDF le (https://answers.sap.com/questions/533897/upload-msg-extension- le-and-convert-to-pdf- le.html)


By kimaya shingavi ( https://people.sap.com/kimayashingavi) Jun 04, 2018

2 Answers

Sort by: Votes | Newest | Oldest

Former Member

Jun 28, 2012 at 05:12 PM

Hi Liang,
2Fquestions%2F9387342%2Fdownload-pdf-stored-in-
ml%3FchildToView%3D9387516%23answer-
data%3D9387516%26s_csrf%3D1607326639461.743)
0
what error are you getting? I've done this lots of times using SCMS_XSTRING_TO_BINARY and
2Fquestions%2F9387342%2Fdownload-pdf-stored-in-
ml%3FchildToView%3D9387516%23answer-
_data%3D9387516%26s_csrf%3D1607326639461.743)

cl_gui_frontend_services=>gui_download and it has worked ne!

Cheers,
/
Kimon
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-
program.html%3Fs_action%3Dcomment%26s_data%3D9387516%26s_csrf%3D1607326639461.743) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-
program.html%3Fs_action%3Dreport%26s_data%3D9387516%26s_csrf%3D1607326639461.743) |
Share

5 Comments

Liang WS ( https://people.sap.com/liang.ws)  Former Member

Jun 29, 2012 at 06:41 AM (/comments/9388618/view.html)


It's being saved into the table through a Webdynpro interface. I don't really know the technical details or the code because I don't have the authorization to debug it.

Regards,

Liang

Like (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-program.html%3FchildToView%3D9388618%23comment-
9388618%26s_action%3Dlike_comment%26s_data%3D9388618%26s_csrf%3D1607326639461.743) 0 |
Share
|
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-
program.html%3Fs_action%3DreportComment%26s_data%3D9388618%26s_csrf%3D1607326639461.743)

Show all

Comment on This Answer (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-


program.html%3Fs_action%3Dcomment%26s_data%3D9387516%26s_csrf%3D1607326639461.743)

Deependra Shekhawat ( https://people.sap.com/deependra.shekhawat3)


(/users/10627/deependrashekhawat3.html)
Jun 29, 2012 at 06:39 AM

Hi,
2Fquestions%2F9387342%2Fdownload-pdf-stored-in-
ml%3FchildToView%3D9388569%23answer-
data%3D9388569%26s_csrf%3D1607326639461.743)
0
How are you downloading the binary le on local PC.
2Fquestions%2F9387342%2Fdownload-pdf-stored-in-
ml%3FchildToView%3D9388569%23answer-
_data%3D9388569%26s_csrf%3D1607326639461.743)

Can you pls provide the code ...

***You can also use XSTRING_TO_SOLIX method of Cl_BCS_Convert .

and download solix tab to local PC by passing format 'BIN'.

i think you must try this ...

Deeps
Add a Comment (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-
program.html%3Fs_action%3Dcomment%26s_data%3D9388569%26s_csrf%3D1607326639461.743) |
Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-
program.html%3Fs_action%3Dreport%26s_data%3D9388569%26s_csrf%3D1607326639461.743) |
Share

3 Comments

Former Member  Former Member


Aug 13, 2012 at 12:52 PM (/comments/9479762/view.html)
Hi Kiron,

I think you have to parse the rawstring so that it will be converted from rawstring to string.

I have faced a similar issue when I was uploading a pdf and I wanted the data into a structure.

Is this what you want ?, please con rm, so that I can provide you the code for the same.

Regards,

Aakash Awasthi

Like (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-program.html%3FchildToView%3D9479762%23comment-
9479762%26s_action%3Dlike_comment%26s_data%3D9479762%26s_csrf%3D1607326639461.743) 0 |
Share
|

Alert Moderator (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-

program.html%3Fs_action%3DreportComment%26s_data%3D9479762%26s_csrf%3D1607326639461.743) /
Show all

Comment on This Answer (/users/login.html?redirect_to=%2Fquestions%2F9387342%2Fdownload-pdf-stored-in-table-using-abap-


program.html%3Fs_action%3Dcomment%26s_data%3D9388569%26s_csrf%3D1607326639461.743)

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%2F9387342%2Fdownload-pdf-stored-in-table-


using-abap-program.html%3Fs_action%3DanswerQuestion%26s_csrf%3D1607326639461.743) 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