"Select Layout" option in alv output

Hi All,
         I have developed a ALV report.
In the output, on clicking the "Select Layout" button, a small window opens with some layout option/variant say "ZSLEB".
When i choose this layout, the output changes and takes the form of the chosen layout i.e. ZSLEB.
Now, on refresh, the alv output doesnt display this new layout, but goes back to the default layout/variant.
Actually, i am not passing anythin to the IS_Variant parameter in the ALV_GRID_Display FM.
I suppose i need to somehow manage to fetch the "ZSLEB" layout value during refresh and pass it to Is_Variant. Please help me in doing this.
Thanks & Regards,
Tejas Savla

Variant information
Description
This structure is only relevant if display variants are to be saved and/or read.
Variant information including the name of the list variant that is used to output the list.
To allow display variants to be read within the ALV, you must specify the acess path using fields REPORT (required field), HANDLE (optional field) and/or LOG_GROUP (optional field).
If you also want to allow display variants to be saved, you must additionally fill parameter I_SAVE accordingly.
See also the documentation on IMPORTING parameter I_SAVE.
A variant is uniquely described through:
The program to which the variant is assigned (REPORT)
The handle (HANDLE), if, for example, multiple lists with different structures and data are called in a program (I_CALLBACK_PROGRAM).
The handle is a CHAR(4) field that must be uniquely defined and describes the assignment of the call to the current structure of the internal output table.
Example:
Depending on the user interaction, several types of lists can be output in program x.
The user should be able to define display variants for each type of list.
You provide this function to the user by assigning a HANDLE to each list. If variants for the program and the handle are saved, the handle must not be modified any more.
The logical group, if, for example, the same list is created with different settings through various transactions (LOG_GROUP).
The logical group is a CHAR(4) that must be uniquely defined and specifies the assignment.
Example:
Program x is called through transactions T1 and T2. Depending on the transaction code, the fields available to the user through the field catalog differ in their assignment to different logical groups.
If variants for the program and the logical group are saved, the logical group must not be modified any more.
The user name, if user-specific variants are saved (USERNAME).
You do not have to fill this parameter manually since the variant name is unique.
The variant name (VARIANT).
You only have to fill this parameter if this structure is to be used to read a concrete variant and the list is to be output with this variant.
Value range
To call a list with a variant, you must specify the above fields.
Default
If the structure is initial, but saving is active (I_SAVE is not initial), then
IS_VARIANT-REPORT = I_CALLBACK_PROGRAM is set.

