<?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 Retrieve Data from ALV without using GET_SELECTED_ROWS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820449#M1588943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ABAPers!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all let me tell you that I'm working in ACCENTURE Casablanca(Morocco) and this is my first Job in my career.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on an ALV OO, the program concists on creating an ALV using OO, In my selection screen there's a parameter of type &lt;STRONG&gt;DBFIELD&lt;/STRONG&gt;  I provide the name of table and it returns the table's fields in another dynpro (screen0100), To do this I used the FM:  &lt;STRONG&gt;'DB_GET_TABLE_FIELDS'&lt;/STRONG&gt;  then I append the internal table returned in another one to add the field CB (CheckBox), and I add a button in the toolbar,  the function of this button is to generate a MySQL script To create the table provided by the user in my parameter (Screen 1000), but the fields of this table in the generated script are only the selected ones by cheking the checkbox in the ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first I used the method  &lt;STRONG&gt;GET_SELECTED_ROWS&lt;/STRONG&gt; and the sel_mode = 'C' in the layout structure but it doesn't returns any thing in the lvc_t_rowid table, moreover my boss refused that I used this method and he adviced me to use the event button_click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So could any one help me with some piece of code?!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SMAALI Achraf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 May 2011 09:11:33 GMT</pubDate>
    <dc:creator>achraf_smaali</dc:creator>
    <dc:date>2011-05-05T09:11:33Z</dc:date>
    <item>
      <title>Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820449#M1588943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ABAPers!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all let me tell you that I'm working in ACCENTURE Casablanca(Morocco) and this is my first Job in my career.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on an ALV OO, the program concists on creating an ALV using OO, In my selection screen there's a parameter of type &lt;STRONG&gt;DBFIELD&lt;/STRONG&gt;  I provide the name of table and it returns the table's fields in another dynpro (screen0100), To do this I used the FM:  &lt;STRONG&gt;'DB_GET_TABLE_FIELDS'&lt;/STRONG&gt;  then I append the internal table returned in another one to add the field CB (CheckBox), and I add a button in the toolbar,  the function of this button is to generate a MySQL script To create the table provided by the user in my parameter (Screen 1000), but the fields of this table in the generated script are only the selected ones by cheking the checkbox in the ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first I used the method  &lt;STRONG&gt;GET_SELECTED_ROWS&lt;/STRONG&gt; and the sel_mode = 'C' in the layout structure but it doesn't returns any thing in the lvc_t_rowid table, moreover my boss refused that I used this method and he adviced me to use the event button_click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So could any one help me with some piece of code?!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SMAALI Achraf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 09:11:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820449#M1588943</guid>
      <dc:creator>achraf_smaali</dc:creator>
      <dc:date>2011-05-05T09:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820450#M1588944</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;Check &lt;STRONG&gt;BCALV_GRID_05&lt;/STRONG&gt;  report., &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will help u.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 09:28:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820450#M1588944</guid>
      <dc:creator>Kiran_Valluru</dc:creator>
      <dc:date>2011-05-05T09:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820451#M1588945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to implement event handler for capturing rowid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 09:36:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820451#M1588945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-05T09:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820452#M1588946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kiran kumar Reddy,&lt;/P&gt;&lt;P&gt;In executed the program you provided but in the ALV returned there isn't any field as a checkbox, and my problem is how to link the chek of checkbox and the evnt button_click&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 09:39:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820452#M1588946</guid>
      <dc:creator>achraf_smaali</dc:creator>
      <dc:date>2011-05-05T09:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820453#M1588947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks brother AbdoALLAH,&lt;/P&gt;&lt;P&gt;Of course I did and this is the code : &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;  Include           ZCLTABLES_METADATA_OO
*&amp;amp;---------------------------------------------------------------------*
CONSTANTS c_10_ic  TYPE iconname  VALUE '@0Q@'.
DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid .
DATA: gt_list type standard table of dbfield WITH HEADER LINE,
      wa_list TYPE dbfield.
DATA gt_listalv TYPE STANDARD TABLE OF zstr_dbfcb WITH HEADER LINE.



**************************Classes
CLASS lcl_event_receiver DEFINITION.

  PUBLIC SECTION.
    METHODS :
*To add new functional buttons to the ALV toolbar
       handle_toolbar
       FOR EVENT toolbar OF cl_gui_alv_grid
                         IMPORTING e_object,
*To implement user commands
       handle_user_command
       FOR EVENT user_command OF cl_gui_alv_grid
                         IMPORTING e_ucomm,
*To control menu buttons
       handle_menu_button
       FOR EVENT menu_button OF cl_gui_alv_grid
                         IMPORTING e_object e_ucomm .
  PRIVATE SECTION.

