cancel
Showing results for 
Search instead for 
Did you mean: 

How to publish Smart form of PDF in r/3 through WD

Former Member
0 Kudos

Hi,

We have a PDF smart form in the r/3.we want to call the PDF from WD View without using PDF interactive form.

Could any one give me soln for this??

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

Insert IFrame UI Element and bind the Resource property to the value attribute PdfUrl of type String .

Define a Output parameter of type Binary in RFC .

Insert the following code to dispaly the smart form.

 
		byte[] pdfContent = wdContext.currentOutput<node>().get<Binary>();
		IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);
		try
		{
			wdContext.currentContextElement().setPdfUrl(pdfResource.getURL());
		}
		catch(Exception e)
		{
			wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);	
		}

Regards,

Sunitha Hari

Former Member
0 Kudos

Thanks for quick reply,

I need to pass some data to generate the PDF smart form.

Could u please expali me that how to paas the data to the PDF smart form and information of the PDF smart form that we are to use??

Thanks,

Former Member
0 Kudos

Hi ,

Ask your ABAPer to pass the smart form data to the output parameter of type XSTRING.

In Webdynpro use the code given to display the smartform in Iframe UI element.

Regards,

Sunitha Hari

Former Member
0 Kudos

Hi Sunitha,

i used the following link for my requirement;but i am getting null pointer exception.

saptechnical.com/Tutorials/Smartforms/SFinEPasPDF/Page2.htm

regards

Anumit

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The webdynpro should call an ABAP function module which will process the smart form -> PDF conversion and return a binary stream as an export parameter. (use function CONVERT_OTF to convert samrt form to PDF stream)

The following sample webdynpro code is how I use to display the PDF form in a new window.

IWDCachedWebResource resource;

String fileName = "pdf_file_name"

//Get PFC web resource URL, you need the PDF stream return from ABAP RFC

resource = WDWebResource.getWebResource(wdContext.currentY_PDFElement().getPdfStream(), WDWebResourceType.PDF);

resource.setResourceName(fileName);

String PDF_URL = resource.getURL());

//Open the PDF in new window

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getURL(), "PDF File");

window.setWindowPosition(5, 5);

window.setWindowSize(600, 600);

window.open();