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

Similar Messages

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

  • 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

  • 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

  • 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

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

  • How to create/change layout grid in MIR7/MIRO

    Dear all,
    How to create/change layout grid in MIR7/MIRO??I want to change the order of the items table.
    Thx.
    Icuk Hertanto

    Check SAP  Note 315586 - MIRO: Creating and changing display variants for Step by Step guidance.

  • How do I change the image selected for the finalized movies pane in all events?

    How do I change the image selected for the finalized movies pane in all events? I made a movie some time ago in iMovie, and a still from this now appears as the image for Finalized Movies in the All Events pane (as well as showing up if I then click on this pane to take me to Finalized Movies). Anyone know how to change or delete this image, please?

    Unfortunately, the suggested solution in that thread does not work and the thread appears to be closed to replies.  That is, even though I am logged in the Reply|Quote|Mark as answer|Report as abuse items are missing.
    The suggested solution is:
    First, I found I had "img100.png" in  C:\Windows\Web\Screen  and
    C:\Windows\WinSxS\x86_microsoft-windows-themeui-client_31bf3856ad364e35_6.2.9200.16384_none_69ee3fa2269e545e
    1. Belonging to the Administrators Group, I replaced file Owner TrustedInstaller with my Username on both "img100.png" files
    2. After resizing the image I wanted to see on the Login screen to the resolution of "img100.png" file,
    I copied and pasted it to both "img100.png" files keeping this way the format (extension) and resolution of the original "img100.png" file,
    which I permanently deleted.
    However, I have not been able to replace the img100.pgn in C:\Windows\Web\Screen even after taking ownership of it and setting the permissions for my userid to All.  I edit it with mspaint and then try to save it. The save starts that then says the
    save was interrupted.
    The appears to be some additional protection besides the standard acls.
    http://www.saberman.com

  • How to add/change missing header lines in RNIF B2B?

    Hi all,
    We are using RNIF exchange protocol. We have sent invoice from BPEL to B2B. The message invoice reaches the trading partner but they are unable to process it or sent ack back as few header lines are missing in the RNIF envelope.
    Can anyone tell me or provide some pointers abt how to add/change missing header lines in B2B?
    These are the headers missing:
    Delivery header:
    <locationID> <Value>HostTradingPartner</Value> </locationID>
    Service Header:
    <messageStandard>
    <FreeFormText xml:lang="EN">PIDX</FreeFormText>
    </messageStandard> <standardVersion>
    <VersionIdentifier>1.0</VersionIdentifier>
    </standardVersion>
    Can anyone provide some inputs on this?

    As per RNIF standard, all these header elements (locationID in Delivery Header & messageStandard and standardVersion in Service Header) are optional. As you are using RossettNet over RNIF, so Oracle B2B might not be setting these headers.
    I do not have a 10g setup here so cann't test it. I would suggest you to raise a case with Oracle Support because PIDX is a non-RossettaNet standard and it's implementation in Oracle B2B will be different to RossettaNet implementation. Meanwhile, I would try the same in B2B 11g setup.
    Regards,
    Anuj

  • How do I change the row selection by mouse movement

    How do I change the row selection on a jtable by mouse over events?
    Thanks, Randy

    got it thanks...

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How to add the BexAnalyser as standard radio button to the add-ins?

    HI All,
    how to add the BexAnalyser as standard radio button to the add-ins.
    Thanks
    Vasu

    What do you want to do? Pls give some more details.

Maybe you are looking for

  • SO_NEW_DOCUMENT_ATT_SEND_API1 : How to use it to support multibyte

    Hi -, I am using SO_NEW_DOCUMENT_ATT_SEND_API1 to send excel file as an attachment . I am  able to submit in the excel file with both english & russian characters. But when i am recieving the same file in output, english characters are looking fine.

  • Sound stopped after installing hp dc7900 low profile video card

    i installed a  low profile video card on hpcompaq dc7100. since then the sound stopped working. anyway to uninstall the sound portion of the video card and use the computer's original sound card? or any other suggestion to have the computer see the n

  • Unable to update podcasts in iTunes 9 if all files are gone

    I updated to iTunes 9 today. I have discovered that if there are no episodes in a podcast, then I can't update the podcast. I have to leave at least one episode in there and then I can right click and select update podcast. If I delete all episodes a

  • Flash video encoder slow

    I'm trying to convert a 4.5 minute *.avi to *.flv and am having some difficulty. Flash Video Encoder says I have about 15.5 hours remaining (am 0.5 hours into the process). That seems wholly unreasonable given the fact that it took me all of maybe 5

  • Change aspect ratio

    My footage was shot in 4:3, captured in 16:9. Anyone able to help out - how can I easily change the footage to look like it was shot in 16:9, without getting squished? Need help asap!