2016 Mar 11 9:57 PM
First of all - I read this post: https://scn.sap.com/thread/3854272
However I still don't get my image to display.
The HTML is correctly parsed: src="MIME000004"
This is the code to add the image (which is stored in SMW0) and to retrieve the URL:
* Get URL
CALL METHOD html_viewer->load_mime_object
EXPORTING
object_id = objid
IMPORTING
assigned_url = -url
EXCEPTIONS
others = 1.
IF sy-subrc <> 0.
RAISE not_found.
ENDIF.
Output:
2016 Mar 14 5:55 PM
This process is working just fine. I had another defect in my report, where i passed on the original HTML template to CL_GUI_HTML_VIEWER, rather then the version that i had updated URL for my image.
Below is a high level flow of my report:
* Load Data
CALL METHOD html_viewer->load_data
EXPORTING
subtype = 'html'
IMPORTING
assigned_url = lv_url
CHANGING
data_table = lt_html
EXCEPTIONS
OTHERS = 1.
...
* Show Data
CALL METHOD html_viewer->show_data
EXPORTING
url = lv_url
EXCEPTIONS
OTHERS = 1.
...
* Attach Images to HTML Viewer
CALL METHOD html_viewer->load_mime_object
EXPORTING
object_id = ls_image-objid
object_url = ls_image-url
EXCEPTIONS
OTHERS = 1.
You can see i even "show the data" before loading the mime objects, although this may not make any logical sense, it just happened this way, as i added the image capability as an add-on and it would require more signficant changes to execute this in "logical" order.
You can also check SAP's samples which should be available in you system: RSDEMO_HTML_VIEWER
2016 Mar 14 5:55 PM
This process is working just fine. I had another defect in my report, where i passed on the original HTML template to CL_GUI_HTML_VIEWER, rather then the version that i had updated URL for my image.
Below is a high level flow of my report:
* Load Data
CALL METHOD html_viewer->load_data
EXPORTING
subtype = 'html'
IMPORTING
assigned_url = lv_url
CHANGING
data_table = lt_html
EXCEPTIONS
OTHERS = 1.
...
* Show Data
CALL METHOD html_viewer->show_data
EXPORTING
url = lv_url
EXCEPTIONS
OTHERS = 1.
...
* Attach Images to HTML Viewer
CALL METHOD html_viewer->load_mime_object
EXPORTING
object_id = ls_image-objid
object_url = ls_image-url
EXCEPTIONS
OTHERS = 1.
You can see i even "show the data" before loading the mime objects, although this may not make any logical sense, it just happened this way, as i added the image capability as an add-on and it would require more signficant changes to execute this in "logical" order.
You can also check SAP's samples which should be available in you system: RSDEMO_HTML_VIEWER