<?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: Endless loop when using SUBMIT with RM06EPS0 (ME49) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299140#M1990101</link>
    <description>&lt;P&gt;My friend, i was so noob that i did not realize that i still could use the &lt;STRONG&gt;cl_salv_bs_runtime&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;It works like a charm! I got my data after the call.. Can you explain or direct me to some reading as to which mechanism is behind this and why memory data are still available for reading?&lt;/P&gt;</description>
    <pubDate>Sat, 03 Oct 2020 05:33:11 GMT</pubDate>
    <dc:creator>e4rthdog</dc:creator>
    <dc:date>2020-10-03T05:33:11Z</dc:date>
    <item>
      <title>Endless loop when using SUBMIT with RM06EPS0 (ME49)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299136#M1990097</link>
      <description>&lt;P&gt;I am using the following code to get the ALV data into memory from program RM06EPS0 (tcode ME49) and i found out that i am entering in an endless loop when doing so.&lt;/P&gt;
  &lt;P&gt;Main Code:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS &amp;lt;lt_data&amp;gt;   TYPE ANY TABLE.
DATA lr_data              TYPE REF TO data.


cl_salv_bs_runtime_info=&amp;gt;set(
   EXPORTING display  = abap_false
             metadata = abap_false
             data     = abap_true ).


SUBMIT rm06eps0 AND RETURN.


TRY.
    cl_salv_bs_runtime_info=&amp;gt;get_data_ref(
      IMPORTING r_data = lr_data ).
    ASSIGN lr_data-&amp;gt;* TO &amp;lt;lt_data&amp;gt;.
  CATCH cx_salv_bs_sc_runtime_info.
    MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
ENDTRY.


cl_salv_bs_runtime_info=&amp;gt;clear_all( ).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;After debugging the standard code i found out that everything should work just fine. the standard program is getting the data and also runs REUSE_ALV_GRID_DISPLAY correctly.&lt;/P&gt;
  &lt;P&gt;BUT right after the ALV grid code there is a condition that creates the problem.&lt;/P&gt;
  &lt;P&gt;Standard code for the ALV in program FM06IF03:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;WHILE l_leave_sw IS INITIAL.
* build event table
    PERFORM alv_build_event_table USING p_vorgang
                                        lt_events[].

* get reference for output structure / table
    PERFORM alv_get_table_ref USING    p_vorgang
                              CHANGING l_table_ref.

* assign the table reference to the output table
    ASSIGN l_table_ref-&amp;gt;* TO &amp;lt;outtab&amp;gt;.

* fill the output table
    PERFORM alv_fill_output_table USING    p_vorgang
                                  CHANGING &amp;lt;outtab&amp;gt;.
* build layout
    PERFORM alv_build_layout USING p_vorgang
                             CHANGING ls_variant
                                      ls_layout
                                      l_grid_settings.

* build fieldcatalog
    PERFORM alv_build_fieldcatalog USING    p_vorgang
                                   CHANGING lt_fieldcat.
    CHECK sy-subrc IS INITIAL.

    l_repid = sy-repid.

* deactivated interface check, as this is not necessary here! "n1068548
* call the ALV Grid
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_interface_check       = ' '                         "n1068548
        i_callback_program      = l_repid
        is_layout               = ls_layout
        i_grid_title            = l_grid_title
        i_grid_settings         = l_grid_settings
        it_fieldcat             = lt_fieldcat
        i_default               = 'X'
        i_save                  = 'A'
        is_variant              = ls_variant
        it_events               = lt_events
      IMPORTING
        e_exit_caused_by_caller = l_exit_caused_by_caller
        es_exit_caused_by_user  = ls_exit_caused_by_user
      TABLES
        t_outtab                = &amp;lt;outtab&amp;gt;
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.

    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    IF ls_exit_caused_by_user = 'X'  OR              "1094328
       sy-batch = 'X' OR sy-binpt = 'X'.
         l_leave_sw = 'X'.
    ENDIF.

  ENDWHILE.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;As you can see the whole section is in a WHILE loop. This while loop DOES NOT exit when using the SUBMIT. the reason is that the variable &lt;STRONG&gt;l_leave_sw&lt;/STRONG&gt; never becomes true.&lt;/P&gt;
  &lt;P&gt;When you run the report normally everything works fine and the ALV is displayed.&lt;/P&gt;
  &lt;P&gt;I tried to set sy-batch or sy-binpt to true in my code but it was unsuccessfull.&lt;/P&gt;
  &lt;P&gt;Any ideas on how to make it work?&lt;/P&gt;
  &lt;P&gt;P.S. &lt;A href="https://stackoverflow.com/questions/64169049/submit-command-hungs-in-report-me49-rm06eps0?noredirect=1#comment113482567_64169049" target="_blank"&gt;Stackoverflow question&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 16:31:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299136#M1990097</guid>
      <dc:creator>e4rthdog</dc:creator>
      <dc:date>2020-10-02T16:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Endless loop when using SUBMIT with RM06EPS0 (ME49)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299137#M1990098</link>
      <description>&lt;P&gt;Instead of calling the report via submit (&lt;EM&gt;SUBMIT rm06eps0 AND RETURN.), you can also call it via transaction with USING bdc_tab option. This way, the variable &lt;/EM&gt;sy-binpt will be set to 'X' and the report should exit correctly without an endless loop. You dont need to fill the batch input table bdc_tab if you dont want to pass any variables to the programm.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;" SUBMIT rm06eps0 AND RETURN.  " replace this code

