cancel
Showing results for 
Search instead for 
Did you mean: 

smartform pdf display sapui5 /error : no handler for data

swamy1
Explorer
0 Kudos
776

Hi UI5 and Odata Masters,

I am trying to Implemented SAPUI5 Smartform PDF display, when I call the OData I am getting below error, however in SAP ECC(Hub System) with the same call OData I am able to get PDF as file(Popup-->open).

below is the Read I am performing

var sRead = "/pdfSet(customer='" + value + "')/$value";

oModel.read(sRead, { success: function (oData, oResponse) { alert("Read Sucess”); },

error: function (oerror) { alert("Read failed"); } });

I have followed the below Link and Implemented Smartform PDF display SAPUI5 and Implemented

Improved and Recommended approach to Display PDF. The same error is also posted by “Mathias” in the same block.

https://blogs.sap.com/2014/02/03/display-smartform-pdf-in-sapui5/

Can any please help me .

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

did you try giving this "/sap/opu/odata/SAP/ZPDF2_SRV/pdfSet(customer='7000000248')/$value" to the attribute "source" of your pdfviewer?

Answers (2)

Answers (2)

swamy1
Explorer
0 Kudos

Hi Jun Wu,

Thank you very much for your inputs.

Yes I have tried with sap/opu/odata/SAP/ZPDF2_SRV/pdfSet(customer='7000000248')/$value

The Problem the Read call is downloading as PDF file in separate TAB and showing complete page as busy indicator, it is not Displaying directly on Desktop on the same Page.

<PDFViewer id="ZPDFViewer_1" source="{/Source}" title="{/Title}" height="{/Height}" displayType = "Embedded">

<layoutData>

<FlexItemData growFactor="1"/>

</layoutData>

</PDFViewer>

Got the solution

Ref to below link

https://blogs.sap.com/2016/02/13/display-pdf-in-sapui5-prevent-from-downloading/

swamy1
Explorer
0 Kudos

The below syntax is able to download the form to Desktop, but I want display the PDF in sapui5 PDFViewer.

var url = "http://<host> /sap/opu/odata/SAP/ZPDF2_SRV/pdfSet(customer='7000000248')/$value";

window.open( url);