<?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 Push Button in ALV grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361013#M1400438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to generate an ALV (grid) report in which I need to create a push button on the tool bar. When I click on this Push button some action needs to be triggered. Any body please tell me how to create the button and also how to cpture the event while clicking on the button. I am not using OOPs concept in my report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Neethu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Nov 2009 08:57:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-30T08:57:27Z</dc:date>
    <item>
      <title>Push Button in ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361013#M1400438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to generate an ALV (grid) report in which I need to create a push button on the tool bar. When I click on this Push button some action needs to be triggered. Any body please tell me how to create the button and also how to cpture the event while clicking on the button. I am not using OOPs concept in my report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Neethu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 08:57:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361013#M1400438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-30T08:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Push Button in ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361014#M1400439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neethu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this requirement, you have to copy the standard PF status of the ALV output. Do as below :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Go to &lt;STRONG&gt;SE41&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2) Enter the program name as &lt;STRONG&gt;SAPLKKBL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3) In the field status enter &lt;STRONG&gt;STANDARD_FULLSCREEN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;4) Click on &lt;STRONG&gt;STATUS&lt;/STRONG&gt; button on the application toolbar.&lt;/P&gt;&lt;P&gt;5) Enter the name of your  Program &amp;amp; a new status name.&lt;/P&gt;&lt;P&gt;6) Click on &lt;STRONG&gt;COPY&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way the standard status will be copied to the custom status &amp;amp; call the same status in your program using &lt;STRONG&gt;SET PF STATUS&lt;/STRONG&gt; statement. Then double click on the custom status name &amp;amp; you will be navigated to SE41, there you can add you new button on the application tool bar &amp;amp; assign a function code, which you can program by enabling the export parameter &lt;STRONG&gt;I_CALLBACK_USER_COMMAND&lt;/STRONG&gt; of the Function module &lt;STRONG&gt;REUSE_ALV_GRID_DISPLAY&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a sample code snippet for your reference :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM
LS_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN 'your function code goes here'.
Do further processing.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you will have the standard PF status alongwith your button as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Abhii&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Abhii on Nov 30, 2009 10:12 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 09:11:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361014#M1400439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-30T09:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Push Button in ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361015#M1400440</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;One of the way would be to goto to SE80 and open the program : "BCALV_TEST_GRID_LAYOUT"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The copy the GUI Status "STANDARD" to ZSTANDARD and the target program will be your Z Report Program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now open your progeam in SE80 and and in the application tool bar, remove any unwanted button and add your own button there.&lt;/P&gt;&lt;P&gt;This will get a button on the screen along with all other standard tool bar options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The action could be trapped on Sy-UCOMM case in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 09:16:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361015#M1400440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-30T09:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Push Button in ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361016#M1400441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add a push button use following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add push button in the tool bar&lt;/P&gt;&lt;P&gt;Trigger subroutine when push button is clicked&lt;/P&gt;&lt;P&gt;execute the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

CLASS cl_event_receiver 
DEFINITION.
PUBLIC SECTION.   
DATA: ucomm TYPE sy-ucomm.
*   toolbar
METHODS handle_toolbar_set     
FOR EVENT toolbar OF cl_gui_alv_grid     
IMPORTING e_object e_interactive.

*   user command
METHODS handle_user_command     
FOR EVENT user_command OF cl_gui_alv_grid     
IMPORTING e_ucomm.

CLASS cl_event_receiver IMPLEMENTATION.
METHOD handle_user_command.   
CASE e_ucomm.    
WHEN text-022.       

PERFORM upload_id.     
WHEN OTHERS.   ENDCASE. 
ENDMETHOD.    
METHOD handle_toolbar_set.
* append a separator to normal toolbar   
CLEAR ls_toolbar.   
MOVE 3 TO ls_toolbar-butn_type.   
APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.
CLEAR ls_toolbar.   
MOVE :text-033 TO ls_toolbar-function,
*" function code of the push button         
text-033 TO ls_toolbar-text.
*"text that will be displayed on the push button   
APPEND ls_toolbar    TO e_object-&amp;gt;mt_toolbar.
ENDMETHOD.ENDCLASS.
*set even handlers
SET HANDLER event_receiver1-&amp;gt;handle_toolbar_set  FOR g_grid1. 
SET HANDLER event_receiver1-&amp;gt;handle_user_command FOR g_grid1.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 10:08:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/push-button-in-alv-grid/m-p/6361016#M1400441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-30T10:08:11Z</dc:date>
    </item>
  </channel>
</rss>

