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( ).

Similar Messages

  • 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

  • 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

  • How to add Change Layout, savelayout, select layout Button to ALV Toolba

    How to add Change Layout, savelayout, select layout Button to ALV Toolbar?
    Moderator message: please (re)search yourself before asking.
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    locked by: Thomas Zloch on Sep 10, 2010 10:57 AM

    Variant
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant          = gs_variant
                i_save              = c_save
              it_default_fieldcat =
           IMPORTING
                e_exit              = gf_exit
                es_variant          = gs_variant
           EXCEPTIONS
                not_found = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF gf_exit = space.
          cf_varia = gs_variant-variant.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save        = c_save
        CHANGING
          cs_variant    = gs_variant
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
      IF sy-subrc NE 0.
        cf_subrc = sy-subrc.
      ENDIF.
    Change Layout, savelayout, select layout Button  pass the value which is in BOLD
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                =  gd_repid
         i_callback_user_command           =  'U_COMMAND'
         i_callback_top_of_page            = 'TOP-OF-PAGE'
                         is_layout                    =  fld_lay
           it_fieldcat                  =  fieldcatalog[]
                       IT_EXCLUDING                  =
                       IT_SPECIAL_GROUPS             =
                       IT_SORT                        =  it_sort[]
         i_default                      = 'X'
         i_save                         = 'A'
         is_variant                     = gs_variant
         it_events                      =  it_event[]
        TABLES
          t_outtab                      =    it_sales
                     EXCEPTIONS
                       PROGRAM_ERROR                     = 1
                       OTHERS                            = 2
    Annasaheb

  • 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

  • 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

  • How to hide 'layout button' on ALV toolbar

    Hi,
    I have an ALV and it has standard toolbar, now i want to hide 'Layout button' from the toolbar based on specific condition e.g when flag = 1.
    How to do that.
    Thanks,

    If you are using the REUSE function, you can use the "EXCLUDING" parameter, and pass the FCODE for "Change Layout" to this table.  This will remove the icon from the toolbar.  Here is an example.
    REPORT rich_0001 .
    * Global ALV Data Declarations
    TYPE-POOLS: slis.
    * Internal Tables
    DATA: BEGIN OF ialv OCCURS 0,
          test1(10) TYPE c,
          test2(10) TYPE c,
          END OF ialv.
    DATA: xfc TYPE slis_fieldcat_alv.
    DATA: ifc  TYPE slis_t_fieldcat_alv.
    DATA: iexcluding TYPE  slis_t_extab.
    DATA: xexcluding LIKE LINE OF iexcluding.
    PARAMETERS: p_hide TYPE c DEFAULT 'X'.
    START-OF-SELECTION.
      REFRESH iexcluding.
    * If the user wants to hide the change layout icon, then add to IEXCUDING
      IF p_hide = 'X'.
        xexcluding-fcode = '&OL0'.
        APPEND xexcluding TO iexcluding.
      ENDIF.
      REFRESH ifc.
      xfc-reptext_ddic = 'Test1'.
      xfc-fieldname    = 'TEST1'.
      xfc-outputlen    = '10'.
      APPEND xfc TO ifc.
      xfc-reptext_ddic = 'Test2'.
      xfc-fieldname    = 'TEST2'.
      xfc-outputlen    = '10'.
      APPEND xfc TO ifc.
    * Call ABAP List Viewer (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_excluding = iexcluding
          it_fieldcat  = ifc
        TABLES
          t_outtab     = ialv.
    Regards,
    Rich Heilman

  • 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

  • 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

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

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

  • 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

  • How to add a custom button on Application Toolbar for ME21N, ME22N & ME23N

    Hi Experts,
    I am new to this forum. I hope someone will help me.
    My Requirement is as :
    I want to add a new custom button on Application Toolbar for ME21N, ME22N & ME23N.
    There are already standard buttons in this toolbar which is Document Overview On, Hold, Personal Settings etc.
    So after the 'personal settings' button i want add a new button and want to write a code which will open one custom screen.
    I am not able to find any exit for this....
    Please help...
    Thanks....

    Hey Buddies
    Try below BADI : ME_PROCESS_PO_CUST
    and check with required methods.
    1)PROCESS_ITEM
    2)CHECK
    3)POST
    Regards,
    Pranav

  • How to add 'Save Layout' button when use OO ALV?

    thx

    Hi,
    Try passing this parameter :
    <b>
    wa_variant-report     = sy-repid.</b>
    *-- Display Report
      CALL METHOD o_alvgrid->set_table_for_first_display
        EXPORTING
          it_toolbar_excluding    = lt_excl_func
    <b>      is_variant                   = wa_variant</b>
          i_save                        = c_a
          is_layout                    = p_layout
        CHANGING
          it_outtab                     = p_output[]
          it_fieldcatalog               = p_fieldcat[]
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                         = 2
          too_many_lines                      = 3
          OTHERS                               = 4.
      IF sy-subrc <> 0.
        MESSAGE i050 WITH text-004.    " Error in Displaying
        LEAVE LIST-PROCESSING.
      ENDIF.

  • Change layout button in ALV Grids

    Hi Experts,
    I have displayed 2 ALV grids in a single screen using OOPS concepts and I have activated the Save Layout option for both the Lists.
    Now whenever I will save the layout for the 1st list then automatically it is taken into consideration for the common fields in the second list as well.
    Please help me on how I can avoid changing the 2nd list if I will change the 1st list if possible.
    Thanks in advance..
    Regards,
    Srinivas
    Edited by: Srinivas Hari on Jun 23, 2009 10:07 AM

    Hello,
    I think u can achieve that by populating
    HANDLE
    LOG_GROUP fields of Disvariant structure in u r program.
    Regards

Maybe you are looking for