<?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 Refresh toolbar after initial display in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276029#M151549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks for the quick response. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The program does not return to PAI when hitting an ALV grid button hence I cannot intercept and validate.  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;In my case, I have standard toolbar buttons that provide filtered views of the data originally entered in the grid. I don't like the idea of having to call another program passing in the filtered data just so I can manipulate ALV toolbar buttons. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;As far as windows design goes if I can alter things like what fields are visible and/or input capable or even the color of a row, then, I don't see why they wouldn't allow the disabling of some of the grid buttons under certain situations. After all, they do allow it after the first time in and there must be some performance advantage to executing refresh_table display instead of set_table_for_first_display. Other areas of SAP allow appearing and dissappearing of objects on a screen after inital display, i.e display v.s edit modes, and often these things are determined in config. I would hope SAP would consider that for the future. For now, I guess I'll make do.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Apr 2006 18:04:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-13T18:04:17Z</dc:date>
    <item>
      <title>ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276027#M151547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a custom ALV application where after I've executed the set_table_for_first_display method of my instantiated version of cl_gui_alv_grid, under certain conditions I need to modify the field catalog, the layout and the toolbar. I am able to change the field catalog and layout with methods set_frontend_fieldcatalog and set_frontend_layout accordingly. However, I haven't found a public method in cl_gui_alv_grid to modify the toolbar. I would really prefer not to have to re-execute method set_table_for_first_display just for this purpose. Is there another viable option?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 16:18:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276027#M151547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T16:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276028#M151548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In reviewing your req, the class has no other options for you.  The REFRESH_TABLE_DISPLAY method does reference the toolbar object.  However, it does not alter it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would need to call SET_TABLE_FOR_FIRST_DISPLAY, in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not have all buttons available and then just validate IF the button press is appropriate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From a Windows screen design standard, appearing and disappearing screen objects is not a recommended practice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 17:20:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276028#M151548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T17:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276029#M151549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks for the quick response. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The program does not return to PAI when hitting an ALV grid button hence I cannot intercept and validate.  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;In my case, I have standard toolbar buttons that provide filtered views of the data originally entered in the grid. I don't like the idea of having to call another program passing in the filtered data just so I can manipulate ALV toolbar buttons. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;As far as windows design goes if I can alter things like what fields are visible and/or input capable or even the color of a row, then, I don't see why they wouldn't allow the disabling of some of the grid buttons under certain situations. After all, they do allow it after the first time in and there must be some performance advantage to executing refresh_table display instead of set_table_for_first_display. Other areas of SAP allow appearing and dissappearing of objects on a screen after inital display, i.e display v.s edit modes, and often these things are determined in config. I would hope SAP would consider that for the future. For now, I guess I'll make do.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 18:04:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276029#M151549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T18:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276030#M151550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"The program does not return to PAI when hitting an ALV grid button hence I cannot intercept and validate."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct... standard buttons do not return to the PAI module.  However, custom buttons do return to the event handler.  You can add custom buttons to meet your reqs and then hide any standard buttons that do not apply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 18:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276030#M151550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T18:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276031#M151551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This method will trigger the event toolbar!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This event need to be handled by an Handler and then modify the toolbar!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your rewardi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 18:27:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276031#M151551</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T18:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276032#M151552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stephan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response. Does set_toolbar_interactive just allow me to intercept the standard ALV button ok_codes in PAI or does it aid in allowing me to disable standard ALV buttons? If it is the later of the two, do you have an example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 18:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276032#M151552</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T18:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276033#M151553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This method will allow you to react to the custom toolbar button actions as far as I know. I don't think you will be able to work on the enbling or disabling the standard buttons using this. But you can use something like this when you are calling &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    v_ui_func = '&amp;amp;INFO'.
    append v_ui_func to i_toolbar_excluding.
    v_ui_func = '&amp;amp;VIEW'.
    append v_ui_func to i_toolbar_excluding.
  call method lcl_alvgrid_inv-&amp;gt;set_table_for_first_display
    exporting
*       I_BYPASSING_BUFFER            =
*       I_BUFFER_ACTIVE               =
*       I_CONSISTENCY_CHECK           =
*       i_structure_name              = 'RLMMQ'
*       IS_VARIANT                    =
*       I_SAVE                        =
*       I_DEFAULT                     = 'X'
        is_layout                     = ls_layout_inv
