Add Change/Edit button in ALV

Hello Experts,
               How to insert the button in ALV grid toolbar. Now its showing Check,insert,append and delete button.How to add change or edit button in ALV ?
I'm using ALV componenet  SALV_WD_TABLE.
Thanks.

Hi Stars,
To achieve this, you have to two of ALV grid events. Use event TOOLBAR to add a button & event USER_COMMAND to implement a function.
In the method handling the toolbar event, we define a new button by filling a structure and appending it to the table attribute mt_toolbar of the object to whose reference we can reach via the parameter e_object of the event.
Example code snippet for your reference :-
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO i_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 'PER' TO ls_toolbar-function. "#EC NOTEXT
MOVE icon_display_text TO ls_toolbar-icon.
MOVE 'Passenger Info'(201) TO ls_toolbar-quickinfo.
MOVE 'Passenger Info'(201) TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled. "#EC NOTEXT
APPEND ls_toolbar TO i_object->mt_toolbar.
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.
Regards
Abhii

Similar Messages

  • Create change/edit button in ALV

    Hello Experts,
                   How to insert the button in ALV grid toolbar. Now its showing Check,insert,append and delete button.How to add change or edit button in ALV ?
    I'm using ALV componenet  SALV_WD_TABLE.
    Thanks.

    Hi,
    With the previous reply you can create the customized button.
    to make ALV editable or non editable(change or read only) the code to be written is:
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      DATA lo_value TYPE REF TO cl_salv_wd_config_table.
      lo_cmp_usage =   wd_this->wd_cpuse_alv_table( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      lo_interfacecontroller =   wd_this->wd_cpifc_alv_table( ).
      lo_value = lo_interfacecontroller->get_model( ).
    *lr_table_settings->set_read_only( abap_false ).*"you can  make it abap_true or abap_false based  to make
    the ALV editable or non editable
    Priya

  • How to add Change Layout Button to ALV Toolbar?

    Hi All,
    I am using a SAP GUI STATUS 'STANDARD' that has almost all the funcationality needed except for the change layout button.
    I have tried changing the GUI STATUS to 'STANDARD_FULLSCREEN' which has the button I am looking for but it does not show up.
    What am I missing to have the 'Change Layout' Button show on the toolbar?
    thank you

    I am using Classes.
    I did not specify any type of table of 'exclude' buttons.
    here is my code that display the ALV
    DATA gr_alv TYPE REF TO cl_salv_table.
    DATA gr_functions TYPE REF TO cl_salv_functions_list.
    DATA gr_selections TYPE REF TO cl_salv_selections.
    DATA gr_events TYPE REF TO cl_salv_events_table.
    DATA gr_settings TYPE REF TO cl_salv_display_settings.
    DATA gr_layout TYPE REF TO cl_salv_layout.
      TRY.
          cl_salv_table=>factory(
           IMPORTING r_salv_table = gr_alv
           CHANGING  t_table      = gt_rpt_details ).
          PERFORM f_display_settings.
          gr_alv->set_screen_status(
          "pfstatus = 'Z_STANDARD'
          pfstatus = 'ZSTANDARD_FULLSCREEN'
          report = sy-repid
          "i_save = 'A'
          set_functions = gr_alv->c_functions_all ).
          gr_events = gr_alv->get_event( ).
          "create layout object
          CREATE OBJECT gr_layout.
          gr_layout->get_current_layout( ).
          CREATE OBJECT event_handler.
          SET HANDLER event_handler->on_user_command FOR gr_events.
          gr_functions = gr_alv->get_functions( ).
          gr_functions->set_all('X').
          gr_functions->set_group_filter( value = if_salv_c_bool_sap=>false ).
    *       Set print preview
          gr_functions->set_print_preview( ).
          gr_alv->get_display_settings( ).
          gr_alv->display( ).

  • Hide Change Layout Button in ALV report o/p for MB52 Tcode

    Hi,
    Is it possible to Hide Change Layout Button in ALV output for Report MB52 using authoriztaion.
    We have created a layout in which we are hiding some coloumns which the user should not see.
    But if the change layout button is active then the user can add those coloumns to output.
    Is this possible through authorizations. I want to avoid doing any chnages to the std sap program.
    Thanks & Regards,
    Fawaz

    Check the object S_ALV_LAYO

  • Change layout Button In ALV Grid

    Hi all,
    I have a requirement where I am creating Field Catalogue from Z Table(has 60 fields) for few(12) fields.
    The user would like to have the option to add more fields by changing the Layout. But I dont see the Fields in Hidden Column when I click the Change Layout Button in ALV Toolbar. It just displays the Field based on Field Catalogue defined.
    Is there a way I can maintain all the fields without being displayed in ALV initally and letting the user select the hidden fields as per their requirement. As happens in SE16 where we can select the fields to be displayed.
    Thanks for the support.

    Hi Abhilasha,
    In the reuse_alv function module we can see a field I_SAVE.If you pass this as 'X' then the option of saving the layout variants are available.
    Create a layout by,selecting just the fileds required for display and set it as the default variant.It can be made Global or user-specific.But  we need to declare all fields in the fieldcatalog.
    So if the default variant is set,everytime the program is run it shows only the fields selected in it but can select more form the change layout option.
    Hope it helps.
    Regards
    Byju

  • What is the constant name for Change layout Button in ALV Grid ABAP Objects

    Dear All,
    I have one query please help me.
    what is the constant name for Change layout Button in ALV Grid ABAP Objects.
    With Rgds,
    Babu

    Halo Vinod,
    The consant name is cl_gui_alv_grid=>mc_fc_current_variant.
    Regards
    Arshad

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

  • Activity in PCUI : how to add display/edit button?

    Hi Gurus,
    I am new to BSP and Portal. We are using EP 5.0 for activity management. We have a requirement where the activity once saved (in create mode) should be made display only. Currently it stays in edit mode and if the user doesn't back out from there, no one else can use that activity.
    I was wondering if there is an option to make this as display only once the activity is saved.
    Also, when I do the activity search and select an entry from the search result, it is by default in edit mode. Is there a way I can make this display only and add a button to change it to edit mode?
    This is SAP delivered BSP application CRMD_BUS000126 for activities. I would like to know if the standard application provides an option to have a Change/display button. I looked in the blueprint tables and don't see any events for display or change. Only create, save and print are the buttons currently available in the OIC2 search result area.
    Also, once the activity is saved, I would like to make it display only similar to SAPGUI, so that the user doesn't have to back out of the screen for others to be able to use it.
    I was thinking above requirement should have been a standard one and SAP should have something for this out of the box. If not, please let me know the steps. We need this functionality added pretty quick, so any help you can provide me on this would be greatly appreciated.
    Thanks,
    Chandrika

    Dear Chandrika,
      Unfortunately the functionalities expected by you were not available in the standard PCUI.We checked with SAP and they informed us to raise a development request for the same.
      Read only mode is controlled by the PCUI framework so with every PCUI application not just with activities.
    But you have achieve this by adding code for locking in the READ method of Class CL_CRM_BSP_AM_HEADFM_1O.
    Thanks and Regards,
    Abdul Raheem S

  • How to add a push button in ALV Grid Top-of-page

    Is it possible to add a push button to the top-of-page in Alv grid display?if yes, then how? I am not using OO ABAP and am using reuse_alv_grid_display with top-of-page event.

    Hi,
    I am not sure whether we can add push button in top-of -page or not. But instead of that if you want to add button on toolbar as per your requirement then follow below link. it will useful.
    http://www.sap-img.com/abap/example-of-a-simple-alv-grid-report.htm
    Ram.

  • 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 add excel download button to ALV grid toolbar?

    Hi,
        Im generating ALV output through the method "SET_TABLE_FOR_FIRST_DISPLAY".But in the output,I cant see a direct excel download button,just like how it used to come when we use FM "REUSE_ALV_GRID_DISPLAY". Here, the excel download option comes as part of a drop down on top.But is there any way that I can have a separate excel download button which will be more user friendly for the customer?
    Thanks,
    Mahesh

    Create your own GUI status and add a push button there. In PAI write code for Excel download for that button.
    Regards,
    Amit

  • HT201401 I don't have the add or edit buttons on my iPhone 4 contact list.

    I don't have the add or edit contact buttons at the top of my contact list either in the phone contacts or the contact book.  Is there a way to turn the buttons on.

    If you are using icloud, go to settings - iclouds - contacts - on.

  • Why miss change layout button in ALV report

    Hello Experts,
    I have strange problem, I run the same transaction two times, one I have the change layout button but another I miss it...
    Anything control this button?
    thanks a lot for your help!

    Hi,
    Is this standard Tcode or customized Tcode?
    If it is standard tcode, what is the tcode?
    If it is customized tcode, can you post some code for us to analyse?
    Thanks.
    Regards,
    Keng Haw

  • How can I add an edit button to my tray?

    My iphoto menu does not include and editing button. Can someone help me find/install it? TKU

    No.  When you ran iPhoto the next time a new preference file was created.
    Open iPhoto's General preference pajne and set iPHoto to edit in the main window.
    Then double click on the thumb nail to enter the edit mode where the edit tools are located at the bottom of the window.
    When you crop a photo set the constrain menu to the size you want, adjust the crop area and then click on the Crop button. Then click on the Done button.  That will save the crop.

  • How to change edit  button

    Hi Friends,
    I am adding a new page to my sample test apps AnyCo Corp. the new page has edit button (a pencil and paper icon).
    But when I run the page, I saw that its not the same edit icon as the other pages. i tried to edit the pages
    again and click on BUTTONS region, but i cannot see any edit icons there.
    Where do I search this edit icon please.
    Thanks a lot

    Hi,
    Go to the button definition and use the following settings:
    Button Style: Image
    Button Image: #IMAGE_PREFIX#xxxxx.xxx
    Where xxxxx.xxx is the image name. These images are stored in the /i/ folder on the server. For a list of the ones that were available to me on my OTN workspace, see: [http://htmldb.oracle.com/pls/otn/f?p=45958:21].
    Andy

Maybe you are looking for