cancel
Showing results for 
Search instead for 
Did you mean: 

Upload PDF and map to context

Former Member
0 Kudos

Hi all,

I have a PDF that is mapped to a customer node with name and age.

The user fills up the PDF form and upload to the web dynpro application

The application uses the FileUpload UI Element to upload the pdf file.


byte[] filebytearray = wdContext.currentPDFFileUploadElement().getFileData();
WDInteractiveFormHelper.transferPDFDataIntoContext(filebytearray, wdContext.nodeCustomerUpload());
wdComponentAPI.getMessageManager().reportSuccess("Customer name (uploaded): " +wdContext.currentCustomerUploadElement().getName());
wdComponentAPI.getMessageManager().reportSuccess("Customer age (uploaded): " +wdContext.currentCustomerUploadElement().getAge());

However i am getting null for customer name and 0 for customer age.

Is this the correct way to do it?

Any ideas?

Accepted Solutions (0)

Answers (2)

Answers (2)

sankar_narayana
Active Participant
0 Kudos

Hey,

I don't know the reason why you are uploading it. But i have a suggestion instead of uploading it coming to portal you can create a JavaWebservice and incorporate the JavaWebservice into the form. The method in JavaWebservice is treated as a button in the adobe form. When you drag and drop the button after incorporating Webservice the webservice inserts the data into the SAP R/3. This does not require any portal logging. Directly from adobe form when you click on button your data is stored in SAPR/3.

Former Member
0 Kudos

The problem is solved.



byte[] filebytearray = wdContext.currentPDFFileUploadElement().getFileData();
WDInteractiveFormHelper.transferPDFDataIntoContext(filebytearray, wdContext.nodeCustomerUpload());

This wdContext.nodeCustomerUpload must be exactly the same data node when the PDF file was created.