cancel
Showing results for 
Search instead for 
Did you mean: 

Display Adobe PDF from ERP in Java Web Dynpro

Former Member
0 Kudos

I want to display a PDF from ERP in Web Dynpro. Similar to the ESS Time Statement and Paycheck.

What is the best way to dynamically display a custom PDF from ERP in Web Dynpro?

Right now our ABAP team has created a program that send a PDF to the spool.

Thanks,

Tom

Accepted Solutions (0)

Answers (2)

Answers (2)

ThatSAPGuy
Advisor
Advisor
0 Kudos

Thomas-

I have not worked on ESS, so I am not sure if I understood your requirement correctly. The way I see it you want to allow the user to download/view a PDF file which is being generated as a stream from an RFC. If it is to do with Adobe forms please disregard this and refer to the previous post.

Here is how you achieve the File Download functionality:

1. In your component controller define an attribute of type Resource. This should be in the package com.sap.ide.webdynpro.uielementdefinitions

2. Using context mapping make this available in your view controller.

3. In your view create an element of type FileDownload and bind the resource property to the attribute created in (1)

4. Change the text attribute to "download" or the like.

5. Create the resource on demand in your component controller using:


// TODO: execute your RFC which returns a PDF byte stream
// create the resource
IWDResource resource =  WDResourceFactory.createResource(	
							byteArray, 		// the byte[] returned by your RFC
							"FileName.PDF",		// the file name, could be returned by RFC   
							WDWebResourceType.PDF);	// PDF content

6. Set this in your context.


wdContext.currentUiResourceElement().setResource(resource);

Cheers-

Atul

Former Member
0 Kudos

Thomas,

Please refer the tutuorial on Adobe Forms and WebDynpro for java.

https://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#50

Thanks!

Surya.