Skip to Content
avatar image
Former Member

Open PDF retrieved via odata service in SAPUI5

Hi all,

How can I show a PDF file retrieved via an ODATA service in to my SAPUI5 application?  I have looked for some controls or api's but I can not find one in the SAPUI5 labrary. Also can not find any good information on the internet.

Can someone tell me a solution?

Kind regards,

Richard

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 27, 2014 at 10:15 AM

    Hi Martin,

    I think it is a flat pdf.

    I saved my PDF document in a xstring. When I call the Odata service then I use get_stream method to produce the pdf. The same way to  retreive a Photo.

    How to Read Photo from SAP system using SAP Gateway

    Kind regards,

    Richard

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 27, 2014 at 05:54 AM

    Hi,

    Please refer solution as last reply in thread http://scn.sap.com/thread/3410292

    also refer thread

    Regards,

    Chandra

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 27, 2014 at 10:33 AM

    Hi R. Middelburg,

    As explained earlier and in previous threads, there is no control in the SAPUI5 Framework that allows you to embed a PDF document within the application, as is possible in Web Dynpro using Adobe Document Services.

    As I understand it, you are currently returning an xstring via OData services? Correct me if I am wrong.

    I would like to suggest an alternative option: Business Document Services. In the backend, you could call the Adobe Document Services to return the PDF file and store it in Business Document Services. You can then retrieve the required information from the Business Document Services via the "BDS_BUSINESSDOCUMENT_GET_URL" Function Module and set the web_applic_server_url_only property to abap_true. This will return a URL that points to the requested document, which is stored in Business Document Services. You can then return this URL via OData to your SAPUI5 application.

    Depending on the client (mobile or desktop) the url will download the file and display it. For example, if you open up the URL which links to a PDF file in Google Chrome, it will download it and open the file in a new tab in the browser. This will have to suffice until, hopefully, the SAPUI5 Framework allows embedding of documents as it is done in Web Dynpro.

    I hope my suggestion is valuable to your scenario.

    Kind regards

    Miki von Ketelhodt

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 07, 2015 at 08:09 AM

    Hi All,

    I tried your solutions...I can able to View my pdf in Desktop....when i create apk It is going to blank screen 😔

    I am using SAP Netweaver Gateway service to show my pdf in mobile...Can you please give some idea to me ....

    Thanks,

    Karthik A

    Add comment
    10|10000 characters needed characters exceeded