cancel
Showing results for 
Search instead for 
Did you mean: 

Show PDF from RFC

Former Member
0 Kudos

Hi,

I´ve installed ESS BP on my portal and some of the reports are showed as a PDF file, and I was wondering how did they do that?

Seem like the rfc send the file, like a binary sent thru the function.

Any idea? Any sample how to do that?

Thanks,

Edu

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The problem that I was facing is that how the ECC send the PDF to the portal and then i figure it out, you create an rfc that exports an xstring with the binary os the pdf, there are many ways and the one I read but didn´t test if that gonna works is using Smart Form, I did with Sap Script and it works but a RFC called a program that generates the Sap Script and then send the OTF table to the RFC.

Bye,

Edu

athavanraja
Active Contributor
0 Kudos

the key is only getting the pdf content as bite stream. once you have that all you need to do is set it as page response and set the mime type (application/pdf)

Raja

luciano_leitedasilva
Contributor
0 Kudos

Eduardo,

I've used a binary type in a similar situation. The RFC retrievers a BINARY type and my Web Dynpro applications show the PDF result.

Following my Web Dynpro code:

IWDCachedWebResource resource = WDWebResource.getWebResource

(wdContext.currentZ_Pdf_Report_OutputElement().getPdf(),

WDWebResourceType.getWebResourceTypeForFileExtension("pdf"));

resource.setResourceName(this.getDescriptionReport());

// Create a External Window with the URL destination

IWDWindow window = wdComponentAPI.getWindowManager().

createExternalWindow(resource.getURL(), this.getDescriptionReport(), true);

// Eliminate some features of the window

window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);

window.removeWindowFeature(WDWindowFeature.MENU_BAR);

window.removeWindowFeature(WDWindowFeature.STATUS_BAR);

window.removeWindowFeature(WDWindowFeature.TOOL_BAR);

window.setWindowSize(780,430);

window.setWindowPosition(20,140);

window.open();

Regards,

Luciano