Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to show pdf

Hi,

I want to show a pdf which is located in the mime repository. I got this error: Access via 'NULL' object reference not possible.

These things I did:

1. I created a context node 'PDF' with attribute 'PDF_SOURCE'. The attribute has the Type XSTRING and as Default Value I deposit test.pdf

2. Then I created an Interactive Form element in the layout and bind the dataSource to the node and the pdfSource to the attribute.

Has anybody an idea what I did wrong?

Regards, Susanne

Former Member
replied

There is a Mime API Class: IF_MR_API. Here is an example:

data lr_mime_rep type ref to if_mr_api,
                mv_products_xml type xstring.
  constants lc_custom_path type string
                           value 'SAP/PUBLIC/BC/NWDEMO_MODEL/Products_custom.xml'.

  lr_mime_rep = cl_mime_repository_api=>if_mr_api~get_api( ).

  call method lr_mime_rep->get
    exporting
      i_url     = lc_custom_path
    importing
      e_content = mv_products_xml
    exceptions
      not_found = 3.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question