" with this one:
DATA bdc_tab TYPE TABLE OF bdcdata.
CALL TRANSACTION 'ME49' USING bdc_tab. 
" this way, the ABAP System Field Batch Input Processing Active (sy-binpt) is set to 'X'
" sy-binpt is used by the programme to check for an exit reason &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Oct 2020 04:46:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299137#M1990098</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-10-03T04:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Endless loop when using SUBMIT with RM06EPS0 (ME49)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299138#M1990099</link>
      <description>&lt;P&gt;I need the user to input data on the selection screen.&lt;/P&gt;&lt;P&gt;After i use this way will i be able to capture the ALV data and manipulate the data myself?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 05:16:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299138#M1990099</guid>
      <dc:creator>e4rthdog</dc:creator>
      <dc:date>2020-10-03T05:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Endless loop when using SUBMIT with RM06EPS0 (ME49)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299139#M1990100</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;e4rthdog&lt;/SPAN&gt;, if bdc_tab is empty, the two calls lead in general to the same result. &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The user will be presented the Selection Screen of report 'RM06EPS0'. &lt;/LI&gt;&lt;LI&gt;If both approaches truly behave the same way (except for the exit strategy out of the while loop) and whether you are able to successfully access data from class 'cl_salv_bs_runtime_info' depends on the logic of the report and the class. &lt;/LI&gt;&lt;LI&gt;Test it.&lt;/LI&gt;&lt;LI&gt;I merely gave a solution for being able to exit the while loop within report RM06EPS0.&lt;BR /&gt;As of now, I can not confirm whether your coding and approach will definitly meet all your requirements.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sat, 03 Oct 2020 05:28:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299139#M1990100</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-10-03T05:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Endless loop when using SUBMIT with RM06EPS0 (ME49)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299140#M1990101</link>
      <description>&lt;P&gt;My friend, i was so noob that i did not realize that i still could use the &lt;STRONG&gt;cl_salv_bs_runtime&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;It works like a charm! I got my data after the call.. Can you explain or direct me to some reading as to which mechanism is behind this and why memory data are still available for reading?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 05:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299140#M1990101</guid>
      <dc:creator>e4rthdog</dc:creator>
      <dc:date>2020-10-03T05:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Endless loop when using SUBMIT with RM06EPS0 (ME49)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299141#M1990102</link>
      <description>&lt;A href="https://answers.sap.com/users/283018/e4rthdog.html"&gt;Elias Stassinos&lt;/A&gt;, &lt;STRONG&gt;cl_salv_bs_runtime&lt;/STRONG&gt; is a class with static class methods and attributes that can be accessed publicly. As long as that class is in the sessions memory, you can access it, no matter what programm has called it within the session.</description>
      <pubDate>Sat, 03 Oct 2020 05:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299141#M1990102</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-10-03T05:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Endless loop when using SUBMIT with RM06EPS0 (ME49)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299142#M1990103</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/283018/e4rthdog.html"&gt;Elias Stassinos&lt;/A&gt; Both SUBMIT and CALL TRANSACTION run in a separate "Internal Session", so concerning the question, it's no surprise that CL_SALV_BS_RUNTIME works well with CALL TRANSACTION if it works well with SUBMIT. The ALV probably uses the so-called "ABAP memory" ({EXPORT ... TO | IMPORT ... FROM} MEMORY ID ...) which persists across Internal Sessions (in the same External Session). See ABAP documentation for more information.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 14:31:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-when-using-submit-with-rm06eps0-me49/m-p/12299142#M1990103</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-03T14:31:11Z</dc:date>
    </item>
  </channel>
</rss>

