Change default variant in ALV grid on runtime

Hello colleagues,
where is the place in a code (CL_ALV_VARIANT, CL_GUI_ALV_GRID, ...) where I can change the deault layout. Customer require a modification which change default layout in ALV under specific circumstances.
Kind regards
Radim Benek

It depend when these "specific circumstances" are occurring?
Before displaying the ALV, then force the value of the variant used in set_table_for_first_display,
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
  EXPORTING
    I_STRUCTURE_NAME = 'SFLIGHT'
    IS_VARIANT = GS_variant
    I_SAVE = X_SAVE
  CHANGING
    IT_OUTTAB = GT_SFLIGHT.
If you want to simulate multiple "default variant" you should "mislead" the ALV by changing the report name used for storing variant (IS_VARIANT-REPORT) But in this case you will no longuer see every variant  when in the ALV, only those of the "report name" passed when setting for first display.
Regards

Similar Messages

  • Issues in Change layout Variant of ALV grid

    Hi all,
    I am using a ALV gird to display the data with some table column. I am able to save/ choose the Layout variant. I choose the existing layout varaint it works fine but when I change the column fields display from selected layout then it will immidiately looks fine, but if I perform some event, it goes to the initial stage of the choosed layout varaint.
    I can solve this issue if I clear the Variant from the is_variant (of set_table_for_first_display method). So if I can find the fieldcatalog for layout Variant, then it will solved very easily.
    Please suggest, if you have any idea on this.
    Thanks,
    Sanket Sethi

    I got the solution. You can find the Variant field catalog by using Function module 'LVC_VARIANT_SELECT'. You can set the dialog box based on your requirements as well. So closing this thread. Thanks..

  • What is the button to change the variant in alv?

    Hi guys,
              can u tell me  is there any button to change the variant in alv?. what is tanscation varient in report , hw it will used.

    Hi
    The ALV Grid Control is a tool with which you can output non-hierarchical lists in a
    standardized format. The list data is displayed as a table on the screen.
    The ALV Grid Control offers a range of interactive standard list functions that users need
    frequently (find, sort, filter, calculate totals and subtotals, print, print preview, send list,
    export list (in different formats), and so on. These functions are implemented in the
    proxy object class. You as the programmer have the possibility to turn off functions not
    needed. In most cases the implementations of the standard functions provided by the
    control are sufficient. However, if required, you can adjust these implementations to
    meet application-specific needs.
    You can add self-defined functions to the toolbar, if necessary.
    The ALV Grid Control allows users to adjust the layout of lists to meet their individual
    requirements (for example, they can swap columns, hide columns, set filters for the
    data to be displayed, calculate totals, and so on). The settings (list customizing) made
    by a specific user are called a display variant. Display variants can be saved on a userspecific
    or on a global basis. If such display variants exist for a list, they can be offered
    to the user for selection. If a display variant is set as the default variant, the associated
    list is always displayed based on the settings of this variant.
    <b>2. REUSE_ALV_LIST_DISPLAY
    REUSE_ALV_GRID_DISPLAY
    REUSE_ALV_FIELDCATALOG_MERGE
    REUSE_ALV_COMMENTARY_WRITE</b>
    3. Use of Field Catalog is to determines the technical properties & add formating information of the column.
    6. all the definition of internal table, structure, constants are declared in a type-pool called SLIS.
    7.fieldcat-fieldname
    fieldcat-ref_fieldname
    fieldcat-tabname
    fieldcat-seltext_m
    5. Form user_command using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
    The report output can contain up to 90 columns in the display with the wide array of display options.
    The commonly used ALV functions used for this purpose are;
    <b>1. REUSE_ALV_VARIANT_DEFAULT_GET
    2. REUSE_ALV_VARIANT_F4
    3. REUSE_ALV_VARIANT_EXISTENCE
    4. REUSE_ALV_EVENTS_GET
    5. REUSE_ALV_COMMENTARY_WRITE
    6. REUSE_ALV_FIELDCATALOG_MERGE
    7. REUSE_ALV_LIST_DISPLAY
    8. REUSE_ALV_GRID_DISPLAY
    9. REUSE_ALV_POPUP_TO_SELECT</b>
    Purpose of the above Functions are differ not all the functions are required in all the ALV Report.
    But either no.7 or No.8 is there in the Program.
    How you call this function in your report?
    After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
    Then use follwing function module.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = 'Prog.name'
    I_STRUCTURE_NAME = 'I_ITAB'
    I_DEFAULT = 'X'
    I_SAVE = 'A'
    TABLES
    T_OUTTAB = I_ITAB.
    IF SY-SUBRC <> 0.
    WRITE: 'SY-SUBRC: ', SY-SUBRC .
    ENDIF.
    ENDFORM. " GET_FINAL_DATA
    The object F_IT_ALV has a field, the activity ACTVT, which can
    contain four permitted values: 01, 02, 03 and 70. Each of the
    activities 01, 02 and 70 controls the availability of particular
    functions (in the menu and the toolbar) of the ALV line item list:
    a) 01: "Settings -> Display variant -> Save..."
    b) 02: "Settings -> Display variant -> Current..." and
    "Settings -> Display variant -> Current header rows "
    c) 70: "Settings -> Display variant -> Administration..."
    Activity 03 corresponds to the minimum authorization, which is the
    most restricted one: The user can only select layouts which have
    been configured already. In particular, all of the other functions
    named above are inactive with activity 03.
    Now if you want to permit a user to change the column selection and
    the headers as well as to save the layout thus created, for example,
    but if you do not want to permit the user to administrate the
    layouts, you grant him or her the authorization for activities 01
    and 02.
    Check this link it will be mosty usefull for u
    http://www.sap-img.com/fu017.htm
    Reward all helpfull answers
    Regards
    Pavan

  • 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 set variant for ALV grid from ABAP

    Hello,
    I have a program which displays some data with ALV grid. Then after some operation I would like to set different layout for the grid, but not by choosing it manually but by the program. I thought that it would be enough to use the method SET_VARIANT, so I'm setting DISVARIANT structure properly, using SET_VARIANT method and after that I'm calling REFRESH_TABLE_DISPLAY but layout is not changed. What else should I do? Is that possible?
    Best regards,
    Marcin

    Hi,
    Check this
    * While declaring select-options
    parameters: p_vari        like ltdx-variant.  " Layout
    * then add the following code in
    at selection-screen on value-request for p_vari.
      perform f_variant_f4 using p_vari.
    * Code for f_variant_f4
    form f_variant_f4 using  p_vari.
    * private variables
      data : v_exit    type c.
      clear gs_variantt.
      v_variant_save = 'U'.
      call function 'LVC_VARIANT_F4'
        exporting
          is_variant    = gs_variant
          i_save        = v_variant_save
        importing
          e_exit        = v_exit
          es_variant    = gs_variantt
        exceptions
          not_found     = 1
          program_error = 2
          others        = 3.
      if sy-subrc ne c_0.
        message i999(yscc) with text-064.    " No Layout Available for F4
      endif.
      if v_exit is initial.
        gs_variant-variant = gs_variantt-variant.
        p_vari             = gs_variantt-variant.
      endif.
    endform.                                 " F_variant_f4
    * In PBO
        call method grid1->set_table_for_first_display
          exporting
            is_layout                     = gs_layout
            is_variant                    = gs_variant
            i_save                        = 'A'
            it_toolbar_excluding          = i_exclude[]
          changing
            it_outtab                     = i_output[]
            it_fieldcatalog               = i_fieldcat[]
          exceptions
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            others                        = 4.

  • Variant of ALV-Grid

    Hi folks,
    I’m using the variant function of the ALV Grid. The screen you get by creating or saving a variant contains the following tabstrips: Sort Order, Filter, View and Display.  My aim is to hide all tabstrips except the ‘Sort Order’ one. Is there any way to do this?
    thanks in advance

    Check this code that I got from Rich Heilman when I had the same problem. If you find out which you have by using
    RS_CUA_GET_STATUS_FUNCTIONS and then exclude the ones you don't want.
    Sure...check out the following code.
    Its the IT_TOOLBAR_EXCLUDING parameter of the interface of method SET_TABLE_FOR_FIRST_DISPLAY.
    look a the form EXCLUDE_TB_FUNCTIONS.
    REPORT ZRICH_0001.
    TABLES: MARA.
    DATA: BEGIN OF I_ALV OCCURS 0,
          MATNR TYPE MARA-MATNR,
          MAKTX TYPE MAKT-MAKTX,
          END OF I_ALV.
    DATA: ALV_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: ALV_GRID       TYPE REF TO CL_GUI_ALV_GRID.
    DATA: LAYOUT    TYPE LVC_S_LAYO.
    DATA: FIELDCAT  TYPE LVC_T_FCAT.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001 .
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      CALL SCREEN 100.
         Module  status_0100  OUTPUT
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
      DATA: VARIANT TYPE  DISVARIANT.
      VARIANT-REPORT = SY-REPID.
      VARIANT-USERNAME = SY-UNAME.
    Create Controls
      CREATE OBJECT ALV_CONTAINER
             EXPORTING
                   CONTAINER_NAME    = 'ALV_CONTAINER'.
      CREATE OBJECT ALV_GRID
             EXPORTING
                   I_PARENT          =  ALV_CONTAINER.
    ALV Specific. Data selection.
    Populate Field Catalog
      PERFORM GET_FIELDCATALOG.
    Exclude functions
      PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
      CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
               IS_LAYOUT              = LAYOUT
               IS_VARIANT             = VARIANT
               I_SAVE                 = 'U'
               I_STRUCTURE_NAME       = 'I_ALV'
               it_toolbar_excluding   = lt_exclude
          CHANGING
               IT_OUTTAB       = I_ALV[]
               IT_FIELDCATALOG = FIELDCAT[].
    ENDMODULE.
         Module  USER_COMMAND_0100  INPUT
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK' OR 'CANC'.
          IF NOT ALV_CONTAINER IS INITIAL.
            CALL METHOD ALV_CONTAINER->FREE.
            CLEAR: ALV_CONTAINER.
            FREE : ALV_CONTAINER.
          ENDIF.
          IF SY-SUBRC = 0.
            SET SCREEN 0.
            LEAVE SCREEN.
          ELSE.
            LEAVE PROGRAM.
          ENDIF.
        WHEN 'EXIT'.
          IF NOT ALV_CONTAINER IS INITIAL.
            CALL METHOD ALV_CONTAINER->FREE.
            CLEAR: ALV_CONTAINER.
            FREE : ALV_CONTAINER.
          ENDIF.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.
    FORM GET_DATA
    FORM GET_DATA.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE I_ALV
            FROM MARA
              INNER JOIN MAKT
                ON MARAMATNR = MAKTMATNR
                   WHERE MARA~MATNR IN S_MATNR
                     AND MAKT~SPRAS = SY-LANGU.
      SORT I_ALV ASCENDING BY MATNR.
    ENDFORM.
         Form  Get_Fieldcatalog - Set Up Columns/Headers
    FORM GET_FIELDCATALOG.
      DATA: LS_FCAT TYPE LVC_S_FCAT.
      REFRESH: FIELDCAT.
      CLEAR: LS_FCAT.
      LS_FCAT-REPTEXT    = 'Material Number'.
      LS_FCAT-COLTEXT    = 'Material Number'.
      LS_FCAT-FIELDNAME  = 'MATNR'.
      LS_FCAT-REF_TABLE  = 'I_ALV'.
      LS_FCAT-OUTPUTLEN  = '18'.
      LS_FCAT-COL_POS    = 1.
      APPEND LS_FCAT TO FIELDCAT.
      CLEAR: LS_FCAT.
      LS_FCAT-REPTEXT    = 'Material Description'.
      LS_FCAT-COLTEXT    = 'Material Description'.
      LS_FCAT-FIELDNAME  = 'MAKTX'.
      LS_FCAT-REF_TABLE  = 'I_ALV'.
      LS_FCAT-OUTPUTLEN  = '40'.
      LS_FCAT-COL_POS    = 2.
      APPEND LS_FCAT TO FIELDCAT.
    ENDFORM.
         Form  EXCLUDE_TB_FUNCTIONS
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
      DATA LS_EXCLUDE TYPE UI_FUNC.
    Row manipulation
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    Sort buttons
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_SORT_ASC.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_SORT_DSC.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    This excludes all buttons
    LS_EXCLUDE = '&EXCLALLFC'.
    APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.
    Best Regards Benita

  • About Variants in ALV grid

    Hi all,
    I am displaying 4grids on a TAB Strip in ALV
    i have created one variant for each grid(report)
    But when i run the prog and press on F4 help for variant parameter, i am getting variants of all the grids
    Is there any way to get only those variants related to a particular grid.
    thanks in advance

    Hi,
    Specify different variant handles for each of the four grids. Some thing like the following,
    <b>ls_variant-report = <your program name>.</b>
    ****Set following handler different for each grid ****reference
    ****something like 'GRD1', 'GRD2' and so on..
    <b>ls_variant-handle = <your grid handle 4 characters>.</b>
        CALL METHOD ref_grid->set_table_for_first_display
          EXPORTING
          I_BYPASSING_BUFFER            =
          I_BUFFER_ACTIVE               =
          I_CONSISTENCY_CHECK           =
          I_STRUCTURE_NAME              =
    <b>        is_variant                    = ls_variant</b>
            i_save                        = 'A'
          I_DEFAULT                     = 'X'
            is_layout                     = ls_layout
          IS_PRINT                      =
          IT_SPECIAL_GROUPS             =
          it_toolbar_excluding          =
          IT_HYPERLINK                  =
          IT_ALV_GRAPHICS               =
          IT_EXCEPT_QINFO               =
          CHANGING
            it_outtab                     = lt_data
            it_fieldcatalog               = lt_fcat
          IT_SORT                       =
          IT_FILTER                     =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
    Hope this helps..
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • 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

  • Validations and default Values in ALV Grid

    All,
    I am using "set_table_for_first_display" to display a grid with empty editable rows wherein which users can enter data and process certain transactions.
    My requirement is to know if we can provide drop-downs and default values in this grid. for ex. if user want to insert a row, that row should automatically have some default values like company code, sales org etc.
    Also, if there is an error while validating the data, I should be able to set the focus on that field while displaying the error message. I was able to display error message but could not set the focus on the field that need to be corrected.
    Your earlier response is much appreciated.
    Regards
    Kasi

    Hi kasi,
    check these links:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/an easy reference for alv grid control.pdf
    http://www.abap4.it/download/ALV.pdf
    hope this helps,
    keerthi.

  • 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

  • Default variants in ALV

    hello all,
    can someone kindly tell me how to use the FM
    "REUSE_ALV_VARIANT_DEFAULT_GET " in ALV for getting the default variant on the selection screen. what are the paameters to be specified????
    thanks in adance,
    seenu

    Hello,
    Check this code:
    DATA : g_r_disp_variant TYPE disvariant.
    SELECTION-SCREEN BEGIN OF BLOCK variant WITH FRAME TITLE text-003.
    PARAMETERS:  p_varian LIKE disvariant-variant DEFAULT '/STANDARD'.
    SELECTION-SCREEN END OF BLOCK variant.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varian.
      PERFORM show_existing_display_variants.
    *&      Form  SHOW_EXISTING_DISPLAY_VARIANTS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM show_existing_display_variants.
      g_r_disp_variant-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant    = g_r_disp_variant
                i_save        = 'A'
           IMPORTING
                es_variant    = g_r_disp_variant
           EXCEPTIONS
                not_found     = 1
                program_error = 2
                OTHERS        = 3.
      IF sy-subrc = 0.
        p_varian = g_r_disp_variant-variant.
      ENDIF.
    ENDFORM.                               " SHOW_EXISTING_DISPLAY_VARIANTS
    *form get_output
      g_repid = sy-repid.
    *  display variant
      g_r_disp_variant-report = sy-repid.
      IF NOT p_varian IS INITIAL.
        g_r_disp_variant-variant = p_varian.
      ENDIF.
    *get_output
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program = g_repid
                i_grid_title       = 'PRICE COMPARISON REPORT:'
                is_layout          = it_layout
                it_fieldcat        = it_fldcat
                is_variant         = g_r_disp_variant
                i_default          = 'X'
                i_save             = 'A'
           TABLES
                t_outtab           = g_t_itab_alv
           EXCEPTIONS
                program_error      = 1
                OTHERS             = 2.
    REgards,
    Vasanth

  • Retrieve changed record from editable alv grid

    hello,
          i am new to alv grid... i am facing some problems working on it... plz help me solve my problems...
          i have created an alv grid displaying the timesheet of some employee's...
          the worktime cells are editable and rest of the information is read only...
          the worktime is changed and then a SAVE button is pushed...
          how do i retrieve the changed time into my internal table?
          once i update the internal table, i can modify the database table...
    thank you.

    Hi,
    Refer this program:-
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
         it_sort                           = it_sort        " sort info
        TABLES
          t_outtab                          = it_final      " internal table
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *&      Form  pf
    *       SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
    *       ON WHICH THE ALV GRID IS DISPLAYED
    *       -->RT_EXTAB
    FORM pf USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTG_STAT'.
    ENDFORM.                    "pf
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
    * when the function code is SAVE then save records into internal table
        WHEN 'SAVE'.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    "now at this time you have modified internal table
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
    "alv output is refreshed as per changes in internal table
    "now you can include code to modify your ztable from internal table
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Regards,
    Tarun

  • Display variant in  ALV grid

    Hi ,
    i have developed an interactive report in which form the first grid display i will move to the second grid display.
    Problem:
                 For the first list there is an display variant. when i navigate to the second list it is using the same display variant form the first list ( this should not hapen ). so many of the fields are not be displayed in the second list.
                Is there any way to differentiate the display variant from first and second list.
    Please help me. sample code will be more helpful.
    Patil

    hi santhosh
        You can very well create 2 variants in your report for grid display...just restrict some fields n create 2 variants and while executing jus choose which variant you need to run..
    REWARD IT IF USEFUl...!!!!

  • Changing field catalog of ALV grid after first display (was: "ALV GRID")

    Dear experts!
    I am using CL_GUI_ALV_GRID to display an ALV, whose fieldcatalog has 5 fields (FIELD1, FIELD2, FIELD3, FIELD4 and FIELD5).
    I am setting "NO_OUT = 'X' " to the fields FIELD3 and FIELD5 in the fieldcatalog before call the method SET_TABLE_FOR_FIRST_DISPLAY.
    If a specific event occurs on the screen, I would like to set "NO_OUT = 'X'" to the fields FIELD2 and FIELD4 and I would like to set the "NO_OUT = ''" to the fields and FIELD3 FIELD5. This should happen at runtime after the method call "SET_TABLE_FOR_FIRST_DISPLAY".
    I've tried using the method SET_FIELDCATALOG, but it is private.
    Does anyone have any idea how to solve this problem?
    Thank you very much!
    Rubens
    Edited by: Thomas Zloch on Aug 22, 2011 3:49 PM - subject corrected

    Hi
    Try to use the method SET_FRONTEND_FIELDCATALOG (it'll call private method SET_FIELDCATALOG)
    Max

  • How to set default layout for ALV grid ?

    Dear all,
    When execute ALV reports, the user customize the layout for their own purpose. But each time they run that report, they must choose again their layout. Is there any way to set the layout as default ?
    Thank you very much,
    Sylvecat.

    Hi,'
    After you have created a layout just follow the steps listed below for making it as default layout:
    1. Click (Save Layout).
    2. Enter a name in the Save Layout field. The name must begin with a letter.
    3. Type in a description for the layout in the Name field.
    4. Select the Default Setting check box if you want this layout to be the default layout every time you run
    the report.
    5. Click (Continue).
    Note: A warning message will appear if you are trying to save over an existing layout. Close the box by
    selecting the X in the upper right hand corner or choose Yes to overwrite the layout.
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

Maybe you are looking for

  • New i3, 21.5 iMac hanging up can't reset

    New i3, 21.5 iMac turns on then freezes up. Tried reset smc to no avail. Can move mouse pointer around desktop but nothing will respond. Something appears to be hanging up in the trash ben. Was transferring pictures from my external hd into iPhoto wh

  • UserExit for searchhelp

    Hello together, is there a possibility in SAP to check some things e.g. in an user-exit before any search help is called. The background is, we have an external provider with shoud use some Z-Reports of us. The problem is, that we show in this case a

  • The lazy watch thread - send me your junky one !  HELP !

    GIMME YOUR OLD JUNKY WATCH PLEASE.. !!!!! i GOT this watch so I could time polaroids and do film developement in cans ( time the chemicals etc )...and it was cool cause it has a second hand ( not minutes and hours alone.. has a cool hand that shows '

  • Networking Utility Broken

    Hi, I've got a new MBP and I can't launch the Networking Utility in the utilities folder. When I launch it I get the following error: You can't open the application "Network Utility" because it is not supported on this architecture. I called Apple an

  • Can't login after upgrade to version 7

    After the forced upgrade to version 7 I can't login any longer (by microsoft account) to Skype. It shows the following error (see attachment). Can someone please help me? For first time in years, I can't login to Skype and I really can't do without.