<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue when displaying images using cl_gui_html_viewer! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-when-displaying-images-using-cl-gui-html-viewer/m-p/12340361#M1992098</link>
    <description>&lt;P&gt;I second Jörgen + the parameter &lt;STRONG&gt;SIZE &lt;/STRONG&gt;(number of bytes) of LOAD_DATA is missing, you should pass the exact image size otherwise SAP will calculate it like number of lines of table im_t_kunnr_image multiplied by line size, which will probably consider extra null bytes, and they may be incorrectly interpreted.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 07:52:12 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-01-19T07:52:12Z</dc:date>
    <item>
      <title>Issue when displaying images using cl_gui_html_viewer!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-when-displaying-images-using-cl-gui-html-viewer/m-p/12340359#M1992096</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
  &lt;P&gt;I'm writing because I'm facing a problem using ABAP class cl_gui_html_viewer. &lt;/P&gt;
  &lt;P&gt;The requirement is to extract all image files saved in transaction XD03 from GOS for further usage to display an HTML file in HTML viewer.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1878578-xd03.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1878581-list.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Unfortunately, I came across when HTML viewer has displayed all data, some images are displayed correctly and some other does not appear, what appears is the 'X' or some other does not appear anything.&lt;/P&gt;
  &lt;P&gt;- Correct display.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1878582-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;- Incorrect display (No Image).&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1878583-no-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1878584-no-image-2.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I don't understand what's wrong with the program so If somebody might help me to solve this issue.&lt;/P&gt;
  &lt;P&gt;I attach a small part of the code:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;* Creates Container
    IF custom_container IS INITIAL.
      CREATE OBJECT custom_container
        EXPORTING
          container_name = 'CUST_CONT_1'.    
    ENDIF.

* Creates HTML Control
    IF html_control IS INITIAL.
      CREATE OBJECT html_control
        EXPORTING
          parent = custom_container.    " Container
    ENDIF.

* ITAB containing IMAGE code.
    IF im_t_kunnr_image[] IS NOT INITIAL.
* Build image name.
      CONCATENATE c_image_url_
                  im_s_outtab-bukrs
                  '_'
                  im_s_outtab-kunnr
                  '_'
                  im_image_count
             INTO lv_image_name.

* Load image data into URL variable.
      im_html_control-&amp;gt;load_data(
        EXPORTING
          url          = lv_image_name
          type         = c_image        "'image'
          subtype      = c_jpg          "'.jpg'
        IMPORTING
          assigned_url = lv_image_url
        CHANGING
          data_table   = im_t_kunnr_image ).

* Defines table for image.
      ex_t_html = VALUE #( BASE ex_t_html
      ( '&amp;lt;table&amp;gt;' )
      ( '&amp;lt;tr align="center"&amp;gt;' )
      ( '&amp;lt;th align="center"&amp;gt;&amp;lt;img src="' &amp;amp;&amp;amp; lv_image_url &amp;amp;&amp;amp; '" style="width:40%;"&amp;gt;&amp;lt;/th&amp;gt;' )
      ( '&amp;lt;/tr&amp;gt;' )
      ( '&amp;lt;/table&amp;gt;' ) ).
    ENDIF.

* Load data HTML itab.
        html_control-&amp;gt;load_data(
          IMPORTING
            assigned_url = lv_html_url
          CHANGING
            data_table   = html_table ).

* Get URL to be displayed in container.
        html_control-&amp;gt;show_url(
           EXPORTING
             url = lv_html_url ).

* Display HTML Preview
        CALL SCREEN 0100.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks for your comments.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 21:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-when-displaying-images-using-cl-gui-html-viewer/m-p/12340359#M1992096</guid>
      <dc:creator>guillermo_espaa2</dc:creator>
      <dc:date>2021-01-18T21:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Issue when displaying images using cl_gui_html_viewer!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-when-displaying-images-using-cl-gui-html-viewer/m-p/12340360#M1992097</link>
      <description>&lt;P&gt;Are all the images .jpg files?&lt;/P&gt;&lt;P&gt;Are there any similarities between the images that does not work?&lt;/P&gt;&lt;P&gt;Is the lv_image_name and lv_image_url turning out correct?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 04:39:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-when-displaying-images-using-cl-gui-html-viewer/m-p/12340360#M1992097</guid>
      <dc:creator>joltdx</dc:creator>
      <dc:date>2021-01-19T04:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue when displaying images using cl_gui_html_viewer!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-when-displaying-images-using-cl-gui-html-viewer/m-p/12340361#M1992098</link>
      <description>&lt;P&gt;I second Jörgen + the parameter &lt;STRONG&gt;SIZE &lt;/STRONG&gt;(number of bytes) of LOAD_DATA is missing, you should pass the exact image size otherwise SAP will calculate it like number of lines of table im_t_kunnr_image multiplied by line size, which will probably consider extra null bytes, and they may be incorrectly interpreted.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 07:52:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-when-displaying-images-using-cl-gui-html-viewer/m-p/12340361#M1992098</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-01-19T07:52:12Z</dc:date>
    </item>
  </channel>
</rss>

