<?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: Get selected rows using ALV - CL_SALV classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044452#M1899502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the method where you handle the event you need to use cl_salv_selections to see which rows are selected. then you perform the action only for these rows, by reading your internal table with the indexes in the selection.&amp;nbsp; something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lo_selections &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;cl_salv_selections&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; data lt_rows&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;salv_t_row.&lt;/P&gt;&lt;P&gt;data ls_row type 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; lo_selections &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_alv&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;get_selections&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; lt_rows &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_selections&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;get_selected_rows&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at lt_rows into ls_row.&lt;/P&gt;&lt;P&gt;read table lt_alv_table_data index ls_row.&lt;/P&gt;&lt;P&gt;* do the action&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also have a look at program SALV_TEST_TABLE_SELECTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Custodio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Apr 2015 23:09:48 GMT</pubDate>
    <dc:creator>custodio_deoliveira</dc:creator>
    <dc:date>2015-04-01T23:09:48Z</dc:date>
    <item>
      <title>Get selected rows using ALV - CL_SALV classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044451#M1899501</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;Please, need some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my ALV report - Using CL_SALV classes, how can I process multiple lines?&lt;/P&gt;&lt;P&gt;For example: I've set to display "select all button".&lt;/P&gt;&lt;P&gt;Need select a few lines, in this case, has been selected 2 rows and executed a call transaction using two rows. But there's something else to do, 'cause all rows in ALV report executed the Call Transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just found the following:&lt;/P&gt;&lt;P&gt;layout-box_fname = "field name".&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;layout-sel_mode&amp;nbsp;&amp;nbsp; = 'A'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;But to use in CL_GUI_ALV_GRID, I DO NOT want to change it right now, 'cause the ALV report is almost done.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;What's the corresponding for 'BOX_FNAME' and 'SEL_MODE' of CL_GUI_ALV_GRID inside CL_SALV classes?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thanks and Regards.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 19:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044451#M1899501</guid>
      <dc:creator>bruno_franzini1</dc:creator>
      <dc:date>2015-04-01T19:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get selected rows using ALV - CL_SALV classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044452#M1899502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the method where you handle the event you need to use cl_salv_selections to see which rows are selected. then you perform the action only for these rows, by reading your internal table with the indexes in the selection.&amp;nbsp; something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lo_selections &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;cl_salv_selections&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; data lt_rows&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;salv_t_row.&lt;/P&gt;&lt;P&gt;data ls_row type 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; lo_selections &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_alv&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;get_selections&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; lt_rows &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lo_selections&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;get_selected_rows&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at lt_rows into ls_row.&lt;/P&gt;&lt;P&gt;read table lt_alv_table_data index ls_row.&lt;/P&gt;&lt;P&gt;* do the action&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also have a look at program SALV_TEST_TABLE_SELECTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Custodio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 23:09:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044452#M1899502</guid>
      <dc:creator>custodio_deoliveira</dc:creator>
      <dc:date>2015-04-01T23:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get selected rows using ALV - CL_SALV classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044453#M1899503</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;Custodio, thanks for reply.&lt;/P&gt;&lt;P&gt;Worked fine, exactly what I needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;DATA&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lt_rows &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;salv_t_row&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_rows &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; lt_rows &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;o_selections&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;get_selected_rows&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;lt_rows &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;ls_rows&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;READ &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;it_outtab &lt;SPAN class="L0S52"&gt;ASSIGNING &lt;/SPAN&gt;&amp;lt;fs_outtab&amp;gt; &lt;SPAN class="L0S52"&gt;INDEX &lt;/SPAN&gt;ls_rows&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Thanks a lot.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 23:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044453#M1899503</guid>
      <dc:creator>bruno_franzini1</dc:creator>
      <dc:date>2015-04-01T23:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get selected rows using ALV - CL_SALV classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044454#M1899504</link>
      <description>&lt;P&gt;For future visitors, concerning the other part of the question: "What's the corresponding for '&lt;STRONG&gt;BOX_FNAME&lt;/STRONG&gt;' of CL_GUI_ALV_GRID inside CL_SALV classes?&lt;/P&gt;&lt;P&gt;(which corresponds to adding a selection column at the left of rows, it's like a selection button in front of each row)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Answer: this feature is not enabled with SALV; but the rows can be still selected by clicking any of their cells&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NB: the default selection mode is NONE (which in fact acts like SINGLE - select one row only (!?)) and can be changed to other modes like multiple rows by calling:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lo_selections-&amp;gt;SET_SELECTION_MODE( IF_SALV_C_SELECTION_MODE=&amp;gt;MULTIPLE ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Feb 2020 11:10:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044454#M1899504</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-02-17T11:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get selected rows using ALV - CL_SALV classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044455#M1899505</link>
      <description>&lt;P&gt;This was helpful , Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 08:04:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044455#M1899505</guid>
      <dc:creator>former_member717586</dc:creator>
      <dc:date>2021-02-26T08:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get selected rows using ALV - CL_SALV classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044456#M1899506</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;zebashah22&lt;/SPAN&gt; Thanks. Please use the vote button in the side bar to "like" or "dislike" &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 08:51:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044456#M1899506</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-02-26T08:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Get selected rows using ALV - CL_SALV classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044457#M1899507</link>
      <description>&lt;P&gt;Thank you so much Sandra Rossi, it was very much helpful.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 07:14:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-selected-rows-using-alv-cl-salv-classes/m-p/11044457#M1899507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-05-20T07:14:50Z</dc:date>
    </item>
  </channel>
</rss>