Similar Messages

  • "Select Layout" Option for ALV Report

    Hi All,
    I have developed a ALV report.
    In the output, on clicking the "Select Layout" button, a small window opens with some layout option/variant say "ZSLEB".
    When i choose this layout, the output changes and takes the form of the chosen layout i.e. ZSLEB.
    Now, on refresh, the alv output doesnt display this new layout, but goes back to the default layout/variant.
    Actually, i am not passing anythin to the IS_Variant parameter in the ALV_GRID_Display FM.
    I suppose i need to somehow manage to fetch the "ZSLEB" layout value during refresh and pass it to Is_Variant. Please help me in doing this.
    Thanks & Regards,
    Tejas Savla

    Hi
    On refresh ,
                       Call ths below code.
    s_variant-report = sy-repid.( Your report name ).
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
        is_variant                 = s_variant
      I_TABNAME_HEADER           =
      I_TABNAME_ITEM             =
      IT_DEFAULT_FIELDCAT        =
      I_SAVE                     = ' '
      I_DISPLAY_VIA_GRID         = ' '
       IMPORTING
      E_EXIT                     =
        es_variant                 = s_variant
       EXCEPTIONS
         not_found                 = 1
         program_error             = 2
         OTHERS                    = 3
    Can pass this to IS_VARIANT while calling for REUSE_ALV_ DISPLAY
    Please reward if useful.

  • 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

  • Error While selecting Layout option in tcode SFP

    Hi
    I am getting the below error when i select the layout option in tcode SFP.
    Could not start Layout Designer (see long text)
    Message no. FPUIFB086
    Diagnosis
    The forms design tool for developing the form layout could not be started; either it is not installed or there are errors in the installation.
    Procedure
    Make sure that you have the forms design tool installed on your desktop (the tool is part of the SAPGUI installation).
    Also read SAP Note 801524.
    How to resolve this error?
    Regards,
    Abdul Hakim

    Hi Hakim,
    See the sap note below:
    Symptom
    Presentation CD 1 "SAP GUI for Windows 6.40" Compilation 3 references this note for additional components.
    For information about where to find the successive version of the installation component
    "Forms Design Tool" - "Adobe Forms Designer"
    refer to Note 962763.
    Reason and Prerequisites
    This note describes two possible installation procedures:
    Direct installation on the workstation
    Update installation server (for administrators)
    Solution
    Direct installation on the workstation
    Product: "SAP Interactive Forms" - "Adobe LiveCycle Designer"
                  Start "ALDsetup. exe" directly on your workstation. If you had already installed an older version of "Adobe Designer 6.0" using "SAP GUI" or "SAP NetWeaver Development Studio", you first need to delete the older "Forms Design Tool" version in the corresponding installation.
    Update installation server:
    If you have integrated an SAP GUI installation server with
    6.40 Compilation 3
    6.40 Compilation 2
    6.20 Compilation 6
    you can add the following product:
    Product: "SAP Interactive Forms" - "Adobe LiveCycle Designer":
                  To do this, start the program
                  "..\setup\ALDtoGUIServer.exe"
                  and specify the network path for an existing SAP GUI installation server. After this procedure, you can see the new "Interactive Forms" component in the component selection dialog box of the SAP GUI installation when you attach a new installation package with SAPAdmin. The installation on the workstation is then started as usual using "setup.exe" or "netsetup.exe".
    Caution:
    Some files on your existing installation server may still be write-protected (read-only).
    Make sure that all files in the two directories
    "...\Adobe\"
    "...\Common Files\"
    are not write-protected.
    To do this, open a DOS box (input request) and switch to the directory of the installation server and set
    attrib -r /s "Common Files\*.*"
    attrib -r /s "Adobe\*.*"
    before you start "..\setup\ALDtoGUIServer.exe".
    Otherwise, you may receive the following error message:
    "... .cab cannot be extracted. It may be corrupt."
    Regards,
    Md Ziauddin

  • SAVE Layout Option in ALV list Report

    Hi Experts,
    Is it possible to SAVE the layout option for Block ALV list Reports?
    Thanks in Advance,
    Sivak.

    Hi,
    It is not possible to save layout in BLock ALV display but possible to change layout. There is no parameter to save. It is not possible to store the layout as it has several structure.
    Thanks & Regards
    Rocky

  • Function Module to select all entries in  ALV output

    Hi,
      I have an ALV report and Select ALL and Deselect ALL Buttons added to it .
      When the Select ALL button is pressed,all entries of the ALV report should be selected.
      When the Deselect ALL button is pressed,all entries of the ALV report should be deselected.
      Is there any function module to select all entries of the output and vice versa.
      Thanks in advance.
    Regards,
    Navas

    Hi Navas,
    I have written a part of the code you can use.
      TYPE-POOLS: slis.
      DATA : ls_event TYPE slis_alv_event.
    Set PF Status
      ls_event-name = slis_ev_pf_status_set .
      ls_event-form = slis_ev_pf_status_set .
      APPEND ls_event TO gt_event.
      CLEAR  ls_event.
    FORM pf_status_set USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'Z_STATUS'.
    ENDFORM  .                 "set_pf_status
    (no need for any perform. This will be called automatically).
    While calling the FM for ALV, pass the internal table gt_event in it_events parameter.
    Double click on Z_STATUS and add two buttons in Application Toolbar.
    1. Select All - Give function code name as &ALL,
    2. Deselect All - Give function code name as &SAL.
    Hope this helps.
    Thanks,
    Dawood.
    Edited by: Dawood.S.Ghasletwala on Apr 3, 2009 3:51 PM

  • Multiple Filtering options within ALV Output.

    Hi All,
    Being a Functional Guy,I would like to clarify few questions in ALV functionality. In one of our requirement we need to create a ALV report.
    Step1 : Enter values in selection criteria.
    Step2: Execute ALV report.
    Step3: Within Output  I should be able to filters for a particular column. For example: We have a column as Country.In the Column can I select or enter India,US,UK and output should only contain only US,UK,India.
    Step4: Within output We have columns Country and State , can we enter values like Texas in State, US in country in the filter will the output will have only values with Texas & US.
    Can you guys advice if Step 3 & step 4 is possible in ALV.
    Thanks,
    Kitcha

    Hi,
    Yes, you can hae the filtering options for all the columns of the ALV..if you can see there is a stadnard filter functionality available
    for ALV that comes by default..
    When you show the output in alv these default filter is already avaibale..first try to test it out..
    Just go through the ALV documetns..filter is already there..for your output you will get the result..
    Regards,
    Lekha.
    Edited by: Lekha on Dec 10, 2009 10:28 AM

  • Selecting multiple lines from ALV output for further validation

    Hi guru's,
             i have created a ALV report with a check box in the output,i need to select multiple lines by checking 'X' in the check box
    after that i need to do further validation..like updating etc..how to read the selected lines( check box = 'X' )from the output of the ALV report.Is there any function for that.plz help me with this regard.
    Thanks & Regards,
    Balaji.S

    Hi Balaji,
    Try this way.
    <font color=blue><pre>
    REPORT ztest_alv_row_selection.
    DATA: BEGIN OF it_output OCCURS 0,
            select TYPE c,          "This variable stores the value when row selected.
            bukrs  TYPE t001-bukrs,
            butxt  TYPE t001-butxt,
          END OF it_output.
    TYPE-POOLS:slis.
    DATA:it_events            TYPE STANDARD TABLE OF slis_alv_event,
         it_fieldcat          TYPE STANDARD TABLE OF slis_fieldcat_alv,
         wa_fieldcat          TYPE slis_fieldcat_alv,
         wa_events            TYPE slis_alv_event,
         wa_layout            TYPE slis_layout_alv.
    DATA:g_program            TYPE sy-repid VALUE sy-repid.
    START-OF-SELECTION.
      SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_output UP TO 100 ROWS.
      DEFINE fieldcatalog.
        wa_fieldcat-fieldname = &1.
        wa_fieldcat-tabname   = &2.
        wa_fieldcat-seltext_l = &3.
        append wa_fieldcat to it_fieldcat.
        clear  wa_fieldcat.
      END-OF-DEFINITION.
      fieldcatalog: "Column table       col text
                    'BUKRS' 'IT_OUTPUT' 'BUKRS',
                    'BUTXT' 'IT_OUTPUT' 'BUTXT'.
      wa_layout-box_fieldname     = 'SELECT'. "This has to be set to get selection
      wa_layout-colwidth_optimize = 'X'.
      wa_events-name              = 'PF_STATUS_SET'.
      wa_events-form              = 'PF_STATUS_SET'.
      APPEND wa_events TO it_events.
      CLEAR wa_events.
      wa_events-name              = 'USER_COMMAND'.
      wa_events-form              = 'USER_COMMAND'.
      APPEND wa_events TO it_events.
      CLEAR wa_events.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = g_program
          is_layout          = wa_layout
          it_fieldcat        = it_fieldcat
          it_events          = it_events
        TABLES
          t_outtab           = it_output.
    *&      Form  PF_STATUS_SET
    FORM pf_status_set USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTEST'.
    1. When you set Pf status ZTEST, standard application tools will be removed.
    2. Goto SE41 give program 'SAPLKKBL' and status 'STANDARD_FULLSCREEN'.
    3. Copy the status from those to ZTEST of our program. Now you will see all standard functions.
    ENDFORM.                    "PF_STATUS_SET
          FORM USER_COMMAND                                          *
    FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN 'DISPLAY'.  "user presses SAVE
          LOOP AT it_output.
            IF it_output-select EQ 'X'.
          Process records that have been selected
              WRITE:/ it_output.
            ENDIF.
          ENDLOOP.
      ENDCASE.
    ENDFORM.                    "user_command</pre></font>
    Thanks
    Venkat.O

  • Multiple selection of rows in alv output list

    experts,
    using 'REUSE_ALV_GRID_DISPLAY'
    the following is the sample code ,without using ctrl or shift key i am unable to select multiple rows .
    any resolvable answers.
    REPORT zpushbutton1.
    type-pools : slis.
    *structure declarations
    types : begin of ty_mara,
    matnr type matnr,
    ernam type ernam,
    mbrsh type mbrsh,
    CHKBOX TYPE CHAR1,
    end oF ty_mara.
    types : begin of ty_marc,
    matnr type matnr,
    werks type werks_d,
    pstat type pstat_d,
    end of ty_marc.
    *internal table declarations
    DATA : gi_mara TYPE STANDARD TABLE OF TY_MARA INITIAL SIZE 0.
    data : gi_fieldcat type slis_t_fieldcat_alv.
    *workarea declarations
    DATA : gs_mara TYPE TY_MARA,
    gs_fieldcat type slis_fieldcat_alv.
    SELECT matnr
    ernam
    mbrsh
    FROM mara
    INTO TABLE gi_mara
    UP TO 10 ROWS.
    perform build_fieldcat using :
    '1' 'CHKBOX' 'GI_MARA' 'SELECT' 'X' ,
    '2' 'MATNR' 'GI_MARA' 'MATEIRALNO' ' ',
    '3' 'ERNAM' 'GI_MARA' 'PERSON CREAT' ' ',
    '4' 'MBRSH' 'GI_MARA' 'INDUSTRY' ' '.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IT_FIELDCAT = GI_FIELDCAT
    TABLES
    t_outtab = GI_MARA
    *& Form BUILD_FIELDCAT
    form BUILD_FIELDCAT using
    PCOL TYPE CHAR2
    PFLDNAME TYPE CHAR10
    PTABNAME TYPE CHAR10
    PSELTEXT TYPE CHAR15
    PINPUT TYPE CHAR1.
    GS_FIELDCAT-COL_POS = PCOL.
    GS_FIELDCAT-FIELDNAME = PFLDNAME.
    GS_FIELDCAT-TABNAME = PTABNAME.
    GS_FIELDCAT-SELTEXT_M = PSELTEXT.
    GS_FIELDCAT-EDIT = PINPUT.
    APPEND GS_FIELDCAT TO GI_FIELDCAT.
    CLEAR GS_FIELDCAT.
    endform. " BUILD_FIELDCAT
    thanks and regards

    experts,
    can we set cursor properties during the output display
    ex : i have used function module reuse_alv_grid_display to display a list of records with passing parameter
    is_layout-box_fieldname and is_layout-box_tabname to list the first column as pushbutton.
    when i select a row ,gets selected now when i move the
    cursor (mouse) to the other row and select the row, the row previously selected will be deselected.
      solution to the above problem is to hold the ctrl or shift key for
    multiple selections.
    is there any other alternative procedure so that without holding
    ctrl or shift key multiple rows get selected.
    thks and rgrds

  • Standard Report not Displaying 'SAVE LAYOUT' Option

    Dear All,
    Using Tcode VF44, i am getting output list.But in that list when i click on select layout option from toolbar its not displaying 'save layout' Option. can anybody give me soln for the same.How can i get that option?
    Regards,
    Mayank

    hi ,
    it depends on the user parameters.
    U have to identify the parameter id and u have to activate it in user maintainance partameters .
    su01 -> parameters.
    ex .  parameter id ->  SD_VARIANT_MAINTAIN -> X
    so u can save layout now.
    regards,
    manikandan

  • Standard Report's Layout not displaying 'SAVE LAYOUT' Option

    Dear All,
                Using Tcode VF44, i am getting output list.But in that list when i click on select layout option from toolbar its not displaying 'save layout' Option. can anybody give me soln for the same.How can i get that option?
    Regards,
    Mayank

    HI,
        No yaar, This one is standard report and  i am getting 'SAVE LAYOUT'  option in 300 but not in Production Server.There must be settings for this.  If u hv any idea ?
    Regards,
    Mayank

  • 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

  • How can we create save layout option in grid tool bar

    hi,
    how can we create select layout option in grid tool bar to save my own layout. if any one knows tell me immediately
    thanks

    Hi again,
    1. We need to do 1 additional thing.
    data : GS_variant TYPE DISVARIANT.
    GS_variant-REPORT = sy-repid.
    2.  while calling pass this parameter also.
         IS_VARIANT                    = GS_variant
    It will work now.
    3. Moreover, I_SAVE has 3 options.
    I_SAVE = SPACE
    Layouts cannot be saved.
    I_SAVE = 'U'
    Only user-defined layouts can be saved.
    I_SAVE = 'X'
    Only global layouts can be saved.
    I_SAVE = 'A'
    Both user-defined and global layouts can be saved.
    regards,
    amit m.
    Message was edited by: Amit Mittal

  • Names of column appearing in alv output after changing layout in alvgrid?

    Hi all
    I have a requirement where I am displaying 20 fields using alv grid(cl_gui_alv_grid). Now each time when I run I can change layout and can display any number of columns in output using change layout option.
    My requirement is i need to know the column names of the fields which are displayed upon changing layout in output. Using this column names I have to write some logic in code. Each time number of column may vary as per the user selection. Is there any method or way to get the names of columns selected in output display?
    Please help me in this regard.

    Hi,
    During run time you will get the ALV layout info using this function module.
    REUSE_ALV_GRID_LAYOUT_INFO_GET
    Regards,
    Anversha

  • IN ALV Report 'SAVE LAYOUT' option missing

    Dear All,
                 I have created one report in ALV GRID using ABAP OBJECTS(Using class CL_GUI_CUSTOM_CONTAINER and
    CL_GUI_ALV_GRID).But in output when i click on change layout option i am not getting SAVE layout option.
    I have already passed I_SAVE parameter = 'A' while calling metod SET_TABLE_FOR_FIRST_DISPLAY. But i didnt worked.
               Please do needful.
    Regards,
    Mayank

    Hi,
    You can manage display variants by using parameters, “is_variant” and “i_save” of “set_table_for_first_display”. Here are options for variant handling. <structure_name> is the variant-defining structure of type “DISVARIANT”. The field “report” in this structure should contain the value of “sy-repid.”
    Hope this helps. Reward points if helpful.
    Thanks,
    Balaji

