How to show pdf
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?
Thomas Jung 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.