Skip to Content

Display pdf retrieved using odata service in iframe

Apr 03, 2017 at 05:10 AM


avatar image
Former Member

Hello experts,

I have created a sapui5 application using Web IDE for retreiving a .pdf file using odata and displaying it in an iframe.

I have followed the initial steps (not the improved steps) as mentioned in the following blog :

The application runs well when i create a tile and execute from my launchpad, but when I click on the button for opening the pdf file, it executes the success function, but does not display anything in the iframe.

Kindly suggest.

Thanks in advance,

Jalpa Desai

10 |10000 characters needed characters left characters exceeded

can you check if any error is recorded in the console and please share the code that you are using to show the pdf.

Best Regards,

* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Jul 28, 2017 at 09:52 AM

Resolved by using new odata service.

Show 1 Share
10 |10000 characters needed characters left characters exceeded


I'm having the same issues as yours and have changed my odata service to V2.

var oModel = new sap.ui.model.odata.v2.ODataModel("serviceUrl", true);

But I'm getting error "Cannot read property 'body' of undefined" when reading the oData service.

Any inputs?




avatar image
Former Member Apr 04, 2017 at 06:24 AM

Hello experts,

I have written the code in button click as follows. But doest not get anyting when I click the button. (Iframe is empty)

var pdfurl,html = new sap.ui.core.HTML();

var uri="/sap/opu/odata/sap/Zservice_srv";

var oModel=new sap.ui.model.odata.ODataModel(uri,false);


var sRead = "/***Set/('1234')";,null,null,false, function(oData,oResp){


html.setContent("<iframe src='"+pdfurl+"'/>");"success");




Kindly Advise.

Jalpa Desai

10 |10000 characters needed characters left characters exceeded