<?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 ALV Extra Tool buttons in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-extra-tool-buttons/m-p/3279927#M784373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;How can I add a new own &lt;STRONG&gt;tool&lt;/STRONG&gt; to alv tool bar. I need to add a refresh button through which I can refresh data time to time in one time execution of program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With warm regards&lt;/P&gt;&lt;P&gt;Rajiv singh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jan 2008 08:10:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-02T08:10:16Z</dc:date>
    <item>
      <title>ALV Extra Tool buttons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-extra-tool-buttons/m-p/3279927#M784373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;How can I add a new own &lt;STRONG&gt;tool&lt;/STRONG&gt; to alv tool bar. I need to add a refresh button through which I can refresh data time to time in one time execution of program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With warm regards&lt;/P&gt;&lt;P&gt;Rajiv singh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 08:10:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-extra-tool-buttons/m-p/3279927#M784373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T08:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Extra Tool buttons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-extra-tool-buttons/m-p/3279928#M784374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to add button to ALV toolbar using REUSE_ALV_LIST_DISPLAY? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the program which calls ALV using REUSE_ALV_LIST_DISPLAY, &lt;/P&gt;&lt;P&gt;I have to add a new button. &lt;/P&gt;&lt;P&gt;I saw the demo program BCALV_GRID_08, which is written using ABAP-Controls. &lt;/P&gt;&lt;P&gt;In that example, the button is added using TOOLBAR event of cl_gui_alv_grid. &lt;/P&gt;&lt;P&gt;Could you help me to implement the same logic using REUSE_ALV_LIST_DISPLAY parameters. &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 of one of mine: &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;I just tried the same procedure ,but my entire application toolbar disappeared and a lock icon appears next to the application toolbar in my copied pf-status. &lt;/P&gt;&lt;P&gt;Could you advice what might have gone wrong ? &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 from one program to another. It mentions which one in the FM's help. &lt;/P&gt;&lt;P&gt;2). Create a form named like so: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form Set_pf_status &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;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM set_pf_status USING rt_extab TYPE slis_t_extab. &lt;/P&gt;&lt;P&gt;  SET PF-STATUS '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;P&gt;&lt;/P&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;P&gt;&lt;/P&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;Edited by: Abap-fresher on Jan 2, 2008 9:27 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 08:24:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-extra-tool-buttons/m-p/3279928#M784374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T08:24:20Z</dc:date>
    </item>
  </channel>
</rss>

