Standard buttons in ALV

Hi all,
I need to change the text to the standard button "Export" in ALV for the text "Excel" and assing only one function to this button, the function I need is export to excel.
Does anyone knows how to solve this problem please?
Help is really appreciated.
Regards!

In your first post you asked about ALV and now about non-ALV...
So about ALV you have the Excel download by default and you are able to change the text.
About non-ALV download I think you have to use the method: cl_wd_runtime_services=>attach_file_to_response.
Look at the last post in:
File download WD4A
Sergio

Similar Messages

  • Message on clicks on standard button of alv in webdynpro

    Hi experts,
    I want to show message on clicks on standard button of alv in webdynpro.

    Hi Rohit..
    Also check this...
    http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproABAP-ALVControllingStandard+Buttons
    Cheers,
    Kris.

  • Disable some standard buttons from ALV display

    Hello All,
    I am creating an ALV display using object oriented approach. I know how to exclude some of the standard function buttons from the list.
    But suppose instead of deleting, the requirement is to disable (I mean grayed out)
    some standard buttons from ALV. Could anyone please comment on how to do this.
    Many thanks in advance.
    Regards
    Indrajit

    Hello Indrajit
    The following sample reports shows how to disable toolbar functions. Run the report and the push the ENTER button repeatedly.
    *& Report  ZUS_SDN_ALV_EVT_TOOLBAR
    *& This sample report explains the handling of event TOOLBAR in order
    *% to activate or inactive buttons of the ALV toolbar.
    *& Based on: BCALV_GRID_DEMO
    *& Procedure: Copy BCALV_GRID_DEMO and replace entire coding  OR
                copy screen '0100' and GUI status 'MAIN100' from
                BCALV_GRID_DEMO to this report.
    REPORT  zus_sdn_alv_evt_toolbar.
    TYPE-POOLS: abap, cntb, icon.
    DATA:
      ok_code                TYPE ui_func,
      gt_sflight             TYPE TABLE OF sflight,
      g_container        TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
      g_grid1               TYPE REF TO cl_gui_alv_grid,
      g_custom_container    TYPE REF TO cl_gui_custom_container.
    PARAMETERS:
      p_inact    RADIOBUTTON GROUP grp1  DEFAULT 'X',  " delete buttons
      p_dele     RADIOBUTTON GROUP grp1.               " inactivate buttons
    PARAMETERS:
      p_newbut   AS CHECKBOX  DEFAULT ' ',  " add new button
      p_newddm   AS CHECKBOX  DEFAULT 'X'.  " add dropdown menu
          CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_cnt    TYPE i.
        CLASS-METHODS:
          handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
            IMPORTING
              e_object
              e_interactive
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
          CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_toolbar.
    § 2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
        DATA:
          ls_toolbar  TYPE stb_button,
          ls_menu     type STB_BTNMNU.
    E_OBJECT of event TOOLBAR is of type REF TO CL_ALV_EVENT_TOOLBAR_SET.
    This class has got one attribute, namly MT_TOOLBAR, which
    is a table of type TTB_BUTTON. One line of this table is
    defined by the Structure STB_BUTTON (see data deklaration above).
    A remark to the flag E_INTERACTIVE:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            'e_interactive' is set, if this event is raised due to
            the call of 'set_toolbar_interactive' by the user.
            You can distinguish this way if the event was raised
            by yourself or by ALV
            (e.g. in method 'refresh_table_display').
            An application of this feature is still unknown...
        ADD 1 TO md_cnt. " a simple counter
      (1.a) Inactivate toolbar buttons
        IF ( p_inact = abap_true ).
          LOOP AT e_object->mt_toolbar INTO ls_toolbar FROM 1 TO md_cnt.
            ls_toolbar-disabled = 'X'.
            MODIFY e_object->mt_toolbar FROM ls_toolbar.
          ENDLOOP.
      (1.b) Delete toolbar buttons
        ELSE.
          DO md_cnt TIMES.
            DELETE e_object->mt_toolbar INDEX 1.
          ENDDO.
        ENDIF.
      (2) Add new button
        IF ( p_newbut = abap_true ).
        Add separator to separate default and new buttons
          CLEAR: ls_toolbar.
          ls_toolbar-butn_type = cntb_btype_sep.  " separator
          APPEND ls_toolbar TO e_object->mt_toolbar.
        Add new button "DETAIL"
          CLEAR: ls_toolbar.
          ls_toolbar-function  = 'DETAIL'.
          ls_toolbar-icon      = icon_detail.
          ls_toolbar-quickinfo = 'QuickInfo'.
          ls_toolbar-butn_type = cntb_btype_button.
          ls_toolbar-disabled  = abap_false.
          ls_toolbar-text      = 'Details'.
         ls_toolbar-checked = ' '.
          APPEND ls_toolbar TO e_object->mt_toolbar.
        ENDIF.
      (3) Add new dropdown menu
        IF ( p_newddm = abap_true ).
        Add separator to separate default and new buttons
          CLEAR: ls_toolbar.
          ls_toolbar-butn_type = cntb_btype_sep.  " separator
          APPEND ls_toolbar TO e_object->mt_toolbar.
        Add new dropdown menu "DETAIL"
          CLEAR: ls_toolbar.
          ls_toolbar-function  = 'DDMENU'.
          ls_toolbar-icon      = icon_detail.
          ls_toolbar-quickinfo = 'QuickInfo'.
          ls_toolbar-butn_type = cntb_btype_dropdown.
          ls_toolbar-disabled  = abap_false.
          ls_toolbar-text      = 'DD-Menu'.
         ls_toolbar-checked = ' '.
          APPEND ls_toolbar TO e_object->mt_toolbar.
        ENDIF.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
          MAIN                                                          *
      SELECT * FROM sflight INTO TABLE gt_sflight.
      CALL SCREEN 100.
    END-OF-SELECTION.
          MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.
      Instantiate ALV grid control
        CREATE OBJECT g_grid1
               EXPORTING i_parent = g_custom_container.
        CALL METHOD g_grid1->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SFLIGHT'
          CHANGING
            it_outtab        = gt_sflight.
      Set event handler for event TOOLBAR
        SET HANDLER:
          lcl_eventhandler=>handle_toolbar FOR g_grid1.
      ENDIF.
    $Comment: Toolbar can be modified on-the-fly
      g_grid1->set_toolbar_interactive( ).
    ENDMODULE.                    "PBO OUTPUT
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      to react on oi_custom_events:
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN OTHERS.
        do nothing
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "PAI INPUT
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    CALL METHOD G_CUSTOM_CONTAINER->FREE.
    CALL METHOD CL_GUI_CFW=>FLUSH.
      LEAVE PROGRAM.
    ENDFORM.                    "EXIT_PROGRAM[/code]
    Regards
      Uwe

  • Remove standard button in ALV LIKE APPEND/INSERT/DELETE

    Hi Expert,
    I have a requirement in which we do not need APPEND/INSERT/DELETE button in ALV,Can you please tell how i can remove that.
    Pleaae suggest.
    Thanks
    Mahesh

    Check this
        data lo_cmp_usage type ref to if_wd_component_usage.
        lo_cmp_usage =   wd_this->wd_cpuse_alv1( ). " alv1 is my used alv component
        if lo_cmp_usage->has_active_component( ) is initial.
          lo_cmp_usage->create_component( ).
        endif.
        data lo_interfacecontroller type ref to iwci_salv_wd_table .
        lo_interfacecontroller =   wd_this->wd_cpifc_alv1( ).
        data lo_value type ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(    ).
    data: lr_std type ref to if_salv_wd_std_functions.
        lr_std ?= lo_value.
    lr_std->SET_EDIT_APPEND_ROW_ALLOWED( abap_false ).
    lr_std->SET_EDIT_DELETE_ROW_ALLOWED( abap_false ).
    lr_std->SET_EDIT_INSERT_ROW_ALLOWED( abap_false ).
    Regards
    Srinivas

  • Inactive standard buttons in ALV

    Hi Experts,
    I had requirement to inactive some buttons in standard alv. For Example, sorting buttons,download to excel  should be made inactive. Please provide your solutions to solve the issue.
    Thanks and Regards,
    Bharat

    Hi!
    You can try this:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat              = wa_fcat[]
          i_grid_title             = gv_title
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'SET_STATUS'
          is_layout                = gd_layout
        TABLES
          t_outtab                 = it_screen.
    FORM set_status USING i_it_excluding TYPE slis_t_extab.
      SET PF-STATUS 'z001' EXCLUDING x1 x2.
    ENDFORM.                    " SET_STATUS
    thanks,
    Raul Natu

  • Debugging standard button code in ALV

    Hi All,
    I would like to debug the "Export" button that is available on tool bar.Is it possibe? If yes, pls suggest.
    Thank You,
    Suresh.

    Hi Suresh,
                  On the View in Which the alv is displaying, go to methods, create a new method , type event handler, then select from drop down on standard_button_click. then put a debugger on the method and run the application. then after wards on click or select of any standard button on alv will trigger the method.from the parameters of the method you can check the button clicked and its properties.
    Regards
    Sarath

  • Hide 'Change Layout' button from alv toolbar

    Hello All,
    can anyone let me know how can we hide the change layout button or exclude the change layout button from the ALV tool bar using OOPS . what's the fcode for it.
    Thank You !
    Ravi

    Hi Ravi,
    Please refer to this [Program|http://www.saptechies.com/disable-some-standard-buttons-from-alv-display/].
    Hope this helps.
    Regards,
    Chandravadan

  • How to remove the the standard button APPEND/INSERT/DELETE in webdynpro alv

    Hello,
    how to remove the the standard button APPEND/INSERT/DELETE in webdynpro-abap  alv
    Thanks
    Rakshar

    Use  this.
        data lo_cmp_usage type ref to if_wd_component_usage.
        lo_cmp_usage =   wd_this->wd_cpuse_alv1( ).
        if lo_cmp_usage->has_active_component( ) is initial.
          lo_cmp_usage->create_component( ).
        endif.
        data lo_interfacecontroller type ref to iwci_salv_wd_table .
        lo_interfacecontroller =   wd_this->wd_cpifc_alv1( ).
        data lo_value type ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
        data: lr_std type ref to if_salv_wd_std_functions.
        lr_std ?= lo_value.
        lr_std->set_export_allowed( abap_false ).
    NOte: ALV1 is alv component name
    Regards
    Srinivas
    Edited by: sanasrinivas on Dec 1, 2011 6:11 AM

  • AlV Grid Standard Buttons

    Hi ,
                How to remove the standard buttons on the WD4A alv grid like View (Std. View) , Print Version , Export , Filter , Settings.
    Thanks,
    Kumar

    How did u solved ?

  • Adding custom button in standard toolbar in ALV

    Hello All,
    I need to add a customized button called "Copy" on ALV. The following code is giving me few standard buttons like "Append" "Delete" "Insert" etc. So, how can I add "Copy" button besides one of these standard buttons.
    data: l_value type ref to cl_salv_wd_config_table.
    data: lr_table_settings type ref to if_salv_wd_table_settings.
    lr_table_settings ?= l_value.
    lr_table_settings->set_read_only( abap_false ).
    Appreciate help.
    Thks & Rgds,
    Hemal

    Create One method
    And inside that method write the below code
    (Here i  am creating delete button you can create any name button you want just replace the name
      DATA lV_EDITBTN TYPE REF TO cl_salv_wd_fe_button.
      DATA lr_buttonui TYPE REF TO cl_salv_wd_fe_button.
      CREATE OBJECT lr_buttonui.
      lr_buttonui->set_text( 'Details' ).
      lr_buttonui->set_tooltip(
      'Shows Detail Screen as per the View selected' ).
    Generating Function Object for Button.*
      DATA btn_button TYPE REF TO cl_salv_wd_function.
      btn_button = lo_value->if_salv_wd_function_settings~create_function(
                              id = 'DETAILS' ).
      btn_button->set_editor( lr_buttonui ).
      DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
    After that create another method  and make it as a event ( it means now it become event )
    select event ON FUNCTION FROM THE LIST
    Inside that event   write
    CASE LV_FCODE.
        WHEN 'DETAILS'.
           wd_this->fire_OP_TODEATILS_plg( ).
    endcase.
    May be it may help

  • Add Button with ALV  Standard Toolbar.

    Hi,
    Can any one tell me how to add user-defined button with ALV
    Standard toolbar? When I add Pf-status for alv output , standard alv toolbar is not displayed.
    Plz do needful.

    On the toolbar event of your alv grid, all the button as shown in the code below.
    FORM handle_toolbar USING i_object TYPE REF TO cl_alv_event_toolbar_set .
    DATA: ls_toolbar TYPE stb_button.
    CLEAR ls_toolbar.
    MOVE 'EXCH' TO ls_toolbar-function. "#EC NOTEXT
    MOVE 2 TO ls_toolbar-butn_type.
    MOVE icon_calculation TO ls_toolbar-icon.
    MOVE 'Payment in Other Currencies'(202) TO ls_toolbar-quickinfo.
    MOVE ' ' TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled. "#EC NOTEXT
    APPEND ls_toolbar TO i_object->mt_toolbar.
    ENDFORM
    CLASS lcl_event_handler DEFINITION .
    PUBLIC SECTION .
    METHODS:
    *To add new functional buttons to the ALV toolbar
    handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING e_object e_interactive ,
    ENDCLASS.
    CLASS lcl_event_handler IMPLEMENTATION .
    *Handle Toolbar
    METHOD handle_toolbar.
    PERFORM handle_toolbar USING e_object e_interactive .
    ENDMETHOD .
    ENDCLASS.
    DATA gr_event_handler TYPE REF TO lcl_event_handler .
    *--Creating an instance for the event handler
    CREATE OBJECT gr_event_handler .
    *--Registering handler methods to handle ALV Grid events
    SET HANDLER gr_event_handler->handle_toolbar FOR gr_alvgrid .
    Hope this helps.
    Thanks,
    Balaji

  • Custom Button in ALV Grid standard toolbar

    Hello Experts,
    I am working on the program in which i have to add custom button to standard toolbar in ALV. I have created the button using the method as below
         data: lr_functions type ref to cl_salv_functions_list.
         lr_functions = gr_table->get_functions( ).
         lr_functions->set_default( abap_true ).
         data: l_text       type string,
               l_icon       type string.
    *    l_text = text-b01.
         l_icon = icon_complete.
         try.
           lr_functions->add_function(
             name     = 'Update Equipment Cost'
             icon     = l_icon
             text     = l_text
             tooltip  = 'Update Equipment Cost'
             position = if_salv_c_function_position=>right_of_salv_functions ).
           catch cx_salv_existing cx_salv_wrong_call.
         endtry.
    I don't understand how to add functionality to this button. I want to design the functionality as when user press button then corresponding values on the screen will be automatically get updated in the table.
    Thanks,
    Avadhut

    Hi Avadhut,
    When you want to add a custom button on ALV - better copy the GUI Status of the standard ALV to your program.  So all the function codes are copied , now you can go to the GUI_STATUS which is copied and you can mention your own function code or you can let the standard function codes as it is. You can copy the GUI of standard ALV from SE80 transaction. Let me know if you need any assistance in doing it.
    Now, if you want to write the code for any of the button on ALV -  then you need to handle it is the class.
    I used CL_SALV_TABLE - if you are using same then the below code gives you an idea of it.
    1. Create a local class in your program
    *       CLASS lcl_alv_events DEFINITION
    CLASS lcl_alv_events DEFINITION FINAL.
       PUBLIC SECTION.
         METHODS: on_user_command FOR EVENT added_function OF cl_salv_events
                                  IMPORTING e_salv_function.
    ENDCLASS.                    "lcl_alv_events DEFINITION
    DATA: gv_event_handler TYPE REF TO lcl_alv_events.
    CREATE OBJECT gv_event_handler.
    * Header object
    CREATE OBJECT gr_header.
    2. Class Implementation
       CLASS lcl_alv_events IMPLEMENTATION.
          METHOD on_user_command.
         CASE e_salv_function.
         **When PROCESS Button is selected
           WHEN '&PROC'.    ***> In my program I added Process button and fcode for it - &PROC
          ***********Write your code here ******************
        ENDCASE.
       ENDMETHOD.
    ENDCLASS.                    "lcl_alv_events IMPLEMENTATION
    3. Calling events
       data: gr_events    TYPE REF TO cl_salv_events_table,
               gr_alv       TYPE REF TO cl_salv_table.
       TRY.
           CALL METHOD cl_salv_table=>factory
             IMPORTING
               r_salv_table = gr_alv
             CHANGING
               t_table      = p_in_tab[].    ***This is my internal table data.
          gr_events = gr_alv->get_event( ).
             SET HANDLER gv_event_handler->on_user_command FOR gr_events.
         CATCH cx_salv_msg INTO lv_msg.                      "#EC NO_HANDLER
         CATCH cx_salv_not_found INTO lv_excep.              "#EC NO_HANDLER
         CATCH cx_salv_data_error.                           "#EC NO_HANDLER
       ENDTRY.
    Regards,
    Rafi

  • Editable ALV Standard buttons!! (bug or feature)

    Hi All,
    I have a little problem with editable alv. I couldn't catch the Standard editable alv buttons' events. ( Buttons: <b>Append Row, Delete Rows, Copy rows, Add new row</b>.)
    I would like to write a short code at <i>before_user_command</i> event, when the user press the add new line button on alv grid.
    When I press an other button (for.e. : Refresh ) on ALV I can catch the events.
    Why don't work this solution these 4 buttons?  It is a BUG? or a feature ?
    Can anyone sent me a short example about the best solution of this problem?
    THX.
    mike

    I haven't been able to achieve that myself...Only solution found for Append Row what to use this event...
          handle_data_finished
          FOR EVENT data_changed_finished OF cl_gui_alv_grid
          IMPORTING e_modified
    Greetings,
    Blag.

  • Standard application buttons in alv report

    i am using function module 'reuse_alv_list_display'.
      in my report i have all the standard buttons such as last, next previous,first etc.
       but the buttons such as CHOOSE and SAVE is missing.
      what should i do in the code to invoke these two standard button.

    Hi Charles,
    if you want them then you have to do all the Bold ones.
    you might missed them.
    data: VARIANT LIKE  DISVARIANT.
    variant-REPORT = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
    <b>    is_layout          = l_layout</b>
        it_fieldcat        = it_fieldcat
    <b>    I_SAVE             = 'X'
        IS_VARIANT         = VARIANT</b>
      TABLES
        t_outtab           = itab
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Regards
    vijay

  • Information button in ALV report

    Information button in ALV report is not working. any suggestion

    I have copied standard tool bar from standard program.During debugging, I have found that function code is defferent. Then I changed function code according to that.

Maybe you are looking for