<?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: Retrieving ALV grid from Submit statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377858#M1642580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't believe this actually worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You rock!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2011 13:58:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-17T13:58:40Z</dc:date>
    <item>
      <title>Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377855#M1642577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a SUBMIT statement in my code that, when executed, results in data in an ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to modify the layout.  How do I obtain this ALV grid object (the result of the SUBMIT statement) using the ALV OO model?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that I can't use a layout in the SUBMIT statement to modify the columns in the results because the layout could potentially be modified by end users.  If it's possible to create a layout that cannot be modified, that would also solve the problem.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program is the standard SAP program RFFMEPGAX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 21:16:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377855#M1642577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-16T21:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377856#M1642578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may check this blog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Gain Programmatic Access to Data of SAPGUI ALV Reports|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/24944] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like you can set the meta data before hand by calling the method CL_SALV_BS_RUNTIME_INFO=&amp;gt;SET_METADATA( ), however, you have to borrow the meta data building logic from the submitted program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 01:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377856#M1642578</guid>
      <dc:creator>rajesh_paruchuru</dc:creator>
      <dc:date>2011-11-17T01:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377857#M1642579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi  ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES  : BEGIN OF w_tab .

 include STRUCTURE rkpos . " You need to add structure as per your reqirment  .

types:    END OF w_tab .


DATA: text       TYPE c LENGTH 10,
     lt_selscreen  TYPE TABLE OF rsparams WITH HEADER LINE .

DATA it_tab TYPE   STANDARD TABLE OF w_tab WITH HEADER LINE.


FIELD-SYMBOLS  : &amp;lt;lt_pay_data&amp;gt;   TYPE ANY TABLE .
FIELD-SYMBOLS : &amp;lt;LT_TEST&amp;gt; TYPE ANY . "LIKE LINE OF  it_tab .

DATA lr_pay_data              TYPE REF TO data.
cl_salv_bs_runtime_info=&amp;gt;set(    EXPORTING display  = abap_false
                                           metadata = abap_false
                                           data     = abap_true ).

SUBMIT RFFMEPGAX WITH SELECTION-TABLE lt_selscreen
 WITH s_bukrs-low = 'BFL'
*WITH kstgr = '1001'
*WITH p_disvar = '//COST'
*WITH p_tcode = 'KSB1'
AND RETURN.

TRY.

    cl_salv_bs_runtime_info=&amp;gt;get_data_ref(        IMPORTING r_data = lr_pay_data ).
    ASSIGN lr_pay_data-&amp;gt;* TO &amp;lt;lt_pay_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( ).

LOOP AT &amp;lt;lt_pay_data&amp;gt; ASSIGNING  &amp;lt;LT_TEST&amp;gt;.

  MOVE-CORRESPONDING  &amp;lt;LT_TEST&amp;gt; TO it_tab  .

  APPEND IT_TAB .

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 03:54:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377857#M1642579</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2011-11-17T03:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377858#M1642580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't believe this actually worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You rock!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 13:58:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377858#M1642580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-17T13:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377859#M1642581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't believe this actually worked.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; You rock!&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Word of caution : If you employ the code posted above, you may run the risk of loosing all the interactive options provided as part of the original ALV in the submitted program through the 'USER_COMMAND' event and I also see considerable logic in building the meta data in the END-OF-SELECTION event of the program you may miss that part too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I were you, I would attempt to replicate the meta buidling logic(field catalog, layout, sort, events) from the submitted program&lt;/P&gt;&lt;P&gt;modify the meta to suit my own requirements in the Z* program, set the meta data before displaying the ALV by exploring the set_meta_data() method and SUBMIT the standard program without RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 16:59:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377859#M1642581</guid>
      <dc:creator>rajesh_paruchuru</dc:creator>
      <dc:date>2011-11-17T16:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377860#M1642582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;clay995,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If all you really want to do is limit the fields that are in the alv and perhaps change the order of the fields, you could create a global display variant, making it the default.  Then every time the the alv is created, the default layout would be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 00:00:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377860#M1642582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-18T00:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377861#M1642583</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;deepak.dhamat&lt;/SPAN&gt; Thank you so much for this snippet. You saved our project!!!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 15:12:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377861#M1642583</guid>
      <dc:creator>former_member150823</dc:creator>
      <dc:date>2021-07-12T15:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving ALV grid from Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377862#M1642584</link>
      <description>&lt;P&gt;This piece of code is awesome!!!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 09:28:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieving-alv-grid-from-submit-statement/m-p/8377862#M1642584</guid>
      <dc:creator>former_member211778</dc:creator>
      <dc:date>2022-03-07T09:28:52Z</dc:date>
    </item>
  </channel>
</rss>

