cancel
Showing results for 
Search instead for 
Did you mean: 

Converting PDF to XSTRING for Adobe in WD ABAP Application

0 Kudos

I have a requirement to develop a WD abap application in the portal, where 300 PDF's would exist on our LAN all with the pernr number embedded in the name. When a user logs onto the portal, it would retrieve the correct PDF for their pernr and display in an adobe form. In the application, I know how I can use the username, to derive the pernr to get the PDF name.

Right now I can use the upload functionality to upload(with an upload UI element) a particular file and put in a PDF with adobe, However, If I want to point to a particular file (based on the pernr name) on a secure folder on our LAN, can I do that?

If I plug in a file name instead of using the upload UI element, I need to figure out how to convert the PDF to an XSTRING so that I can pass that xstring to the adobe form interface.

Also, is there even a way to assign a file name on a LAN to an upload element in a WD ABAP application or is it necessary to use the dropdown to retrieve the file name from the users desktop in order for it to convert ot a PDF correctly?

Thanks,

Pam Laverty

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

what is your exact requirement?

A user logs in and his/her pdf should be presented?

Has the pdf be uploaded by the user? Or is it fix and located on a server?

Best regards,

Oliver

0 Kudos

All of the PDF's should be placed in a fixed location on a server. We would not want the user to have to select a file name to upload. The application would know to choose the correct file name based on the person accessing the application's user name.

The question is can I upload from a fixed location on a server in a WD ABAP and get the file converted to an xstring format that I can pass to my adobe form?

Thanks,

Pam

matt
Active Contributor
0 Kudos

The file upload component is only used to get files from the user presentation server. The user has to make the selection. For security reasons, that's how it's defined. You need to make sure that your pdf files are accessible by the SAP application server - either on the app server's file system, or some shared area - and then you can use OPEN DATASET to get hold of the files.

matt

Clemenss
Active Contributor
0 Kudos

Hi Pam,

the pdf files should be accessible from your SAP application server, then you can

DATA:
  lv_pdf TYPE xstring.
OPEN DATASET <filename> FOR INPUT IN BINARY MODE.
READ DATASET INTO lv_pdf .

The rest follows what you already developed.

Check also this interesting blog that may make things eveb easier.

[Uploading SAP Interactive Form on the ABAP WebDynpro View{|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8554] [original link is broken] [original link is broken] [original link is broken];

Regards

Clemens

Former Member
0 Kudos

Hi,

yes, best would be if they would be located on the application server.

If this is not possible you have to use ftp to connect to the other server.

Best regards,

Oliver

former_member199125
Active Contributor
0 Kudos

hi pam,

I think it's not possible to select the file automatically. use action must be there.

So use upload ui element, once you click on upload button and select the file, that file data will be in DATASOURCE ATTRIBUTE ( the attribute which is binded to data property of upload ui element ) OF UPLOAD UI element in XSTRING format.

From there you can pass it to pdf.

Regards

srinivas

0 Kudos

Thank you all for your replies, Matt and Clemens suggestions look particularly helpful. I'm going to go in and try them out and then will come back in to update points.

Pam

0 Kudos

Matt and Clemens, thank you both. I put the files on my SAP application server as first suggested by Matt and used the Open dataset to get the files and put them in a PDF. The code supplied was also very helpful, so I gave you both points.

I am now able to view different documents as PDF's in the portal.

Thank you both for your help.

Pam

Answers (1)

Answers (1)

ThomasZloch
Active Contributor
0 Kudos

Moved to Web Dynpro ABAP forum.