*       IS_PRINT                      =
*       IT_SPECIAL_GROUPS             =
        it_toolbar_excluding          = i_toolbar_excluding &amp;lt;b&amp;gt;&amp;lt;--&amp;lt;/b&amp;gt;
*       IT_HYPERLINK                  =
*       IT_ALV_GRAPHICS               =
    changing
        it_outtab                     = &amp;lt;itab&amp;gt;
        it_fieldcatalog               = i_fieldcat_inv
*       IT_SORT                       =
*       IT_FILTER                     =
    exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 18:48:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276033#M151553</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T18:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276034#M151554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new program Zsandbox_prog  and then create a screen 100 for it with a custom container called W1 on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add this code to the program.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Zsandbox_prog .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: SYDES.&lt;/P&gt;&lt;P&gt;TABLES: DD04L, DD04T.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of P1 occurs 0.&lt;/P&gt;&lt;P&gt;        include structure vbak.&lt;/P&gt;&lt;P&gt;data:  end of P1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: GRID1               TYPE REF TO CL_GUI_ALV_GRID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: tb_exclude type ui_functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: W1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER.&lt;/P&gt;&lt;P&gt;DATA: GT_FIELDCAT1 TYPE LVC_T_FCAT.&lt;/P&gt;&lt;P&gt;data: gt_fieldcat type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE &amp;lt;icon&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm,&lt;/P&gt;&lt;P&gt;      gs_toolbar  TYPE stb_button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOCAL CLASSES: Definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;****************************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver_g1 DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLASS-METHODS:&lt;/P&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 e_interactive,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    handle_user_command&lt;/P&gt;&lt;P&gt;        FOR EVENT user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;            IMPORTING e_ucomm,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    HANDLE_DOUBLE_CLICK&lt;/P&gt;&lt;P&gt;        FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID&lt;/P&gt;&lt;P&gt;            IMPORTING E_ROW E_COLUMN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver_g1 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This code adds custom toolbar button on the ALV grids.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; In particular, it adds the ADD, DELETE, CHG, and REFRESH buttons.&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;Add 'ADD' button to the ALV grid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLEAR gs_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 'ADD' TO gs_toolbar-function.&lt;/P&gt;&lt;P&gt;    move '  Add Co-op' to gs_toolbar-TEXT.&lt;/P&gt;&lt;P&gt;    MOVE ICON_INSERT_MULTIPLE_LINES TO gs_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE 'Add a co-op'(200) TO gs_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    MOVE 0 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;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;Add 'CHG' button to the ALV grid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLEAR gs_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 'CHG' TO gs_toolbar-function.&lt;/P&gt;&lt;P&gt;    move '  Change Co-op' to gs_toolbar-TEXT.&lt;/P&gt;&lt;P&gt;    MOVE ICON_change TO gs_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE 'Change a co-op'(200) TO gs_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    MOVE 0 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;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;Add DELETE button to the ALV grid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLEAR gs_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 'DELETE' TO gs_toolbar-function.&lt;/P&gt;&lt;P&gt;    move '  Delete Co-op' to gs_toolbar-TEXT.&lt;/P&gt;&lt;P&gt;    MOVE ICON_delete TO gs_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE 'Delete co-op(s)'(200) TO gs_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    MOVE 0 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;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;Add a REFRESH button.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLEAR gs_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 'REFR' TO gs_toolbar-function.&lt;/P&gt;&lt;P&gt;    move '' to gs_toolbar-TEXT.&lt;/P&gt;&lt;P&gt;    MOVE ICON_refresh TO gs_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE 'Refresh the grid' TO gs_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    MOVE 0 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;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_user_command.&lt;/P&gt;&lt;P&gt;    CASE e_ucomm.&lt;/P&gt;&lt;P&gt;      when 'ADD'.&lt;/P&gt;&lt;P&gt;        message i000(zz) with 'Add button was pressed.'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN 'CHG'.&lt;/P&gt;&lt;P&gt;        message i000(zz) with 'Change button was pressed.'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                           "handle_user_command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_double_click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "HANDLE_DOUBLE_CLICK&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call screen '0100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM Prepare_FieldCats .&lt;/P&gt;&lt;P&gt;  if w1 is initial.&lt;/P&gt;&lt;P&gt;    clear gt_fieldcat.&lt;/P&gt;&lt;P&gt;    Perform Build_FieldCats TABLES P1.&lt;/P&gt;&lt;P&gt;    gt_fieldcat1[] = gt_fieldcat[].&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Form Build_Grids.&lt;/P&gt;&lt;P&gt;  DATA: GS_LAYOUT       TYPE LVC_S_LAYO,&lt;/P&gt;&lt;P&gt;        GS_VARIANT      TYPE DISVARIANT.&lt;/P&gt;&lt;P&gt;  DATA: X_SAVE VALUE 'X'.                "for Parameter I_SAVE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gs_layout-zebra = 'X'.&lt;/P&gt;&lt;P&gt;  gs_layout-NO_ROWMARK = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MOVE sy-repid TO gs_variant-report.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_save     = x_save&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;            cs_variant = gs_variant&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;         WRONG_INPUT         = 1&lt;/P&gt;&lt;P&gt;         NOT_FOUND           = 2&lt;/P&gt;&lt;P&gt;         PROGRAM_ERROR       = 3&lt;/P&gt;&lt;P&gt;         OTHERS              = 4.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Perform Build_Exclude_Toolbar_Table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build Grid1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT w1&lt;/P&gt;&lt;P&gt;         EXPORTING container_name = 'W1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT grid1&lt;/P&gt;&lt;P&gt;         EXPORTING i_parent = w1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gs_layout-grid_title = 'Period 1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set the event handlers for the ALV grid1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SET HANDLER lcl_event_receiver_g1=&amp;gt;handle_user_command&lt;/P&gt;&lt;P&gt;              lcl_event_receiver_g1=&amp;gt;handle_toolbar&lt;/P&gt;&lt;P&gt;              lcl_event_receiver_g1=&amp;gt;handle_double_click for grid1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD grid1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;         EXPORTING is_variant       = gs_variant&lt;/P&gt;&lt;P&gt;                   i_save           = x_save&lt;/P&gt;&lt;P&gt;                   is_layout        = gs_layout&lt;/P&gt;&lt;P&gt;                   it_toolbar_excluding = tb_exclude&lt;/P&gt;&lt;P&gt;          CHANGING it_fieldcatalog  = gt_fieldcat1&lt;/P&gt;&lt;P&gt;                   it_outtab        = p1[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndForm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM Build_Exclude_Toolbar_Table .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    delete menu buttons&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  refresh tb_exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND CL_GUI_ALV_GRID=&amp;gt;MC_FC_LOC_APPEND_ROW&lt;/P&gt;&lt;P&gt;     TO tb_exclude.&lt;/P&gt;&lt;P&gt;  APPEND CL_GUI_ALV_GRID=&amp;gt;MC_FC_LOC_APPEND_ROW&lt;/P&gt;&lt;P&gt;     TO tb_exclude.&lt;/P&gt;&lt;P&gt;  APPEND CL_GUI_ALV_GRID=&amp;gt;MC_FC_LOC_COPY&lt;/P&gt;&lt;P&gt;     TO tb_exclude.&lt;/P&gt;&lt;P&gt;  APPEND CL_GUI_ALV_GRID=&amp;gt;MC_FC_LOC_COPY_ROW&lt;/P&gt;&lt;P&gt;     TO tb_exclude.&lt;/P&gt;&lt;P&gt;  APPEND CL_GUI_ALV_GRID=&amp;gt;MC_FC_LOC_CUT&lt;/P&gt;&lt;P&gt;     TO tb_exclude.&lt;/P&gt;&lt;P&gt;  APPEND CL_GUI_ALV_GRID=&amp;gt;MC_FC_LOC_DELETE_ROW&lt;/P&gt;&lt;P&gt;     TO tb_exclude.&lt;/P&gt;&lt;P&gt;  APPEND CL_GUI_ALV_GRID=&amp;gt;MC_FC_LOC_INSERT_ROW&lt;/P&gt;&lt;P&gt;     TO tb_exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndForm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM Build_FieldCats TABLES itab_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: field_name(60) TYPE c,&lt;/P&gt;&lt;P&gt;        descr_ref TYPE REF TO cl_abap_typedescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: td       TYPE sydes_desc,&lt;/P&gt;&lt;P&gt;        typeinfo TYPE sydes_typeinfo,&lt;/P&gt;&lt;P&gt;        nameinfo TYPE sydes_nameinfo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ls_fieldcat TYPE lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: hlp(30)  TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  refresh gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Initializes the name of the columns&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DESCRIBE FIELD itab_layout INTO td.&lt;/P&gt;&lt;P&gt;  DELETE td-types INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creates the internal table with field definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT sy-index OF STRUCTURE itab_layout TO &amp;lt;field&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR ls_fieldcat.&lt;/P&gt;&lt;P&gt;    descr_ref = cl_abap_typedescr=&amp;gt;describe_by_data( &amp;lt;field&amp;gt; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    dd04l-rollname = descr_ref-&amp;gt;absolute_name+6(15).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT SINGLE *&lt;/P&gt;&lt;P&gt;      FROM dd04l&lt;/P&gt;&lt;P&gt;     WHERE rollname = dd04l-rollname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT SINGLE *&lt;/P&gt;&lt;P&gt;        FROM dd04t&lt;/P&gt;&lt;P&gt;       WHERE rollname   = dd04l-rollname&lt;/P&gt;&lt;P&gt;         AND ddlanguage = sy-langu&lt;/P&gt;&lt;P&gt;         AND as4vers    = dd04l-as4vers&lt;/P&gt;&lt;P&gt;         AND as4local   = dd04l-as4local.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE td-types INDEX sy-index INTO typeinfo.&lt;/P&gt;&lt;P&gt;      READ TABLE td-names INDEX typeinfo-idx_name INTO nameinfo.&lt;/P&gt;&lt;P&gt;      ls_fieldcat-coltext   = dd04t-SCRTEXT_M.  "dd04t-reptext.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE td-types INDEX sy-index INTO typeinfo.&lt;/P&gt;&lt;P&gt;      READ TABLE td-names INDEX typeinfo-idx_name INTO nameinfo.&lt;/P&gt;&lt;P&gt;      ls_fieldcat-coltext   = nameinfo-name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DESCRIBE FIELD &amp;lt;field&amp;gt; HELP-ID hlp.&lt;/P&gt;&lt;P&gt;    IF NOT hlp IS INITIAL.&lt;/P&gt;&lt;P&gt;      IF hlp CS '-'.&lt;/P&gt;&lt;P&gt;        ls_fieldcat-ref_field = hlp+sy-fdpos(15).&lt;/P&gt;&lt;P&gt;        ls_fieldcat-ref_field = ls_fieldcat-ref_field+1(15).&lt;/P&gt;&lt;P&gt;        ls_fieldcat-ref_table = hlp+0(sy-fdpos).&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ls_fieldcat-fieldname = nameinfo-name.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-inttype   = descr_ref-&amp;gt;type_kind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if ls_fieldcat-inttype = 's'.  " SAP ALV func module does not&lt;/P&gt;&lt;P&gt;      ls_fieldcat-inttype = 'N'.   " handle INT1,INT2,INT4 types&lt;/P&gt;&lt;P&gt;    endif.                         " correctly in 4.6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ls_fieldcat-outputlen = descr_ref-&amp;gt;length.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-decimals  = descr_ref-&amp;gt;decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND ls_fieldcat to gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ADD 1 TO n.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " Build_FieldCats&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET PF-STATUS 'xxxxxxxx'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET TITLEBAR 'xxx'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select * up to 50 rows from vbak into table P1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Perform Prepare_FieldCats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Perform Build_Grids.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE USER_COMMAND_0100 INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 19:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276034#M151554</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T19:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh toolbar after initial display</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276035#M151555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hit a couple syntax errors that'll I'll work through tomorrow but, I just wanted to say thanks in advance. I greatly appreciate the help and I'll respond with the results as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 19:45:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh-toolbar-after-initial-display/m-p/1276035#M151555</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T19:45:38Z</dc:date>
    </item>
  </channel>
</rss>

