<?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: Dynamic variable in class / problem with refreshing ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541659#M2006153</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; I deleted two additional lines, and the beginning of my code looks like this now:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA TABLE_REF TYPE TABLE OF   (GS_PARAMS-GV_SELECTED_TAB).
      FIELD-SYMBOLS &amp;lt;FS_TABLE&amp;gt;             TYPE STANDARD TABLE.
      ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt;.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Second thing - I will show some more code from display ALV method to clarify what's wrong:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      FIELD-SYMBOLS: &amp;lt;FS_TABLE&amp;gt; TYPE STANDARD TABLE.
      ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt;.

      if 1 = 2.
        go_alv-&amp;gt;REFRESH( ).
      endif.

      TRY.
          CALL METHOD CL_SALV_TABLE=&amp;gt;FACTORY
            IMPORTING
              R_SALV_TABLE = GO_ALV
            CHANGING
              T_TABLE      = &amp;lt;fs_table&amp;gt;.
        CATCH CX_SALV_MSG.
      ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I am trying to call those lines after the user_command:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    GO_ALV-&amp;gt;REFRESH( REFRESH_MODE = IF_SALV_C_REFRESH=&amp;gt;FULL ).
    CL_GUI_CFW=&amp;gt;FLUSH( ).
    GO_ALV-&amp;gt;REFRESH( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Return is the same - old ALV is displayed. Like I said, TABLE_REF and GO_ALV are global attributes for my class, before calling refresh function I am checking the TABLE_REF and it's updated with the new information.&lt;/P&gt;&lt;P&gt;Problem may be solved with different parameter passed into T_TABLE, but I have no idea how to do that.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Oct 2021 10:42:30 GMT</pubDate>
    <dc:creator>kroslaniec</dc:creator>
    <dc:date>2021-10-19T10:42:30Z</dc:date>
    <item>
      <title>Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541657#M2006151</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;In my class I have 3 methods which I am using:&lt;BR /&gt;&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;Prepare data method where we are selecting dynamically 1 name of the table from selection screen into string. I have global attribute TABLE_REF which is Type Ref DATA. Next steps are the only way I could think of how to get a reference to the global variable:&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;PRE&gt;&lt;CODE&gt;      CREATE DATA TABLE_REF TYPE TABLE OF   (GS_PARAMS-GV_SELECTED_TAB).
      CREATE DATA GS_PARAMS-LS_TABLE TYPE TABLE OF   (GS_PARAMS-GV_SELECTED_TAB).
      FIELD-SYMBOLS &amp;lt;FS_TABLE&amp;gt;             TYPE STANDARD TABLE.
      ASSIGN        GS_PARAMS-LS_TABLE-&amp;gt;*   TO              &amp;lt;FS_TABLE&amp;gt;.
      ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Then I am selecting the data into &amp;lt;fs_table&amp;gt;, and I can refer to them in other methods by using TABLE_REF global attribute.&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;Create ALV method, it's a standard instance of cl_salv table, it's initialized by this code (go_alv is also a class attribute):&lt;BR /&gt;&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS: &amp;lt;FS_TABLE&amp;gt; TYPE STANDARD TABLE.
      ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt;.

      TRY.
          CALL METHOD CL_SALV_TABLE=&amp;gt;FACTORY
            IMPORTING
              R_SALV_TABLE = GO_ALV
            CHANGING
              T_TABLE      = &amp;lt;FS_TABLE&amp;gt;.
        CATCH CX_SALV_MSG.
      ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;UL&gt;
   &lt;LI&gt;On user command, where we have custom buttons to enter JSON (last column) of choosen row and then we can make some changes. &lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;My problem is that whatever I am trying to do, I cannot refresh my ALV (it's r_table parameter is the same after many attempts of refreshing). I thought that I could create a new instance of go_alv and it's working, but when I am clicking the back button the old version is displayed (with old data). Any ideas what we could do there different?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 08:38:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541657#M2006151</guid>
      <dc:creator>kroslaniec</dc:creator>
      <dc:date>2021-10-19T08:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541658#M2006152</link>
      <description>&lt;P&gt;In your code, this line is useless and can be removed safely:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ASSIGN        GS_PARAMS-LS_TABLE-&amp;gt;*   TO              &amp;lt;FS_TABLE&amp;gt;.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can refresh the screen with:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;GO_ALV-&amp;gt;REFRESH( ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Oct 2021 09:39:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541658#M2006152</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-10-19T09:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541659#M2006153</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; I deleted two additional lines, and the beginning of my code looks like this now:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA TABLE_REF TYPE TABLE OF   (GS_PARAMS-GV_SELECTED_TAB).
      FIELD-SYMBOLS &amp;lt;FS_TABLE&amp;gt;             TYPE STANDARD TABLE.
      ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt;.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Second thing - I will show some more code from display ALV method to clarify what's wrong:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      FIELD-SYMBOLS: &amp;lt;FS_TABLE&amp;gt; TYPE STANDARD TABLE.
      ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt;.

      if 1 = 2.
        go_alv-&amp;gt;REFRESH( ).
      endif.

      TRY.
          CALL METHOD CL_SALV_TABLE=&amp;gt;FACTORY
            IMPORTING
              R_SALV_TABLE = GO_ALV
            CHANGING
              T_TABLE      = &amp;lt;fs_table&amp;gt;.
        CATCH CX_SALV_MSG.
      ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I am trying to call those lines after the user_command:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    GO_ALV-&amp;gt;REFRESH( REFRESH_MODE = IF_SALV_C_REFRESH=&amp;gt;FULL ).
    CL_GUI_CFW=&amp;gt;FLUSH( ).
    GO_ALV-&amp;gt;REFRESH( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Return is the same - old ALV is displayed. Like I said, TABLE_REF and GO_ALV are global attributes for my class, before calling refresh function I am checking the TABLE_REF and it's updated with the new information.&lt;/P&gt;&lt;P&gt;Problem may be solved with different parameter passed into T_TABLE, but I have no idea how to do that.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 10:42:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541659#M2006153</guid>
      <dc:creator>kroslaniec</dc:creator>
      <dc:date>2021-10-19T10:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541660#M2006154</link>
      <description>&lt;P&gt;I am little bit lost. Your &amp;lt;fs_table&amp;gt; is not global, you declare it just before the factory. &lt;/P&gt;&lt;P&gt;Did you try to declare it in the public section ?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 11:05:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541660#M2006154</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-10-19T11:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541661#M2006155</link>
      <description>&lt;P&gt;&amp;lt;fs_table&amp;gt; is declared locally in both methods - I couldnt figure out how to declare field symbol globally in a class.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 11:11:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541661#M2006155</guid>
      <dc:creator>kroslaniec</dc:creator>
      <dc:date>2021-10-19T11:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541662#M2006156</link>
      <description>&lt;P&gt;No need to flush after REFRESH, it's doing the flush itself.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 12:50:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541662#M2006156</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-10-19T12:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541663#M2006157</link>
      <description>&lt;P&gt;Are you recreating the internal table? SALV keeps reference of the original table only.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 12:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541663#M2006157</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-10-19T12:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541664#M2006158</link>
      <description>&lt;P&gt;I am calling prepare data method after the handle user command method, so in my global attribute TABLE_REF is updated with the new data. The problem is that I don't know how to pass it back to the GO_ALV without creating a new instance&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 13:05:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541664#M2006158</guid>
      <dc:creator>kroslaniec</dc:creator>
      <dc:date>2021-10-19T13:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable in class / problem with refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541665#M2006159</link>
      <description>&lt;P&gt;Execute CREATE DATA TABLE_REF ... and ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt; the first time, and the next times only execute ASSIGN TABLE_REF-&amp;gt;* TO &amp;lt;FS_TABLE&amp;gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 16:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-variable-in-class-problem-with-refreshing-alv/m-p/12541665#M2006159</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-10-19T16:59:12Z</dc:date>
    </item>
  </channel>
</rss>

