Reg ALV toolbar

Hi Friends,
  I am developing Report in ALV, Requirements is
   1) Consider  checkbox  for  every line item
   2) need additional  two pushbutton  'Select all ' and Deselect all on the Tool bar
Please send sample code,
Thanks

Hi,
You can add push buttons in the application toolbar..
Go to SE41...
Press copy status..(Ctrl + F6)
Frm
Program SAPLKKBL
Status STANDARD
to
Program Y_TEST_PROGRAM "GIve your program.
Status TEST2
Press Copy..
Then go to change mode..And give function codes in the application tool bar..
Then check this program of how to display the new status..Marked in bold..
TYPE-POOLS: slis.
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
DATA: s_layout TYPE slis_layout_alv.
DATA: BEGIN OF itab OCCURS 0,
icon TYPE icon-id,
vbeln TYPE vbeln,
kunnr TYPE kunnr,
erdat TYPE erdat,
box TYPE c,
END OF itab.
DATA: v_repid TYPE syrepid.
START-OF-SELECTION.
Get the data.
SELECT vbeln kunnr erdat UP TO 100 ROWS
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE itab.
IF sy-subrc <> 0.
MESSAGE s208(00) WITH 'No data found'.
LEAVE LIST-PROCESSING.
ENDIF.
Modify the record with red light.
itab-icon = '@0A@'.
MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.
v_repid = sy-repid.
Get the field catalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'ICON'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-seltext_l = 'Status'.
s_fieldcatalog-icon = 'X'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'VBELN'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'KUNNR'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'KUNNR'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'ERDAT'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'ERDAT'.
APPEND s_fieldcatalog TO t_fieldcatalog.
Set the layout.
s_layout-box_fieldname = 'BOX'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
is_layout = s_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = t_fieldcatalog[]
TABLES
t_outtab = itab.
FORM SET_PF_STATUS *
--> EXTAB *
FORM set_pf_status USING extab TYPE slis_t_extab.
<b>SET PF-STATUS 'TEST2'.</b>
ENDFORM.
FORM user_command *
--> UCOMM *
--> SELFIELD *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
Check the ucomm.
IF ucomm = 'DETAIL'.
LOOP AT itab WHERE box = 'X'.
itab-icon = '@08@'.
MODIFY itab TRANSPORTING icon.
ENDLOOP.
ENDIF.
selfield-refresh = 'X'.
ENDFORM.
Thanks,
Naren

