<?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: Cannot refresh instance of CL_GUI_HTML_VIEWER in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789756#M2024246</link>
    <description>&lt;P&gt;The static forms of CALL METHOD are obsolete. Same for CREATE OBJECT.&lt;/P&gt;&lt;P&gt;Use e.g.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;gr_html_viewer = NEW #( parent = gr_container ).

gr_html_viewer-&amp;gt;load_data( ... ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Dec 2023 12:28:02 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-12-14T12:28:02Z</dc:date>
    <item>
      <title>Cannot refresh instance of CL_GUI_HTML_VIEWER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789754#M2024244</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;
  &lt;P&gt;I'm missing something obvious here, hoping someone can tell me what I'm doing wrong.&lt;/P&gt;
  &lt;P&gt;I have a report that processes a series of invoice numbers in a loop. &lt;/P&gt;
  &lt;P&gt;For each one, the Smartform output is captured in an OTF table, converted to PDF format, then displayed using class CL_GUI_HTML_VIEWER within a custom container. That works perfectly for the first invoice.&lt;/P&gt;
  &lt;P&gt;After displaying the invoice, I am FREEing the HTML viewer and custom container objects.&lt;/P&gt;
  &lt;P&gt;But the appearance of the PDF never changes: it keeps re-displaying the first one.&lt;/P&gt;
  &lt;P&gt;Clearly the HTML viewer isn't being refreshed with the new data. This seems a bit odd, as for each iteration, the HTML viewer is being destroyed and completely re-instantiated. And yes, I have checked that the OTF table is different every time.&lt;/P&gt;
  &lt;P&gt;This is the code sequence:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;    CREATE OBJECT gr_container
      EXPORTING
        container_name = 'INVOICE_CC'.

    CREATE OBJECT gr_html_viewer
      EXPORTING
        parent = gr_container.

    CALL METHOD gr_html_viewer-&amp;gt;load_data
      EXPORTING
        type         = 'APPLICATION'
        subtype      = 'PDF'
      IMPORTING
        assigned_url = lv_url
      CHANGING
        data_table   = lt_pdfdata.

    CALL METHOD cl_gui_cfw=&amp;gt;flush.

    CALL METHOD gr_html_viewer-&amp;gt;show_data
      EXPORTING
        url = lv_url.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Then, after displaying each invoice, this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;  FREE: gr_html_viewer, gr_container.
&lt;/CODE&gt;&lt;/PRE&gt;I have played around with the DO_REFRESH method, but I'm not certain where to place it (I think I've tried every position). No luck there.Thank you for reading this: all constructive suggestions welcomed.CheersJohn M.</description>
      <pubDate>Thu, 14 Dec 2023 12:01:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789754#M2024244</guid>
      <dc:creator>johnm16</dc:creator>
      <dc:date>2023-12-14T12:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot refresh instance of CL_GUI_HTML_VIEWER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789755#M2024245</link>
      <description>&lt;P&gt;The ABAP statement FREE is not to be confused with the &lt;STRONG&gt;method FREE of the controls in the Control Framework&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Only the latter can destroy the control in the frontend.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;gr_html_viewer-&amp;gt;free( ).
FREE gr_html_viewer.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2023 12:24:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789755#M2024245</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-12-14T12:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot refresh instance of CL_GUI_HTML_VIEWER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789756#M2024246</link>
      <description>&lt;P&gt;The static forms of CALL METHOD are obsolete. Same for CREATE OBJECT.&lt;/P&gt;&lt;P&gt;Use e.g.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;gr_html_viewer = NEW #( parent = gr_container ).

gr_html_viewer-&amp;gt;load_data( ... ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2023 12:28:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789756#M2024246</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-12-14T12:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot refresh instance of CL_GUI_HTML_VIEWER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789757#M2024247</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;I take your point about my old school code, and thank you for the pointer re. freeing objects.&lt;/P&gt;&lt;P&gt;It works, and I'm a happy bunny.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 12:42:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-refresh-instance-of-cl-gui-html-viewer/m-p/12789757#M2024247</guid>
      <dc:creator>johnm16</dc:creator>
      <dc:date>2023-12-14T12:42:13Z</dc:date>
    </item>
  </channel>
</rss>