ENDCLASS.               "LCL_EVENT_RECEIVER
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;       Class (Implementation)  LCL_EVENT_RECEIVER
*&amp;amp;---------------------------------------------------------------------*
*        Implémentation de la méthode
*----------------------------------------------------------------------*
CLASS lcl_event_receiver IMPLEMENTATION.
  METHOD handle_toolbar.
    DATA ls_toolbar TYPE stb_button.
    MOVE 3 TO ls_toolbar-butn_type.
    INSERT ls_toolbar INTO e_object-&amp;gt;mt_toolbar INDEX 25.
    CLEAR ls_toolbar.
    ls_toolbar-function  = 'SCR'.
    ls_toolbar-icon      = c_10_ic.
    ls_toolbar-quickinfo = text-013.
    ls_toolbar-butn_type = 0.
    ls_toolbar-checked   = space.
    INSERT ls_toolbar INTO e_object-&amp;gt;mt_toolbar INDEX 26.
    CLEAR ls_toolbar.

  ENDMETHOD.                    "handle_toolbar
*Handle User Command
  METHOD handle_user_command.
    DATA ls_selected_row TYPE lvc_s_roid .
    Data : l_valid type c,
           ls_listalv type ZSTR_DBFCB,
           lt_selected_rows type lvc_t_roid.
    call method gr_alvgrid-&amp;gt;check_changed_data
          importing
            e_valid = l_valid.
    if l_valid = 'X'.
      call method gr_alvgrid-&amp;gt;get_selected_rows
          importing
            et_row_no = lt_selected_rows[].
      loop at lt_selected_rows into ls_selected_row.
        read table gt_listalv into ls_listalv
              index ls_selected_row-row_id.
***********************************
              ls_listalv-cb = 'X'.
              MESSAGE text-014 TYPE 'S' DISPLAY LIKE 'E'.
***********************************
        modify gt_listalv from ls_listalv index ls_selected_row-row_id.
      endloop.
      call method gr_alvgrid-&amp;gt;refresh_table_display.
    endif.
  ENDMETHOD.                    "handle_user_command
*Handle Menu Buttons
  METHOD handle_menu_button .
    CASE e_ucomm .
      WHEN 'SCR' .
        CALL METHOD e_object-&amp;gt;add_function
          EXPORTING
            fcode = 'SCR'
            text  = 'Script'.
    ENDCASE .
  ENDMETHOD .                    "handle_menu_button

ENDCLASS. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 09:41:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820453#M1588947</guid>
      <dc:creator>achraf_smaali</dc:creator>
      <dc:date>2011-05-05T09:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820454#M1588948</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;In field catalog U add one more field Check and make it as Check box., so in ur ALV out put u will get one more column with all check boxes., and select the check box for which records u want., then when u press button ., loop the internal table and check whether the check box is selected or not., if selected append those records..!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps u.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 09:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820454#M1588948</guid>
      <dc:creator>Kiran_Valluru</dc:creator>
      <dc:date>2011-05-05T09:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820455#M1588949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kiran kumar Reddy for your time,&lt;/P&gt;&lt;P&gt;The fieldcatalog u adviced me to add is the first step I did when I start building my program, But when I want to press the button after checking the checkbox field, my program dumped which due to the incompatibility between the table returned by the FM &lt;STRONG&gt;'DB_GET_TABLE_FIELDS'&lt;/STRONG&gt; and the fieldcatalog because of the added field 'Check'. that's why I've created another internal table which includes the structure DBFIELD and another field called 'CB' to be handled as a chekbox and this is the it which I provide as it_outtab to my CL_GUI_ALVGRID.&lt;/P&gt;&lt;P&gt;But as you told there is another way which I'll try is to loop at the internal table and I'll check if the CB field = 'X' then I append this line to another it which I'll base on to generate my script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 10:13:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820455#M1588949</guid>
      <dc:creator>achraf_smaali</dc:creator>
      <dc:date>2011-05-05T10:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820456#M1588950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much kiran kumar Reddy!!&lt;/P&gt;&lt;P&gt;I try it and it works fine with me, one little thing pllllz, the Internal table which I filled to generate my script it is appended after I push the button in the toolbar but I want to fill it while I'm checking my chekboxes plz tell me which event should I use? I don't really know what to do?!! &lt;SUP&gt;__&lt;/SUP&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 10:47:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820456#M1588950</guid>
      <dc:creator>achraf_smaali</dc:creator>
      <dc:date>2011-05-05T10:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820457#M1588951</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 dont think it is possible..!! if it is Web Dynpro., there are events like onSelect., but here., on double click we can do., but we are jus selecting check box., try to put &lt;STRONG&gt;hotspot&lt;/STRONG&gt; for that column.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n my suggestion is once selecting all records  and pressing button is gud option., bcoz when u use hotspot also u need to check whether it is checked or not instead of blindly appending..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps u.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 15:23:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820457#M1588951</guid>
      <dc:creator>Kiran_Valluru</dc:creator>
      <dc:date>2011-05-05T15:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Data from ALV without using GET_SELECTED_ROWS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820458#M1588952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved, Assigning points is disactivated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 May 2011 07:54:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-alv-without-using-get-selected-rows/m-p/7820458#M1588952</guid>
      <dc:creator>achraf_smaali</dc:creator>
      <dc:date>2011-05-06T07:54:43Z</dc:date>
    </item>
  </channel>
</rss>

