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

Similar Messages

  • How to disable self defined button from ALV Toolbar when ok_code ='BACK'

    here is the code
    CLASS Z_CL_6_U_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
        METHODS:
          HANDLE_TOOLBAR
            FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
                IMPORTING E_OBJECT E_INTERACTIVE,
          HANDLE_USER_COMMAND
            FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
                IMPORTING E_UCOMM.
    ENDCLASS.         
    CLASS  Z_CL_6_U_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_TOOLBAR.
    DATA: LS_TOOLBAR  TYPE STB_BUTTON.
    IF G_FLAG = 'X' and ok_code = space.
          CLEAR LS_TOOLBAR.
           MOVE 0 TO LS_TOOLBAR-BUTN_TYPE.
          MOVE 'UPDATE' TO LS_TOOLBAR-FUNCTION.
          MOVE  ICON_MODIFY  TO LS_TOOLBAR-ICON.
          MOVE 'Update Records'(111) TO LS_TOOLBAR-QUICKINFO.
          MOVE ''(112) TO LS_TOOLBAR-TEXT.
          MOVE ' ' TO LS_TOOLBAR-DISABLED.
          APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
    elseif ok_code = 'BACK'.
          CLEAR LS_TOOLBAR.
      LS_TOOLBAR-function = 'UPDATE'.
      LS_TOOLBAR-butn_type = 0.
      LS_TOOLBAR-icon = ICON_MODIFY.
      LS_TOOLBAR-quickinfo = 'Update Records'.
      LS_TOOLBAR-disabled = 'X'.
      append LS_TOOLBAR TO <i><b>E_OBJECT</b></i>->MT_TOOLBAR.
    ENDIF.
      ENDMETHOD. 
    <i><b>ERROR COMES when ok_code is 'BACK'.
    at this point E_OBJECT has null reference instead of ref to Class cl_ALV_EVENT_TOOLBAR_SET.</b></i> 
    tell me why this error coming.
    pls help

    Hello Neetu
    To give you an example I have copied sample report BCALV_GRID_DEMO, added some code (search for <b>$Comment</b>) and modified the GUI-status <b>MAIN100</b> (replace function code EXIT with <b>BACK</b> for the F3 function).
    Run the program and push several times the BACK button: one toolbar function after the other will be inactivated.
    PROGRAM test.
    DATA: ok_code LIKE sy-ucomm,
          gt_sflight TYPE TABLE OF sflight,
          g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    <b>----
          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.
        DATA:
          ls_button    TYPE stb_button.
        ADD 1 TO md_cnt. " a simple counter
        LOOP AT e_object->mt_toolbar INTO ls_button FROM 1 TO md_cnt.
          ls_button-disabled = 'X'.
          MODIFY e_object->mt_toolbar FROM ls_button.
        ENDLOOP.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION</b>
    START-OF-SELECTION.
    *       MAIN                                                          *
      SELECT * FROM sflight INTO TABLE gt_sflight.
      CALL SCREEN 100.
    *       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 grid1
               EXPORTING i_parent = g_custom_container.
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SFLIGHT'
          CHANGING
            it_outtab        = gt_sflight.
    <b>*$Comment: Set event handler for event TOOLBAR
        SET HANDLER:
          lcl_eventhandler=>handle_toolbar FOR grid1.
      ENDIF.</b>
    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.
    <b>    WHEN 'BACK'.
    $Comment: Toolbar can be modified on-the-fly
          grid1->set_toolbar_interactive( ).</b>
        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
    Regards
      Uwe

  • 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

  • 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.

  • How to remove a Sort button from ALV List

    Hi Experts,
    How to remove sort button from ALV List.
    I have requirement where I need to remove the sort button from ALV list.
    Kindly give me useful clues.
    Higher points will be awarded for the useful inputs.
    Thanks in Advance,
    Dharani

    Hi dharani,
    1. UP and Down Sort Button will get removed.
    2. Important code is marked in bold
    3. Just copy paste.
    4.
    report abc.
    TYPE-POOLS : slis.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvfcwa TYPE slis_fieldcat_alv.
    <b>data : excl type SLIS_T_EXTAB.
    data : exclwa type SLIS_EXTAB.</b>
    data : begin of itab occurs 0.
            include structure usr02.
    data : end of itab.
    START-OF-SELECTION.
      select * from usr02
      into table itab.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_internal_tabname     = 'ITAB'
          i_inclname             = sy-repid
        CHANGING
          ct_fieldcat            = alvfc
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    <b>*----
    IMPORTANT
    fcodes to remove
    Up and Down Sort Button
    exclwa-fcode = '&OUP'.
    append exclwa to excl.
    exclwa-fcode = '&ODN'.
    append exclwa to excl.</b>
    Display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          it_fieldcat   = alvfc
          <b>IT_EXCLUDING     = excl</b>
        TABLES
          t_outtab      = itab
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    regards,
    amit m.

  • Download to excel from alv display

    Hi,
    How to download to excel from alv display.I am using object oriented abap for using alv.If i click export->spreadsheet i am getting fatal error and if i export->local file->spreadsheet i am getting only the column names and heading but no contents.Can anyone tell me how to overcome this problem.
    Regards,
    Sowmya.

    Hi Sowmya,
    Just put break point near FM reuse_alv_grid_display and check if internal table which is used to display output is popullated or not.
    Regards Sachin.

  • Create deep structure to disable some cells in Dynamic ALV GRID

    Hi,
    I want to disable some cells in a Dynamic ALV Grid before calling "SET_tABLE_Display" Method.
    I check the BCALV_EDIT_02, where some cells are grayed out by assign the  CL_GUI_ALV_GRID-MC_STYLE_DISABLED  to the field name.
    But I want the same using Field symbol.
    I'm creating Dynamic table and dynamic structure based on the Dynamic field catalog.
    Example: <FT_TAB> TYPE STANDARD TABLE,
                    <FS_TAB> TYPE ANY,            
    DATA: INT_TAB  is my dynamic table values.
    For the INT_TAB internal table, I created dynamic Structure and dynamic field symbol table.
    LOOP AT INT_TAB.
    ASSIGN COMPONENT 'MATNR'  OF STRUCTURE <FS_TAB> TO <F_VALUE>
    <F_VALUE> = INT_TAB-MATNR.
    APPEND <FS_TAB> TO <FT_TAB>
    "Here is the problem occurs, I want to grayed out the MATNR value based on some condition.
    ENDLOOP.
    I would like to set the 'MATNR' value to be grayed out by passing the CL_GUI_ALV_GRID-MC_STYLE_DISABLED.
    and update into <FT_TAB>(       <FT_TAB> structure will have 2 structures)
    Finally the fieldsymbol should have two structure ( <F_TAB> = DYNAMIC STRUCTURE + LVC_S_STYLE )
    Display alv grid by passing <FT_TAB> to set_table_display method.
    Thanks in advance,
    Kumar.

    Hi,
    I am  not sure whether I really understand your request. Let me try to help.
    > Example: <FT_TAB> TYPE STANDARD TABLE,
    >                 <FS_TAB> TYPE ANY,            
    >
    > DATA: INT_TAB  is my dynamic table values.
    >
    >
    > LOOP AT INT_TAB.
    >  ASSIGN COMPONENT 'MATNR'  OF STRUCTURE <FS_TAB> TO <F_VALUE>
    > <F_VALUE> = INT_TAB-MATNR.
    >  APPEND <FS_TAB> TO <FT_TAB>
    Here <FT_TAB> must already be assigned to some internal table with a given (dynamic) structure. Did this happen before this piece of code?
    What I would do is to create a dynamic table (see documentation to CREATE DATA) with MATNR and the STYLE field (LVC_T_STYL). See the documentation for CREATE DATA - creation of internal tables. When collection the field descriptions for that internal table I would also build the field catalogue for the ALV.
    Then assign <FT_TAB> to that newly created internal table, <FS_TAB> to a newly created structure (same as a table line).
    Move the MATNR to component 1 (or component 'MATNR') of the table and fill the style table according to your needs. Then insert the <FS_TAB> into <FT_TAB>.
    Finally call the ALV SET_TABLE... method with your dynamic table and your field catalogue.
    Regards,
    Gerd Rother

  • Reading fields from ALV display

    Hi All,
    I have a check box in front of each data record in the ALV display. This check box is editable. The user will check some records after seeing the details and click on a puch button provided. On the click of this button I need to read all the records whose check box has been checked.
    However, this edited value of check box is not getting reflected in the program. Is there any FM or any other method through which I can read the changed values in the ALV display ??
    Request your urgent help.
    Thanks and Regards,
    Archana.

    Hi ,
    Please see this example program - BCALV_EDIT_05
    I am sure this will help you.
    If u have used standard ALV function module(REUSE_ALV_GRID_DISPLAY) instead of class cl_gui_alv_grid , then you can set layout and fieldcatalog accordinglly.
    dont forget to add filed
    checkbox type c.
    in your display table (itab).
    fieldcatalog setting  :
      for field : 'CHECKBOX'.
    <b>  ls_fcat-checkbox = 'X'.
      ls_fcat-edit = 'X'.</b>
    In user command subroutine :
    check displayed internal table (itab here)
    u will find the checkbox-checked record has itab-checkbox = 'X' .
    Regards,
    Mihir.

  • Exclude buttons from ALV

    Hi All,
      I want to exclude pushbuttons from ALV. Can any body suggest me how to do this. I am using classes to display ALV.
    Regards,
    Venkat.

    in the pbo of your screen, before displaying your alv grid write in the following way:-
    data: g_alv_grid          type ref to cl_gui_alv_grid,
             g_exclude          type ui_func,
             g_t_tlbr_excl       type ui_functions.
    *PBO if used container or screen ,
    start of selection - if working with selection screen but before displaying alv.
    Exclude ICONS
        perform form_exculde_icons.
        call method g_alv_grid->set_table_for_first_display
          EXPORTING
            is_variant           = VARIANT
            is_layout            = LAYOUT
            is_print             =  PRINT
            it_toolbar_excluding = g_t_tlbr_excl
          CHANGING
            it_outtab            = ITAB
            it_fieldcatalog      = FIELDCATALOG[]
        if sy-subrc <> 0.
          write: 'Method call ''Set_table_for_first_display'' failed.'.
          exit.
        endif.
    form form_exculde_icons .
    Exclude alv sum button
      g_exclude = cl_gui_alv_grid=>mc_fc_sum.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv count button
      g_exclude = cl_gui_alv_grid=>mc_fc_count.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv average button
      g_exclude = cl_gui_alv_grid=>mc_fc_average.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv maximum button
      g_exclude = cl_gui_alv_grid=>mc_fc_maximum.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv manimum button
      g_exclude = cl_gui_alv_grid=>mc_fc_minimum.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv subtotal button
      g_exclude = cl_gui_alv_grid=>mc_fc_subtot.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv auf button
      g_exclude = cl_gui_alv_grid=>mc_fc_auf.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv locpaste button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv new_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv mb_view button
      g_exclude = cl_gui_alv_grid=>mc_mb_view.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_view button
      g_exclude = cl_gui_alv_grid=>mc_fc_views.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv print_prev button
      g_exclude = cl_gui_alv_grid=>mc_fc_print_prev.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv viewgrid button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_grid.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv view_excel button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_excel.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv view_crystal button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_crystal.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv view_lotus button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_lotus.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv send button
      g_exclude = cl_gui_alv_grid=>mc_fc_send.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_abc button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_abc.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_xint button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_xint.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_expcrdesig button
      g_exclude = cl_gui_alv_grid=>mc_fc_expcrdesig.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_expcrtempl button
      g_exclude = cl_gui_alv_grid=>mc_fc_expcrtempl.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv mb_paste button
      g_exclude = cl_gui_alv_grid=>mc_mb_paste.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv load_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_load_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv current_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_current_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv maintain_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_maintain_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv save_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_save_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv select_all button
      g_exclude = cl_gui_alv_grid=>mc_fc_select_all.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv deselect_all button
      g_exclude = cl_gui_alv_grid=>mc_fc_deselect_all.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv graph button
      g_exclude = cl_gui_alv_grid=>mc_fc_graph.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv info button
      g_exclude = cl_gui_alv_grid=>mc_fc_info.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv f4 button
      g_exclude = cl_gui_alv_grid=>mc_fc_f4.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_report button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_report.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_check button
      g_exclude = cl_gui_alv_grid=>mc_fc_check.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_refresh button
      g_exclude = cl_gui_alv_grid=>mc_fc_refresh.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv loc_cut button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv loc_copy button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv loc_undo button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv append_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv insert_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv delete_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv copy_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv reprep button
      g_exclude = cl_gui_alv_grid=>mc_fc_reprep.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_chain button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_chain.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_more button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_more.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_master_data button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_master_data.
      append g_exclude to g_t_tlbr_excl.
    endform.

  • How to disable the custom button on alv?

    Hi All,
                       i created a ALV Report .I created a Custom Button on ALV.Based on the input value i need to enable/disable  that Button.
    How can i achieve?And what are the methods i need to code?
    Regards
    Ravi

    Hi Ravi,
       You create the button like this:
    Data: mr_functions type ref to IF_SALV_WD_FUNCTION_SETTINGS,
             mr_button_func type ref to CL_SALV_WD_FUNCTION
      mr_functions ?=  mr_alv_model.
      CALL METHOD mr_functions->create_function
        EXPORTING
          id    = '<<Button Id>>'
        RECEIVING
          value = mr_button_func.
      CREATE OBJECT mr_button.
      mr_button->set_text( 'some text' ).
      mr_button_func->set_editor( mr_button ).
    to sent enable/disable
    mr_button->set_enabled(abap_false).
    hope this will serve your purpose.
    Regards,
    Ritwik.

  • Tranfering data from alv display to a transaction with table control.

    Hi all, 
    I am having some problem transfering data from my alv display to a trasaction which needs to display some values in a table control base on criterias which I have selected from my alv report.
    When selecting an entry in my alv report.
    1. The program should check whether there is an entry in a z table(already created), if so it retrieves data fro the z table base on the selected criteria.
    2.otherwise it search from the data from other tables and then saves it in the z table and display the values in the tc.
    my program is as follows.
    FORM button_click USING p_ucomm TYPE sy-ucomm
                            p_selfield TYPE slis_selfield.
      CASE p_ucomm.
        WHEN 'SALES'.
          READ TABLE gt_alvdisplay
          INDEX p_selfield-tabindex
          INTO gs_alvdisplay.
          SET PARAMETER ID:  *I dont know how to pass the para to the tc.....
          CALL TRANSACTION 'ztrans_test".
    ENDFORM.          
    Note: TC is already created and it retrieves data from the z table but am having prob just to pass the parameters.
    Ill be very grateful to you all

    Hello,
    Yes you can create text field without using screen painter as follows:
    PARAMETERS P1 TYPE CHAR12 MEMORY ID mid.
    Here, this code will create text box with name P1 and parameter id "mid"
    You can assign meaning text to p1 using menu link GO TO --> TEXT ELEMENTS --> SELECTION TEXTS.
    So before call transaction which contains this field you can write below statement.
    SET PARAMETER ID mid VALUE <value variable>.
    * Here vlaue variable is the variable from which you want to pass value to parameter id mid.
    Refer [SAP Help|http://help.sap.com/saphelp_nw70/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/frameset.htm] for more information.
    Hope this helps!
    Thanks,
    Augustin.

  • How to disable Material Picking MB26 from Reservation display MB23

    Hello guys
    I have to know that disable picking option from display menu reservation t-code MB23. One of our user issued a material from reservation display function selecting picking option from menu and saved that lead to MIGO by MB26 even user does not have MB26 transaction authorization.
    thanks in advance
    Nath

    Hi FC
    Thank u for replying my issue. I have already checked your 2nd option by basis authorization to prevent auh.object by a user. This auh.object is link to Inventory management MM_B that lead to M_MRES_BWA,  M_MRES_WWA,  and M_MRES_WMG. It could not possible remove this authorization because this required for other Inventory management/physical Invertory function like material transfer posting by plant, movt type, etc...
    Also I have checked SHD0 will prevent disable a screen by variant, but here MB23 not only have to enable picking by a single screen but also there further more drill down screens and everywhere picking function is available to issue material by t-code MB26 even user does not have authorization MB26
    I might have doubt about MB23 screen, why SAP enable this picking function (MB26) in display reservation MB23.
    Display screens menu can not enable (should invisible gray) any functional activities if that person does not have MB26 authorization.
    Thanks in advance you guys if anyone have reasonable inputs.
    Edited by: Nath Bahadur on Jan 11, 2012 1:56 PM

  • Block certain Pushbuttons from ALV display

    Hi Experts,
    I want to block a few of the pushbuttons(PB) in my ALV report such as the Graph PB or the ABC analysis PB.
    I have used REUSE_ALV_GRID_DISPLAY. Can any one tell me the fcodes i need to pass to IT_EXCLUDING to exclude them.

    Hi,
    Look at the below links
    http://www.howforge.com/taxonomy/term/4?page=1
    Re: Error when pressing the buttons in ALV
    http://www.howforge.com/abap-4-example-code-alv-list-by-fm-reuse-alv-list-display
    Regards
    Sudheer

  • Incorrect date is being saved in excelsheet downloaded from ALV display

    Hi ,
    When I use export to spreadsheet option in ALV display (function REUSE_ALV_DISPLAY )  then Delivery date 10.02.2011 is being saved as 402213(some number not date format) .
    Can you please suggest , what 's wrong in the report.
    Thanks in Advance.

    Hi,
    Just check your fieldcatalog.If all the fields are in right order and all.
    Genearlly excel download issues occur because of errors in Field Catalog.

  • 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

Maybe you are looking for