Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Read PDF File

sid-desh
Product and Topic Expert
Product and Topic Expert
0 Likes
1,502

Hi,

I have a requirement of reading a PDF file from the application server and passing the data of the PDF back to a WebDynpro Application via an RFC.

1. While opening the file using OPEN DATASET which mode should i use.

2. While passing the data back via RFC what type should i use. My WebDynpro application expects the data in ByteStream format.

3. Also i want to read the file from the Application server and download the same to presentation server. i opened the file in Binary mode and used GUI_DOWNLOAD for downloading using format BIN. However the PDF file is not created on the presentation server. How can i achieve this.

Please let me know your suggestions.

Regards

Sidharth

Hi,

I have a requirement of reading a PDF file from the application server and passing the data of the PDF back to a WebDynpro Application via an RFC.

1. While opening the file using OPEN DATASET which mode should i use.

2. While passing the data back via RFC what type should i use. My WebDynpro application expects the data in ByteStream format.

3. Also i want to read the file from the Application server and download the same to presentation server. i opened the file in Binary mode and used GUI_DOWNLOAD for downloading using format BIN. However the PDF file is not created on the presentation server. How can i achieve this.

Please let me know your suggestions.

Regards

Sidharth

4 REPLIES 4
Read only

Former Member
0 Likes
940

Hi Sidharth,

You cannot read a PDF file from the application server using OPEN dataset.

To create PDF file there are few functions available.

Such as:

CONVERT_ABAPSPOOLJOB_2_PDF

CONVERT_OTFSPOOLJOB_2_PDF

CONVERT_OTF_2_PDF

Regards

Rani

Read only

Former Member
0 Likes
940

Hi,

What would be easiest is to get the spool details back and then convert to a PDF. Is this not possible ?

Kind regards

Colin.

Read only

0 Likes
940

Alternatively you may want to look at this class.

CL_FP_PDF_OBJECT

Regards

Raja

Read only

Former Member
0 Likes
940

Hi Sidharth,

You can open PDF file from an application server directly using 'open dataset' and read using 'read dataset', just ensure you have the datatype of the target field in which the file is read as XSTRING.

The same PDF file can then be transferred using 'transfer dataset' to any place on application server too.

Regards,

Aniket