<?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: ALV Grid Get Rows Selected. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465591#M832943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Venkat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have defined the appropriate &lt;STRONG&gt;SEL_MODE&lt;/STRONG&gt; (LVC_S_LAYO) in the layout an additional "column" is displayed on the left border of the ALV grid to select rows.&lt;/P&gt;&lt;P&gt;The selected rows can be simply retrieved using method &lt;STRONG&gt;go_grid-&amp;gt;get_selected_rows( )&lt;/STRONG&gt; (at PAI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not allow selection of multiple rows (like in the IDoc Monitor, WE02) but want to handle selection of a single row you may use event &lt;STRONG&gt;DELAYED_CHANGED_SEL_CALLBACK&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Mar 2008 10:08:19 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-03-06T10:08:19Z</dc:date>
    <item>
      <title>ALV Grid Get Rows Selected.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465589#M832941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;I have completed an ALV Grid output which is basically an editable table. &lt;/P&gt;&lt;P&gt;Is there any Event which is triggered after selecting a row or any Event to find the no. of rows selected in the ALV output? (Couldnt find it in cl_gui_alv_grid class? )&lt;/P&gt;&lt;P&gt;Appreciate any inputs..&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 07:53:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465589#M832941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T07:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Get Rows Selected.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465590#M832942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venkat ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever a row is selected in the ALV screen, It is saved in the Final table that is used for the display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can use the Event " handle_data_changed " to capture it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Event Handler Declarations&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS lcl_event_receiver DEFINITION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;                          IMPORTING er_data_changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_receiver DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS LCL_EVENT_RECEIVER IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_data_changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM handle_data_changed USING er_data_changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_data_changed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM handle_data_changed  USING ir_data_changed&lt;/P&gt;&lt;P&gt;                             TYPE REF TO cl_alv_changed_data_protocol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: lwa_mod_cell TYPE lvc_s_modi,&lt;/P&gt;&lt;P&gt;          lwa_row_no TYPE lvc_s_roid,&lt;/P&gt;&lt;P&gt;          lwa_column_id TYPE lvc_s_col.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT ir_data_changed-&amp;gt;mt_mod_cells&lt;/P&gt;&lt;P&gt;                       INTO lwa_mod_cell.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   clear : ws_set.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CASE lwa_mod_cell-fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN c_select. ( selected row)&lt;/P&gt;&lt;P&gt;        READ TABLE i_final INTO wa_final&lt;/P&gt;&lt;P&gt;                             INDEX lwa_mod_cell-row_id.&lt;/P&gt;&lt;P&gt;        IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          CLEAR : ws_set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          wa_final-status = lwa_mod_cell-value.&lt;/P&gt;&lt;P&gt;          MODIFY i_final FROM wa_final&lt;/P&gt;&lt;P&gt;                               INDEX lwa_mod_cell-row_id&lt;/P&gt;&lt;P&gt;                               TRANSPORTING status .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " handle_data_changed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chitra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465590#M832942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T08:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Get Rows Selected.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465591#M832943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Venkat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have defined the appropriate &lt;STRONG&gt;SEL_MODE&lt;/STRONG&gt; (LVC_S_LAYO) in the layout an additional "column" is displayed on the left border of the ALV grid to select rows.&lt;/P&gt;&lt;P&gt;The selected rows can be simply retrieved using method &lt;STRONG&gt;go_grid-&amp;gt;get_selected_rows( )&lt;/STRONG&gt; (at PAI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not allow selection of multiple rows (like in the IDoc Monitor, WE02) but want to handle selection of a single row you may use event &lt;STRONG&gt;DELAYED_CHANGED_SEL_CALLBACK&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 10:08:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465591#M832943</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-03-06T10:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Get Rows Selected.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465592#M832944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Call the method &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; get_selected_rows &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;. this method will return all the row ids of the rows selected by the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 12:32:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465592#M832944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T12:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Get Rows Selected.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465593#M832945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is only HALF the answer as you need to respond to some event before you can get the selected cells.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you really need to do when selecting rows is to select the rows in the grid normally  and then have a toolbar function such as PROCESS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the ON USER COMMAND you can check for PROCESS - then get the selected rows and do whatever processing you require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The on data changed / on data changed finished  events are actually only entered if you CHANGE data in the grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can post sample code later if you need it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 22:00:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465593#M832945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T22:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Get Rows Selected.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465594#M832946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chitra,&lt;/P&gt;&lt;P&gt;Thanks a lot for your reply, tried the Event - this one and also handle_data_change_finished, i selected the rows and then doubleclicking them, which triggered the event handler method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, James, it was very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just have a further question to all, if we have a requirement to enable or disable the toolbar on selection of rows , just single click, would that be possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks All! I was just looking for some sort of event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2008 05:57:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-get-rows-selected/m-p/3465594#M832946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-07T05:57:47Z</dc:date>
    </item>
  </channel>
</rss>

