<?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 button in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077014#M974833</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is how I added a button to my repport ....&lt;/P&gt;&lt;P&gt;&lt;/P&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_toolbar.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Part I: Define a menu button including a function code that&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        is evaluated in 'handle_MENU_BUTTON&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;append a separator to normal toolbar&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    clear gs_toolbar.&lt;/P&gt;&lt;P&gt;    move 3 to gs_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;    append gs_toolbar to e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;append a menut o switch between detail levels.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear gs_toolbar.&lt;/P&gt;&lt;P&gt;    move 'ATTENDANCE' to gs_toolbar-function.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; This function code is evaluated in 'handle_menu_button'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    move icon_detail to gs_toolbar-icon.&lt;/P&gt;&lt;P&gt;    move 'Switch to Table...'(101) to gs_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    move 2 to gs_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;    move space to gs_toolbar-disabled.&lt;/P&gt;&lt;P&gt;    append gs_toolbar to e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  method handle_menu_button.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Part II: Evaluate 'e_ucomm' to see which menu button of the toolbar&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         has been clicked on.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         Define then the corresponding menu.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         The menu contains function codes that are evaluated&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         in 'handle_user_command'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;handle own menubuttons&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if e_ucomm = 'ATTENDANCE'.&lt;/P&gt;&lt;P&gt;      call method e_object-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                  exporting fcode   = 'PSV1'&lt;/P&gt;&lt;P&gt;                            text    = text-100. "Overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jul 2008 07:14:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-09T07:14:26Z</dc:date>
    <item>
      <title>alv button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077012#M974831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i want to create a button that after the alv grid is display i will be able to push a botton that will show the option i filled in the selection screen &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in order to create the alv report i am using factory method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 06:51:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077012#M974831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T06:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: alv button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077013#M974832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ami,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add Button to ALV Toolbar with REUSE_ALV_LIST_DISPLAY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 &lt;DEL&gt;&amp;gt;Programming SubObjects&lt;/DEL&gt;&amp;gt; Gui Status. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --&amp;gt; Copy. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality such as sorting/subtotaling etc... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you call 'REUSE_ALV_GRID_DISPLAY' make sure you pass it the new status name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an example &lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_GRID_DISPLAY' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;i_callback_program = 'ZSDBOLST_REPORT' &lt;/P&gt;&lt;P&gt;i_callback_pf_status_set = 'STANDARD' &amp;lt;----&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;i_callback_user_command = 'USER_COMMAND' &lt;/P&gt;&lt;P&gt;i_structure_name = 'I_BOLACT' &lt;/P&gt;&lt;P&gt;i_grid_title = 'BOL Action Report'(031) &lt;/P&gt;&lt;P&gt;is_layout = gs_layout &lt;/P&gt;&lt;P&gt;it_fieldcat = gt_fieldcat[] &lt;/P&gt;&lt;P&gt;i_save = 'A' &lt;/P&gt;&lt;P&gt;is_variant = v_variant &lt;/P&gt;&lt;P&gt;TABLES &lt;/P&gt;&lt;P&gt;t_outtab = i_bolact &lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;program_error = 1 &lt;/P&gt;&lt;P&gt;others = 2. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As identified with the FM's help you can do the following. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1). Using SE80 (I think) you can copy a GUI status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ZSTANDARD'. &lt;/P&gt;&lt;P&gt;ENDFORM. "Set_pf_status &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above case the GUI status copied was named ZSTANDARD and adjusted accordingly, adding and removing the desired buttons. A button was added called '%DELETE'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3). Create the following report: &lt;/P&gt;&lt;P&gt;Code: &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="65" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form User_command &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Notes: Called by FM REUSE_ALV_GRID_DISPLAY &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Detects whether the icon/button for &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       'Return Tag Deletion' has been pressed. If it has then &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       detect whether any rows have been highlighted and then &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       set the delete flag. &lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;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t;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;FORM user_command USING r_ucomm     LIKE sy-ucomm &lt;/P&gt;&lt;P&gt;                        rs_selfield TYPE slis_selfield. &lt;/P&gt;&lt;P&gt;DATA: li_count TYPE I. &lt;/P&gt;&lt;P&gt;IF r_ucomm EQ '%DELETE'. &lt;/P&gt;&lt;P&gt;  LOOP AT %g00 WHERE mark EQ 'X'. &lt;/P&gt;&lt;P&gt;    ADD 1 TO li_count. &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;  IF li_count GT 0. &lt;/P&gt;&lt;P&gt;    gc_delete_flag = 'X'. &lt;/P&gt;&lt;P&gt;    r_ucomm = '&amp;amp;F03'. "Back arraow &lt;/P&gt;&lt;P&gt;  ELSE. &lt;/P&gt;&lt;P&gt;    MESSAGE W000 WITH 'Please highlight the rows to be deleted!'. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;ENDFORM.  "User_command &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I've added an extra button to indicate which records should be deleted I need to identify a form to be called to process when this button is chosen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then when you call the ALV function you to specify the following extra details: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code: &lt;/P&gt;&lt;P&gt;    call function 'REUSE_ALV_GRID_DISPLAY' &lt;/P&gt;&lt;P&gt;         exporting  i_callback_program = gc_repid &lt;/P&gt;&lt;P&gt;                    I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS' &lt;/P&gt;&lt;P&gt;                    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND' &lt;/P&gt;&lt;P&gt;                    i_grid_title       = lc_grid_title &lt;/P&gt;&lt;P&gt;                    is_layout          = lc_layout &lt;/P&gt;&lt;P&gt;                    it_fieldcat        = gt_fieldcat &lt;/P&gt;&lt;P&gt;                    it_sort            = sort &lt;/P&gt;&lt;P&gt;                    i_save             = l_save &lt;/P&gt;&lt;P&gt;                    is_reprep_id       = l_bbs_id &lt;/P&gt;&lt;P&gt;                    is_variant         = l_variant &lt;/P&gt;&lt;P&gt;         tables     t_outtab           = %g00 &lt;/P&gt;&lt;P&gt;         exceptions program_error      = 1 &lt;/P&gt;&lt;P&gt;                    others             = 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameters in capitals are the extra ones that need to be added. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;shankar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 06:55:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077013#M974832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T06:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: alv button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077014#M974833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is how I added a button to my repport ....&lt;/P&gt;&lt;P&gt;&lt;/P&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_toolbar.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Part I: Define a menu button including a function code that&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        is evaluated in 'handle_MENU_BUTTON&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;append a separator to normal toolbar&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    clear gs_toolbar.&lt;/P&gt;&lt;P&gt;    move 3 to gs_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;    append gs_toolbar to e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;append a menut o switch between detail levels.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear gs_toolbar.&lt;/P&gt;&lt;P&gt;    move 'ATTENDANCE' to gs_toolbar-function.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; This function code is evaluated in 'handle_menu_button'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    move icon_detail to gs_toolbar-icon.&lt;/P&gt;&lt;P&gt;    move 'Switch to Table...'(101) to gs_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    move 2 to gs_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;    move space to gs_toolbar-disabled.&lt;/P&gt;&lt;P&gt;    append gs_toolbar to e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  method handle_menu_button.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Part II: Evaluate 'e_ucomm' to see which menu button of the toolbar&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         has been clicked on.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         Define then the corresponding menu.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         The menu contains function codes that are evaluated&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         in 'handle_user_command'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;handle own menubuttons&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if e_ucomm = 'ATTENDANCE'.&lt;/P&gt;&lt;P&gt;      call method e_object-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                  exporting fcode   = 'PSV1'&lt;/P&gt;&lt;P&gt;                            text    = text-100. "Overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 07:14:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077014#M974833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T07:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: alv button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077015#M974834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hiiiii&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go throgh following link..it is  having step by step process for creating button on ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5468015"&gt;&lt;/A&gt;&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;twinkal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 07:18:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077015#M974834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T07:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: alv button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077016#M974835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Plz refer to this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://abapreports.blogspot.com/2008/06/push-button-on-alv-grid-output-sample.html]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have got sample code there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 07:33:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-button/m-p/4077016#M974835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T07:33:50Z</dc:date>
    </item>
  </channel>
</rss>

