<?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 button on ALV Grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008607#M1165946</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what my requirement is creating button on ALV grid only.... let me explain briefly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a  general material master details on my grid what my requirement is  i place a cursor on any material detail and  i click button   ( i want this how to create a button on alv grid) on alv grid . the details of the clicked material document details to be  shown...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls help me  friends.. &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;Regards &lt;/P&gt;&lt;P&gt;kiran kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2009 13:08:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-16T13:08:03Z</dc:date>
    <item>
      <title>button on ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008607#M1165946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what my requirement is creating button on ALV grid only.... let me explain briefly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a  general material master details on my grid what my requirement is  i place a cursor on any material detail and  i click button   ( i want this how to create a button on alv grid) on alv grid . the details of the clicked material document details to be  shown...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls help me  friends.. &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;Regards &lt;/P&gt;&lt;P&gt;kiran kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 13:08:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008607#M1165946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T13:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: button on ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008608#M1165947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have look at sample report BCALV_GRID_05.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 13:14:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008608#M1165947</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-01-16T13:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: button on ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008609#M1165948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer to the program &lt;STRONG&gt;BCALV_GRID_05&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shows how to add buttons to the toolbar and handle all the events.&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;Jinson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 13:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008609#M1165948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T13:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: button on ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008610#M1165949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Refer to program "SALV_DEMO_TABLE_COLUMNS&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="1232764"&gt;&lt;/A&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="1072082"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Pravin S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 13:18:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008610#M1165949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T13:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: button on ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008611#M1165950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;METHODS:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;toolbar event for handling repricing and reassigning of values&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    handle_toolbar&lt;/P&gt;&lt;P&gt;        FOR EVENT toolbar OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;            IMPORTING e_object,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by using this here we can create buttons on grid display &lt;/P&gt;&lt;P&gt;if we use pf-status buttons will be created in application tool bar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 13:41:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008611#M1165950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T13:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: button on ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008612#M1165951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can get the solution by doing the following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This internal has data and will be passed to the ALV function module later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:BEGIN OF tbl_output OCCURS 0,  
      check TYPE charx,            "-----------CHECK BOX APPEARENCE-----
      vbeln LIKE vbak-vbeln,        "Sales Doc
      posnr LIKE vbap-posnr,        "Item-sales Doc
      omeng LIKE vbbe-omeng,        "Open qty
      color_line(04) TYPE c,
   END OF tbl_output.
*---------------------------------------------------------------------*
CONSTANTS:    c_standard(20) TYPE c             VALUE 'STANDARD',
                        c_user_command TYPE slis_formname VALUE  'USER_COMMAND',
                        c_pfstatus     TYPE slis_formname VALUE 'PF_STATUS_SET',
                        c_bcgrd        LIKE bapibds01-objkey VALUE 'ALV_BACKGROUND'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Start-of-selection.
Perform get_data.  " fetch data from datbase depending on the selection screen params
Perform begin_alv_process.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
FORM begin_alv_prcoess.
  gv_repid =  sy-repid.
* initialize layout
  PERFORM initialize_layout USING gs_layout.
* Subroutine to build events
  PERFORM f_build_events.
* fill fields to be output
  PERFORM fill_field_catalog.
* call ALV function module
  PERFORM alv_grid_display.
ENDFORM.                    " begin_Alv_prcoess }
*&amp;amp;---------------------------------------------------------------------*&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM initialize_layout USING rs_layout TYPE slis_layout_alv.
  rs_layout-zebra        = c_x.         "Striped Pattern
  rs_layout-no_keyfix    = c_x.         "Fix Key columns
  rs_layout-max_linesize = 855.
* Name of the field with color
  rs_layout-info_fieldname = 'COLOR_LINE'.
ENDFORM.                    " initialize_layout
*&amp;amp;---------------------------------------------------------------------*&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM fill_field_catalog.
  PERFORM build_catalog USING:
   'CHECK'   'TBL_OUTPUT'     'CHECK'     'TBL_OUTPUT'  'X'   ' ',
   'VBELN'   'TBL_OUTPUT'      'VBELN'      'TBL_OUTPUT'         ' '   text-005,
   'OMENG'  'TBL_OUTPUT'     'OMENG'   'TBL_OUTPUT'  'E'   text-008.
ENDFORM.                    " fill_field_catalog
*&amp;amp;---------------------------------------------------------------------*
FORM build_catalog USING    p_ref_fieldname
                            p_ref_table
                            p_fieldname
                            p_table
                            p_check
                            p_short.
*
  DATA: ls_fieldcat TYPE slis_fieldcat_alv.
  ls_fieldcat-fieldname        = p_fieldname.
  ls_fieldcat-tabname          = p_table.
  ls_fieldcat-seltext_m        = p_short.
  ls_fieldcat-seltext_l        = p_short.
  ls_fieldcat-outputlen        = p_short.
  IF p_check = c_x.
    ls_fieldcat-checkbox = c_x.
    ls_fieldcat-input    = c_x.
  ENDIF.
  IF p_check = c_e.
    ls_fieldcat-input = c_x.
  ENDIF.
  APPEND ls_fieldcat TO gt_fieldcat.
  CLEAR ls_fieldcat.
ENDFORM.                    " build_catalog
*&amp;amp;---------------------------------------------------------------------*
FORM alv_grid_display.
* The order quantities in output report can be edited to print datasheet
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program       = gv_repid
            i_background_id          = c_bcgrd
            i_callback_pf_status_set = c_pfstatus
            i_callback_user_command  = c_user_command
            is_layout                = gs_layout
            it_fieldcat              = gt_fieldcat[]
            i_save                   = 'U'
            it_events                = tbl_alv_events[]
       TABLES
            t_outtab                 = tbl_output
       EXCEPTIONS
            program_error            = 1
            OTHERS                   = 2.
ENDFORM.                    " alv_list_display
*&amp;amp;---------------------------------------------------------------------*
FORM pf_status_set USING extab TYPE slis_t_extab .
  REFRESH extab. CLEAR   extab.
  SET PF-STATUS 'ZDATASHEET'.
ENDFORM.                    " PF_STATUS_SET
*&amp;amp;---------------------------------------------------------------------*
FORM user_command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
  CASE ucomm.
    WHEN 'SALL'.
      LOOP AT tbl_output.
        tbl_output-check = c_x.
        MODIFY tbl_output TRANSPORTING check omeng.
      ENDLOOP.
    WHEN 'DSEL'.
      LOOP AT tbl_output.
        CLEAR tbl_output-check.
        MODIFY tbl_output TRANSPORTING check omeng.
      ENDLOOP.
    WHEN 'PRNT'.
      PERFORM  After_output_data.
      ENDCASE.
  selfield-refresh = c_x.
ENDFORM.                    " USER_COMMAND 


FORM f_build_events.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = tbl_alv_events
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.

Add event name for User Command 
READ TABLE tbl_alv_events WITH KEY name = slis_ev_user_command
INTO s_evts.
IF sy-subrc = 0.
s_evts-form = c_user_command.
MODIFY tbl_alv_events FROM s_evts
TRANSPORTING form
WHERE name = slis_ev_user_command.
CLEAR s_evts.
ENDIF.
ENDFORM. " f_build_events&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Parvathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 13:43:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-on-alv-grid/m-p/5008612#M1165951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T13:43:49Z</dc:date>
    </item>
  </channel>
</rss>