Similar Messages

  • Add on custom button to ALV toolbar in std tcode ME51N, ME52N and ME53N.

    Hi All,
    I have the requirement to add on the custom button to ALV toolbar in ITEM OVERVIEW for standard transaction ME51N, ME52N and ME53N. Does anyone know what enhancement point or user exit i should apply and how i can add on the custom button?
    Thanks.

    There are no user exits or badi's for COOIS. You may have to make copy of the PPIO_ENTRY to ZPPIO_ENTRY including all the varians without changing their names like copy SAP&COOIS to SAP&COOIS. Create a T-Code ZCOOIS and replace COOIS in variant SAP&COOIS to ZCOOIS not in the name of the variant but in the field "Check Authorization for".
    The PF-Status is found in the include LCOISOUTPUTF16 which is located in the function group COISOUTPUT you may have to copy that too. Finally you need to copy SAPLCOISOUTPUT with its GUI status GENERAL and add your custom button there.

  • ALV Toolbar related Query

    Hi,
    When using FM 'REUSE_ALV_GRID_DISPLAY'
    Exporting Parameters : I_CALLBACK_PF_STATUS_SET 
    in SET PF Status Creating additional Buttons.
    In ALV Report output addition  additional buttons are coming
    but Standard ALV Toolbar are missing like Sort Assending ,Descending,Total,Subtotal,
    Layouts.
    Please give any Suggestions for Standard toolbar as well as additional buttons to display
    by using FM 'REUSE_ALV_GRID_DISPLAY'.
    Thanks,
    Manish

    Hi,
    Check this subroutine in example program :
    BCALV_TEST_FULLSCREEN_CALLS
    form f01_event_pf_status_set using rt_extab type slis_t_extab.
      set pf-status 'STANDARD_FULLSCREEN' excluding rt_extab.
    endform.                   " f01_event_pf_status_set
    regards,
    Advait

  • Menu Button in ALV toolbar (multiple choices for a button)

    Hi abapers,
    I would like to have a button with multiple choices in the toolbar;
    at the moment I have created a menu button with just one function.
    Here is my code:
    CLASS lcl_event_receiver (Definition)
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver (Implementation)
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
        DATA: ls_toolbar  TYPE stb_button.
    *Separator
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    *Button
        CLEAR ls_toolbar.
        MOVE 1 TO ls_toolbar-butn_type.
        MOVE 'EDIT' TO ls_toolbar-function.
        MOVE icon_change TO ls_toolbar-icon.
        MOVE ' Modifica'(l02) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        MOVE 'Modifica' TO ls_toolbar-quickinfo.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION

    hi,
    check this code and reward me if it helps you..
    TYPE-POOLS : slis,icon.
    *Structure declaration for tcodes
    TYPES : BEGIN OF ty_table,
            tcode TYPE tcode,
            pgmna TYPE progname,
            END OF ty_table.
    *Structure for tocde text
    TYPES : BEGIN OF ty_itext,
            tcode TYPE tcode,
            ttext TYPE ttext_stct,
            sprsl TYPE sprsl,
            END OF ty_itext.
    *Structure for output display
    TYPES : BEGIN OF ty_output,
            tcode TYPE tcode,
            pgmna TYPE progname,
            ttext TYPE ttext_stct,
           END OF ty_output.
    *internal table and work area declarations
    DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
           it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
           wa_table TYPE ty_table,
           wa_output TYPE ty_output,
           wa_ittext TYPE ty_itext.
    *Class definition for ALV toolbar
    CLASS:      lcl_alv_toolbar   DEFINITION DEFERRED.
    *Declaration for toolbar buttons
    DATA : ty_toolbar TYPE stb_button.
    Data declarations for ALV
    DATA: c_ccont TYPE REF TO cl_gui_custom_container,   "Custom container object
          c_alvgd         TYPE REF TO cl_gui_alv_grid,   "ALV grid object
          it_fcat            TYPE lvc_t_fcat,            "Field catalogue
          it_layout          TYPE lvc_s_layo,            "Layout
          c_alv_toolbar    TYPE REF TO lcl_alv_toolbar,           "Alv toolbar
          c_alv_toolbarmanager TYPE REF TO cl_alv_grid_toolbar_manager.  "Toolbar manager
    *Initialization event
    INITIALIZATION.
    *Start of selection event
    START-OF-SELECTION.
    *Subroutine to get values from tstc table
      PERFORM fetch_data.
    *subroutine for alv display
      PERFORM alv_output.
          CLASS lcl_alv_toolbar DEFINITION
          ALV event handler
    CLASS lcl_alv_toolbar DEFINITION.
      PUBLIC SECTION.
    *Constructor
        METHODS: constructor
                   IMPORTING
                     io_alv_grid TYPE REF TO cl_gui_alv_grid,
    *Event for toolbar
        on_toolbar
           FOR EVENT toolbar
           OF  cl_gui_alv_grid
           IMPORTING
             e_object.
    ENDCLASS.                    "lcl_alv_toolbar DEFINITION
          CLASS lcl_alv_toolbar IMPLEMENTATION
          ALV event handler
    CLASS lcl_alv_toolbar IMPLEMENTATION.
      METHOD constructor.
      Create ALV toolbar manager instance
        CREATE OBJECT c_alv_toolbarmanager
          EXPORTING
            io_alv_grid      = io_alv_grid.
       ENDMETHOD.                    "constructor
      METHOD on_toolbar.
      Add customized toolbar buttons.
      variable for Toolbar Button
          ty_toolbar-icon      =  icon_generate.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button1'.
          APPEND ty_toolbar TO e_object->mt_toolbar.
          ty_toolbar-icon      =  icon_voice_output.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button2'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
         ty_toolbar-icon      =  icon_phone.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button3'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
         ty_toolbar-icon      =  icon_mail.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button4'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
       ty_toolbar-icon      =  icon_voice_input.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button5'.
         APPEND ty_toolbar TO e_object->mt_toolbar.
      Call reorganize method of toolbar manager to
      display the toolbar
         CALL METHOD c_alv_toolbarmanager->reorganize
          EXPORTING
            io_alv_toolbar = e_object.
       ENDMETHOD.                    "on_toolbar
    ENDCLASS.                    "lcl_alv_toolbar IMPLEMENTATION
    *&      Form  fetch_data
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .
    Select the tcodes upto 200 rows from TSTC
       SELECT   tcode
               pgmna
               FROM tstc
               INTO CORRESPONDING FIELDS OF TABLE it_table
               UP TO 200 ROWS
               WHERE dypno NE '0000'.
    *Select the tcode textx
       IF it_table[] IS NOT INITIAL.
         SELECT ttext
               tcode
               sprsl
               FROM tstct
               INTO CORRESPONDING FIELDS OF TABLE it_ittext
               FOR ALL ENTRIES IN it_table
               WHERE tcode = it_table-tcode
               AND sprsl = 'E'.
       ENDIF.
    Apppending the data to the internal table of ALV output
       LOOP AT it_table INTO wa_table.
        wa_output-tcode = wa_table-tcode.
        wa_output-pgmna = wa_table-pgmna.
       For texts
        READ TABLE it_ittext INTO wa_ittext WITH KEY tcode = wa_table-tcode.
        wa_output-ttext = wa_ittext-ttext.
         APPEND wa_output TO it_output.
        CLEAR wa_output.
       ENDLOOP.
       ENDFORM.                    " fetch_data
    *&      Form  alv_output
          text
    -->  p1        text
    <--  p2        text
    FORM alv_output .
    *Calling the ALV
      CALL SCREEN 0600.
      ENDFORM.                    " alv_output
    Calling the ALV screen with custom container
    On this statement double click  it takes you to the screen painter SE51.Enter the attributes
    *Create a Custom container and name it CC_CONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    Now a normal screen with number 600 is created which holds the ALV grid. PBO of the actual screen , Here we can give a title and *customized menus
    *&      Module  STATUS_0600  OUTPUT
          text
    MODULE status_0600 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    calling the PBO module ALV_GRID.
    *&      Module  ALV_GRID  OUTPUT
          text
    MODULE alv_grid OUTPUT.
    *create object for custom container
      CREATE OBJECT c_ccont
           EXPORTING
              container_name = 'CC_CONT'.
    *create object of alv grid
      CREATE OBJECT c_alvgd
          EXPORTING
              i_parent = c_ccont.
    create ALV event handler
      CREATE OBJECT c_alv_toolbar
        EXPORTING
          io_alv_grid = c_alvgd.
    Register event handler
      SET HANDLER c_alv_toolbar->on_toolbar FOR c_alvgd.
    Fieldcatalogue for ALV
       PERFORM alv_build_fieldcat.
    ALV attributes FOR LAYOUT
      PERFORM alv_report_layout.
       CHECK NOT c_alvgd IS INITIAL.
    Call ALV GRID
       CALL METHOD c_alvgd->set_table_for_first_display
        EXPORTING
          is_layout                     = it_layout
        CHANGING
          it_outtab                     = it_output
          it_fieldcatalog               = it_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDMODULE.                 " ALV_GRID  OUTPUT
    *&      Form  alv_build_fieldcat
          text
         <--P_IT_FCAT  text
    FORM alv_build_fieldcat.
       DATA lv_fldcat TYPE lvc_s_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '1'.
      lv_fldcat-fieldname = 'TCODE'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 8.
      lv_fldcat-scrtext_m = 'TCODE'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
       lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '2'.
      lv_fldcat-fieldname = 'PGMNA'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'PROGNAME'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '3'.
      lv_fldcat-fieldname = 'TTEXT'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 60.
      lv_fldcat-scrtext_m = 'Description'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
    ENDFORM.                    " alv_build_fieldcat
    *&      Form  alv_report_layout
          text
         <--P_IT_LAYOUT  text
    FORM alv_report_layout.
       it_layout-cwidth_opt = 'X'.
       it_layout-zebra = 'X'.
    ENDFORM.                    " alv_report_layout
    PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes
    *and based on the user command we can do the coding.
    *&      Module  USER_COMMAND_0600  INPUT
          text
    MODULE user_command_0600 INPUT.
    ENDMODULE.                 " USER_COMMAND_0600  INPUT
    thanks,
    gupta

  • Add a button choice on alv toolbar in wd4a

    Hy everyone i've to add a button choice on alv toolbar. I create a node 'MY_TOOLBAR_FUNCTIONS' where add node and attributes to bind in external mapping in function_elements of alv interface controller.For button_choice I made a node 'CHOICE' and attribute 'WA_VALUE' type string. But the application dumps when create object lr_choice ; the error is WebDynpro Exception: IDs Can Only Contain Characters of Syntactical Character Set .
    May you help me? Thanks in advance.
    data:  ls_choice TYPE ig_componentcontroller=>element_choice,
              nd_choice TYPE REF TO if_wd_context_node,
    nd_choice = nd_my_functions->get_child_node( name = wd_this->wdctx_choice ).
      el_choice = nd_choice->get_element(  ).
    ls_choice-wa_value = '01'.
      APPEND ls_choice TO lt_choice.
      nd_choice->bind_table( lt_choice ).
      DATA:lr_button_choice TYPE REF TO cl_salv_wd_fe_button_choice.
      DATA:lr_choice TYPE REF TO cl_salv_wd_menu_action_item.
      lr_function = l_value->if_salv_wd_function_settings~create_function_right( id = 'MYBUTTONCHOICE' ).
      CREATE OBJECT lr_button_choice.
              EXPORTING
                sel_action_item_elementname = 'CHOICE.WA_VALUE'.
      lr_button_choice->set_text( value = 'Filter' ).
      lr_button_choice->set_tooltip( value = 'Filter').
      lr_button_choice->set_sel_action_itm_elementname( 'CHOICE.WA_VALUE' ).
      CREATE OBJECT lr_choice
        EXPORTING
          id = ls_CHOICE-WA_VALUE.
      lr_choice->set_text( 'Esito Positivo' ).
      lr_choice->set_image_source( value = 'ICON_GREEN_LIGHT').
      lr_button_choice->add_choice( lr_choice ).
      lr_function->set_editor( lr_button_choice ).

    in   CREATE OBJECT lr_choice the object id have to refer to name of node.
      CREATE OBJECT lr_choice
         EXPORTING
           id = 'CHOICE'.

  • How to add a dropdown box in an ALV  toolbar??

    hi,
       i have a requirement where i need to add a dropdown box in my ALV Toolbar. To be precise next to the export button in my ALV.
    Plz help me on this, thanks.

    Hi Frank,
    I am providing the some peice of code which will be helpful to you.
    Adding the DropDown list to the ALV toolbar:
    lr_functions ?= wd_this->r_table.
    lr_function = lr_functions->create_function( 'MYDROPDOWNBYINDEX' ).
    create object lr_dropdown_by_idx
    exporting
    texts_elementname = 'DROPDOWNBYINDEX.VALUE'.
    lr_dropdown_by_idx->set_label_text( 'MYDROPDOWNBYINDEX' ).
    lr_function->set_editor( lr_dropdown_by_idx ).
    Providing the values to that DropDown:
    Here in my example DROPDOWNBYINDEX.VALUE is the context attrubute. And i write the Supply function for that node as follows:
    data:
    lt_dropdownbyindex type if_componentcontroller=>elements_dropdownbyindex,
    ls_dropdownbyindex type if_componentcontroller=>element_dropdownbyindex.
    ls_dropdownbyindex-value = 'Nothing'. "#EC NOTEXT
    append ls_dropdownbyindex to lt_dropdownbyindex.
    ls_dropdownbyindex-value = 'ActionDropdownByIndex'. "#EC NOTEXT
    append ls_dropdownbyindex to lt_dropdownbyindex.
    node->bind_table( lt_dropdownbyindex ).
    For reference you can refer the WD component SALV_WD_TEST_TABLE_TOOLBR which holds the same code
    Hope this will help you. Reward points if it helps.
    Cheers,
    Darshna.

  • How to create multiple buttons in ALV Toolbar in Webdynpro ABAP

    Hi all,
    I am trying to create multiple buttons in Webdynpro  ALV toolbar, please go through the code.
    What happening is, second button is replacing the first one.
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
       lo_cmp_usage =   wd_this->wd_cpuse_alv_table( ).
       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_alv_table( ).
        DATA lv_value TYPE REF TO cl_salv_wd_config_table.
       lv_value = lo_interfacecontroller->get_model(
       DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
       DATA lr_buttonui2 TYPE REF TO cl_salv_wd_fe_button.
       DATA button1 TYPE REF TO cl_salv_wd_function.
       DATA button2 TYPE REF TO cl_salv_wd_function.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).
    How can I overcome this??
    Thanks
    Eshwar

    Hi Eshwar,
    The button Ids are same for both the buttons in your code. You need to change it as BUTTON1, BUTTON2.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON1')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON2' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).

  • How to display standard ALV toolbar function in Webdynpro ABAP

    Hi All,
    Could any one please let me know that how to display the standard ALV functions. What I tried is as follows:
    data :lr_config_table type ref to cl_salv_wd_config_table.
    data lr_function type ref to cl_salv_wd_function_std
    Got the reference by calling the get_model().
    Now tried to display a standard button say :
      CALL METHOD lr_config_table ->if_salv_wd_function_settings~get_function_std
        EXPORTING
          id    = 'SALV_WD_INPUT_INSERT_ROW'
        RECEIVING
          value = lr_function.
      CALL METHOD lr_function->set_visible
        EXPORTING
          value = cl_wd_uielement=>e_visible-visible.
    But I can't see the button added to my ALV toolbar! Could any one please help me out on this if I am missing something.
    Many Thanks!
    Somnath

    Hi..
    ALV report which when displayed normally allows users to insert and delete rows using the methods below from class Cl_Salv_Wd_Config_Table:
    I think add these lines to your code and check..
    IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY (false)
    IF_SALV_WD_STD_FUNCTIONS~SET_EDIT_INSERT_ROW_ALLOWED (true).
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv_basic( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv_basic( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      l_table->if_salv_wd_table_settings~set_read_only( abap_false ). 
      l_table->if_salv_wd_std_functions~set_edit_append_row_allowed( abap_false ).
      l_table->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
      l_table->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_false ).
    Cheers,
    Kris.

  • In OO Alv toolbar, sum and subsum buttons are disable as default, WHY ?

    i want to enable sum and subsum buttons in alv toolbar. However, as default those buttons are disable. How can i solve ?

    i defined ref_table and ref_field for quantity field in fieldcat  such as  
    ls_fcat-ref_table = 'V03RB'.
    ls_fcat-ref_field = 'KWMENG'.
    so i solve it. thank you for your help.

  • Column-clipping behavior of FIND from SAP-delivered ALV toolbar

    I have an ALV display whose rows start with three short columns followed by one pretty long column.
    The customers want to use the FIND button from the standard SAP ALV toolbar to search for substrings in the text that's in the long column.
    The find is working fine, but when the result is displayed, the layout is clipped so that only the long text column shows.  Furthermore, you can't window to see the three leading columns - it's like a different display.
    Is there an SAP-delivered parameter that will successfully tune this behavior so that the result of the FIND uses the original layout?
    If not, has anyone written a custom FIND implementation that will not behave this way ???
    Thanks
    djh

    I've learned that this can be eliminated by right-clicking the ALV container anywhere and selecting "optimize width".
    I've started a separate question about whether this option can be preset.
    Dave

  • ALV Toolbar on modal dialog screen and toolbar on text edit control

    Hello,
    I have created one container and producing ALV Grid output on a modal dialog screen. i do not want the ALV Toolbar to appear on this screen. How can I hide it ?
    ALso I need to hide some buttons on a Text edit control. How can I hide them ?
    Thanks and rgds,
    Anand

    Hi,
    To exclude some Toolbar functions, please do the below
    DATA:
    lt_toolbar_excl TYPE ui_functions.
      Exclude Some toolbar functions
        APPEND cl_gui_alv_grid=>mc_fc_detail         TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_info           TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_graph          TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_view_crystal   TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_loc_delete_row TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_loc_append_row TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_loc_insert_row TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_loc_copy_row   TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_loc_undo       TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_check          TO lt_toolbar_excl.
        APPEND cl_gui_alv_grid=>mc_fc_refresh        TO lt_toolbar_excl.
    And Pass the lt_toolbar_excl to the ALV object
    Display
      CALL METHOD go_alv_grid->set_table_for_first_display
        EXPORTING
          is_variant           = ls_variant
          is_layout            = ls_alv_lay
          is_print             = ls_print
          i_save               = 'A'
          it_toolbar_excluding = lt_toolbar_excl
        CHANGING
          it_sort              = lt_sort
          it_outtab            = gt_user[]
          it_fieldcatalog      = lt_alv_cat.
    Hope this helps you.
    Thanks,
    Ruthra

  • Creation of icon in alv toolbar

    Hi All,
    i need to create a icon in alv toolbar.
    But i have not created any 'Z' program.
    i have created one function module, through that function module i am displaying the ALV grid.
    when i am copying the standard pf-status it is asking for program name. but i am using only the function module.
    pls help me on this for creating the icon in alv toolbar.
    thanks in advance.

    Hello Aishvarya,
    Perhaps the code below will help guide you along.
    FUNCTION z_alv_screen .
    *"*"Local Interface:
    *"  CHANGING
    *"     REFERENCE(ITAB) TYPE  ZSFLIGHT_TT
      DATA: gr_table TYPE REF TO cl_salv_table.
    * ALV
    *... Create Instance
      TRY.
          CALL METHOD cl_salv_table=>factory
            IMPORTING
              r_salv_table = gr_table
            CHANGING
              t_table      = itab[].
        CATCH cx_salv_msg.
      ENDTRY.
      gr_table->set_screen_status(
                  pfstatus      =  'SALV_STANDARD'
                  report        = 'SAPLZRAE'
                  set_functions = gr_table->c_functions_all ).
    *... Display Table
      gr_table->display( ).
    ENDFUNCTION.
    Edited by: Rae Ellen Woytowiez on Mar 21, 2011 5:17 PM

  • Applying ALV toolbar button funtionality in user developed button .

    Can any body tell me the step by step approch of getting  ALV toolbar button funtionality in user developed button in application toolbar ?  That is i develop one button on application toolbar and on click on this i want any one toolbar button  funtionality  on my developed button . how can i do this?

    Hi,
    To create a button on ALV list display, Like to create a "BACK" button on your ALV tool bar,, you need to first define & create a pf status then call it in your REUSE.. fm,,
    below code will explain you all the things,,
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program       = sy-repid
            i_callback_pf_status_set = 'SET_PF_STATUS'   
            i_callback_user_command  = 'USER_COMMAND'
            i_grid_title             = text-001
            is_layout                = s_layout
            it_fieldcat              = i_fcat
            i_save                   = lf_save
            is_variant               = s_disvariant
          TABLES
            t_outtab                 = i_pernr[]
          EXCEPTIONS
            program_error            = 1
            OTHERS                   = 2.
    *       FORM USER_COMMAND                                             *
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN 'BACK'.
          leave to screen 0.
      ENDCASE.
    ENDFORM.                    "user_command                              " USER_COMMAND
    * Form Set_pf_status
    * Notes: Called by FM REUSE_ALV_GRID_DISPLAY
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'BACK_BUTTON'.
    ENDFORM. "Set_pf_status
    First you shuld to create a GUI status for your screen dispalying the list (For this copy a GUI status from a standard program and paste it in 'BACK_BUTTON')
    then in Application Toolbar ,, Just create a button as BACK ,, Keep the FUNCTION CODE as BACK ..
    I think you got the idea, how to use any GUI for ALV list ..

  • Buttons on ALV toolbar

    Hi all,
    I have developed an ALV Grid with a button SAVE.
    The list that is displayed in ALV  will be saved to ZTABLE when user clicks the SAVE button.
    My requirement is after that , I need to add a DISPLAY to the same ALV GRID TOOLBAR.
    How can I do it? do I have to CALL METHOD g_grid->set_table_for_first_display again?
    Thanks
    MH

    Hello
    The sample report for dealing with ALV toolbar buttons is BCALV_GRID_05.
    I assume that as long as your ALV grid is editable the user should see the SAVE button. As soon as the user has saved the data the grid changes to Display-only (non-editable) and the DISPLAY button should appear.
    If so then you can use method go_grid->IS_READY_FOR_INPUT( ) within the event handler method handle_toolbar.
    The sample report explaining this method is BCALV_EDIT_01.
    Regards
      Uwe
    PS: There is no need to call go_grid->set_table_for_first_display again, simply use go_grid->refresh_table_display.

  • Add a button choice on alv toolbar in wda

    Hello Experts,
    I want add a button choice on alv toolbar. I already insert the choice button indeed I see the button correctly.
    Now I want insert the list of action with the following code:
    <<
    >>
    With this code my web-interface retuns this message: "500 SAO INTERNAL SERVER ERROR. ERROR ACCESS via null object reference not possible. (termination rabax_state)". The dump is in "cl_wdr_utilities=>construct_mime_url".
    Do you have any ideas? Do you have any examples?
    Thanks in advance.
    Best Regards,
    Marino

    Hello,
    the problem isn't "the line set_image_source". The problem was the order, the correct order is:
    <<
    CREATE OBJECT lr_button_choice.
         lr_button_choice->set_image_source( 'ICON_CHANGE' ).    "#EC *
         lr_button_choice->set_text( value = 'Modifica' ).
         lr_button_choice->set_tooltip( value = 'Modifica Attributi').
    CREATE OBJECT lr_menu_action_item
           EXPORTING
             id = 'MOD_NOTE'." TYPE REF TO cl_salv_wd_menu_action_item.
         lr_menu_action_item->set_text( 'Note').
         lr_button_choice->add_choice( EXPORTING  value = lr_menu_action_item ).
         CREATE OBJECT lr_menu_action_item
           EXPORTING
             id = 'MOD_CONTO'." TYPE REF TO cl_salv_wd_menu_action_item.
         lr_menu_action_item->set_text( 'Conto').
         lr_button_choice->add_choice( EXPORTING  value = lr_menu_action_item ).
         lr_function = wd_this->salv_incassi->if_salv_wd_function_settings~create_function( id = 'MOD')."creating the function for alv button
         lr_function->set_editor( lr_button_choice ).
    >>
    Thanks very much.
    Best Regards,
    Marino

Maybe you are looking for

  • How to identify what role was deleted in SUIM report ?

    Dear all, Whenever a role is deleted, in SUIM --> change document of a user, it only shows the profile name, based on the profile name we can't figure out what role was it. Any solution for this ? Your advice and comment will be appreciated. Thanks.

  • [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

    Sometimes (only sometimes) Arch Linux will have an error during bootup because my Linux drive gets mounted as sdb instead of sda. My NTFS Sata storage drives gets mounted in its place as sda. When this happens, Arch Linux will stop booting at the "ch

  • Just migrated to a new air - library is there, but doesn't show in iPhoto

    how do I connect my iphoto library to iphoto - everything imported over fine, though the old computer was running iphoto 7.15 and the air has version 9

  • R/3 extraction to BW

    Hi , My requirement is to define inventory,so i using R/3 I'm doing R/3extraction to BW,forthis i want to use extractors.where it is in r/3 or in BW is using to get extractors list..i want T.Code of this in R/3 and BW.. If any body help on this .. re

  • Reports -- Creation for the Scenarios Mentioned

    Hi All: I need to create a Report and Dash Board using the following scenarios as mentioned below, Please let me know the procedure for the same. Region Wise Lead Reports 1 Region 2 Lead amount 3 No of leads 4 Subtotal 5 Grand total Top 10 Performer