<?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: adding push button which display hits in alv grid container in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371810#M182909</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;you need to have local event handler toolbar and user_command.&lt;/P&gt;&lt;P&gt;like below..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION for second screen
*---------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER1 DEFINITION .
  PUBLIC SECTION .
    METHODS:
**User Command Handler
    HANDLE_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
                                 IMPORTING E_UCOMM,

    HANDLE_TOOLBAR
        FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
            IMPORTING E_OBJECT E_INTERACTIVE.
ENDCLASS.                    "lcl_event_handler1 DEFINITION
*---------------------------------------------------------------------*
*       CLASS lcl_event_handler1 IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER1 IMPLEMENTATION.
*Handle User Command
  METHOD HANDLE_USER_COMMAND.
    &amp;lt;b&amp;gt;PERFORM EVENT_UCOMM1 USING E_UCOMM.&amp;lt;/b&amp;gt;
  ENDMETHOD.                    "user_command

  METHOD HANDLE_TOOLBAR.
    DATA: LS_TOOLBAR  TYPE STB_BUTTON.
* 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.
* append an icon to  save data
    CLEAR LS_TOOLBAR.
    MOVE 'SAVE' TO LS_TOOLBAR-FUNCTION.
    MOVE &amp;lt;b&amp;gt;ICON_SYSTEM_SAVE&amp;lt;/b&amp;gt; TO LS_TOOLBAR-ICON.
    MOVE 'Save' TO LS_TOOLBAR-QUICKINFO.
    MOVE ' Save  '  TO LS_TOOLBAR-TEXT.
    MOVE ' '  TO LS_TOOLBAR-DISABLED.
    APPEND LS_TOOLBAR TO E_OBJECT-&amp;gt;MT_TOOLBAR.
    CLEAR LS_TOOLBAR.
* 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.

  ENDMETHOD.                    "handle_toolbar
ENDCLASS.                    "lcl_event_handler1 IMPLEMENTATION


  CREATE OBJECT G_HANDLER.
&amp;lt;b&amp;gt;  SET HANDLER G_HANDLER-&amp;gt;HANDLE_USER_COMMAND FOR G_GRID.
  SET HANDLER G_HANDLER-&amp;gt;HANDLE_TOOLBAR FOR G_GRID.&amp;lt;/b&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;above code i am using the SAVE_ICON button. you can use your own icon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also in the perform you mentioned you have to handle the user command sy-ucomm and show the number of hits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jun 2006 14:22:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-07T14:22:48Z</dc:date>
    <item>
      <title>adding push button which display hits in alv grid container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371807#M182906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt; I am using alv grid container.I am calling my alv list on a subscreen area, i have created alv container for that, Now i have to add 1 push button (no finctionality required) which will display number of records in ALv list,that is same like CL30N transaction output in ALV grid, to see the output in alv grid  clicking on find in initial class application tool bar button.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 14:08:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371807#M182906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T14:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: adding push button which display hits in alv grid container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371808#M182907</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;refer &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1528213"&gt;&lt;/A&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1693806"&gt;&lt;/A&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 14:17:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371808#M182907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T14:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: adding push button which display hits in alv grid container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371809#M182908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Copy the standrad pf status and add an extra button in the new pf status.&lt;/P&gt;&lt;P&gt;2) pass this pf-status to the parameter.&lt;/P&gt;&lt;P&gt;I_CALLBACK_PF_STATUS_SET = '&amp;lt;Form name of the form which sets the pf status for your new-pfstatus&amp;gt;'&lt;/P&gt;&lt;P&gt;3) IN the user command, handle what should happen when you click that button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case sy-ucomm.&lt;/P&gt;&lt;P&gt;when '&amp;lt;FCODE for button&amp;gt;'.&lt;/P&gt;&lt;P&gt;describe table itab lines v_lines.&lt;/P&gt;&lt;P&gt;concatenate 'No of records in itab' v_lines into v_text separated by space.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        titel = 'Record Count'&lt;/P&gt;&lt;P&gt;        txt1  = v_text&lt;/P&gt;&lt;P&gt;        txt2  = ' '&lt;/P&gt;&lt;P&gt;        txt3  = ' '&lt;/P&gt;&lt;P&gt;        txt4  = ' '.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 14:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371809#M182908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T14:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: adding push button which display hits in alv grid container</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371810#M182909</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;you need to have local event handler toolbar and user_command.&lt;/P&gt;&lt;P&gt;like below..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION for second screen
*---------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER1 DEFINITION .
  PUBLIC SECTION .
    METHODS:
**User Command Handler
    HANDLE_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
                                 IMPORTING E_UCOMM,

    HANDLE_TOOLBAR
        FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
            IMPORTING E_OBJECT E_INTERACTIVE.
ENDCLASS.                    "lcl_event_handler1 DEFINITION
*---------------------------------------------------------------------*
*       CLASS lcl_event_handler1 IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER1 IMPLEMENTATION.
*Handle User Command
  METHOD HANDLE_USER_COMMAND.
    &amp;lt;b&amp;gt;PERFORM EVENT_UCOMM1 USING E_UCOMM.&amp;lt;/b&amp;gt;
  ENDMETHOD.                    "user_command

  METHOD HANDLE_TOOLBAR.
    DATA: LS_TOOLBAR  TYPE STB_BUTTON.
* 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.
* append an icon to  save data
    CLEAR LS_TOOLBAR.
    MOVE 'SAVE' TO LS_TOOLBAR-FUNCTION.
    MOVE &amp;lt;b&amp;gt;ICON_SYSTEM_SAVE&amp;lt;/b&amp;gt; TO LS_TOOLBAR-ICON.
    MOVE 'Save' TO LS_TOOLBAR-QUICKINFO.
    MOVE ' Save  '  TO LS_TOOLBAR-TEXT.
    MOVE ' '  TO LS_TOOLBAR-DISABLED.
    APPEND LS_TOOLBAR TO E_OBJECT-&amp;gt;MT_TOOLBAR.
    CLEAR LS_TOOLBAR.
* 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.

  ENDMETHOD.                    "handle_toolbar
ENDCLASS.                    "lcl_event_handler1 IMPLEMENTATION


  CREATE OBJECT G_HANDLER.
&amp;lt;b&amp;gt;  SET HANDLER G_HANDLER-&amp;gt;HANDLE_USER_COMMAND FOR G_GRID.
  SET HANDLER G_HANDLER-&amp;gt;HANDLE_TOOLBAR FOR G_GRID.&amp;lt;/b&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;above code i am using the SAVE_ICON button. you can use your own icon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also in the perform you mentioned you have to handle the user command sy-ucomm and show the number of hits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 14:22:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-push-button-which-display-hits-in-alv-grid-container/m-p/1371810#M182909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T14:22:48Z</dc:date>
    </item>
  </channel>
</rss>