Maybe you are looking for

  • Case-insensitive -- what's a scriptor to do?

    Here's my delima: (from a tcsh) % ls file1.txt file2.TXT file3.txt % ls file{1,2,3}.TXT file1.TXT file2.TXT file3.TXT % ls *.TXT file2.TXT % rm *.txt I've written hundreds of unix (csh,tcsh, perl) scripts since around 1988. I never considered that so

  • Java.lang.NullPointerException when connect to the J2EE engine

    I want to connect to the J2EE engine ,but the error message "java.lang.NullPointerException" is displayed in the console.  Please help me ! Thank you !!  The full error exception like this: java.lang.NullPointerException         at com.sap.engine.ser

  • How to open 7.0 migrated Workbooks in 3.5 analyzer

    Hi, We have migrated BEx 3.5 workbooks to 7.0 version. We now want to execute these migrated workbooks in 3.5 analyzer, but we are not able to. Does migration of WBs create a new version of the existing WB or does it overwrite the migrated WB over th

  • What is the use of internal document number in excise invoice

    Hi All, Could you please explain the use of "Internal Document" number in Excise invoice. Regards, Mullairaja

  • Sound only coming out of sub!

    My L3450's have just been delivered and no sound is coming out of the speakers, only the sub! it's definitely isn't the computer as i get no joy out of my mp3 player either. What could be wrong? Message Edited by sammyd56 on 11-22-2007 10:34 AM