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

Similar Messages

  • Display amount in ALV Grid with different Decimal Places based on Currency

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2.
    we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65
    i need to display values like AED : 22.56

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2. we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65 (converting this value to 22.565 using BAPI_CURRENCY_GETDECIMALS according to currency in my Report)
    i need to display values like AED : 22.56
                                             KWD---22.565 but here field is NETWR with 2 decimal.
    Need to Display amount in ALV Grid with different Decimal Places based on Currency
    Regards,
    Dileep Kumar Reddy

  • Not able to display logo on alv grid output

    hi
    can anybody guide me.
    i have written code for displaying logo on alv grid report.
    i uploaded bmp image using OAER
    but even then i am not able to display logo on the report please help me
    i am using 4.7 version..
    code...
    REPORT  ZALVLOGO                                .
    type-pools: slis.
    data: i_sflight type table of sflight.
    *data: begin of i_sflight occurs 10.
    *include structure sflight.
    *data: end of i_sflight.
    data: it_events type slis_t_event,
           wa_events type slis_alv_event.
    select * from sflight into table i_sflight.
    perform form_fill_table.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_TOP_OF_PAGE            = 'top-of-page'
       I_STRUCTURE_NAME                  = 'sflight'
      TABLES
        T_OUTTAB                          = i_sflight
    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  top_of_page
          text
    -->  p1        text
    <--  p2        text
    FORM top-of-page .
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader.
    wa_header-typ = 'h'.
    wa_header-info = 'FLIGHT DETAILS'.
    APPEND wa_header to t_header.
    CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = t_header
        I_LOGO                   = 'ENJOY'.
      I_END_OF_LIST_GRID       =.
    ENDFORM.                    " top_of_page
    *&      Form  form_fill_table
          text
    -->  p1        text
    <--  p2        text
    FORM form_fill_table .
    clear wa_events.
    wa_events-name = 'top-op-page1'.
    wa_events-form = 'top-of-page'.
    append wa_events to it_events.
    ENDFORM.                    " form_fill_table

    hi ,
    First upload images  in SAP using transaction se78
    http://www.howforge.com/step-by-step-upload-bitmap-images-to-sap
    Then use that Image name to call using function module 
    in top of -page 
    call function 'REUSE_ALV_COMMENTARY_WRITE'
          exporting
            i_logo             = 'KAL1_LOGO'
            it_list_commentary = lt_top_of_page_no_sel.
    Regards
    Deepak.

  • 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

  • Not gettting quantity displayed in the alv grid

    hi experts
    iam displaying vbeln, matnr, quantity, sellingprice etc for an customer using fieldcat. in alv grid.
    iam able to get all the fields other than quantity in the output.
    i have taken vbap-kwmeng, actually in the va03 it is displaying from komp.
    i have tried with the following
      wa_fieldcat-col_pos =  5.
      wa_fieldcat-fieldname = 'KWMEMG'.
      wa_fieldcat-tabname = 'IT_DISPLAY'.
    wa_fieldcat-datatype =  'QUAN'.
      wa_fieldcat-outputlen = 15.
      wa_fieldcat-seltext_m = 'QUANTITY'.
    wa_fieldcat-ref_fieldname = 'KWMENG'.
    wa_fieldcat-ref_tabname = 'VBAP'.
    wa_fieldcat-qfieldname = 'VRKME'.
    wa_fieldcat-qtabname   =  'VBAP'.
    but iam not getting the respective output.
    please help
    thanks in advance.
    maaya

    I am not sure why are you not getting :
    Just remove col_pos and see the results,and also increase output len to 18.
    <b>clear wa_fieldcat.</b>
    wa_fieldcat-col_pos = 5. -> first comment and see the results
    wa_fieldcat-fieldname = 'KWMEMG'.
    wa_fieldcat-tabname = 'IT_DISPLAY'.
    wa_fieldcat-outputlen = 18.
    wa_fieldcat-seltext_m = 'QUANTITY'.
    wa_fieldcat-seltext_s = 'QUANTITY'.
    wa_fieldcat-seltext_l = 'QUANTITY'.
    <b>append wa_fieldcat to i_fieldcat.</b>
    Always clear the wa_fieldcat.
    Thanks
    Seshu

  • Display button in ALV Grid

    Hi,
    I have a requirement in ALV:
    I need to display a button on the top of alv grid list.Could you please help me out with this.
    Thanks,
    Sandeep

    Hi,
    In the below links some ALV GRID programs are there.Once u check this.I think this is very helpful to u.
    http://www.abap-tutorials.com/tag/alv-grid/
    TO achieve this you should copy the u2018STANDARDu2019 GUI status from program SAPLKKBL using transaction SE90 u2013>Programming SubObjectsu2013> Gui Status.
    Steps:
    1). Using SE80/SE41 you can copy a GUI status from one program to another. It mentions which one in the FMu2019s help.
    2). Create a form named like so:
    Code:
    Form Set_pf_status
    Notes: Called by FM REUSE_ALV_GRID_DISPLAY
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS u2018ZSTANDARDu2019.
    ENDFORM. u201CSet_pf_status
    In the above case the GUI status copied was named ZSTANDARD and adjusted accordingly, adding and removing the desired buttons. A button was added called u2018%DELETEu2019.
    3). Create the following report:
    Code:
    Form User_command
    Notes: Called by FM REUSE_ALV_GRID_DISPLAY
           Detects whether the icon/button for
           u2018Return Tag Deletionu2019 has been pressed. If it has then
           detect whether any rows have been highlighted and then
           set the delete flag.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
    DATA: li_count TYPE I.
    IF r_ucomm EQ u2018%DELETEu2019.
      LOOP AT %g00 WHERE mark EQ u2018Xu2019.
        ADD 1 TO li_count.
      ENDLOOP.
      IF li_count GT 0.
        gc_delete_flag = u2018Xu2019.
        r_ucomm = u2018&F03u2032. u201CBack arraow
      ELSE.
        MESSAGE W000 WITH u2018Please highlight the rows to be deleted!u2019.
      ENDIF.
    ENDIF.
    ENDFORM.  u201CUser_command
    As Iu2019ve added an extra button to indicate which records should be deleted I need to identify a form to be called to process when this button is chosen.
    Then when you call the ALV function you to specify the following extra details:
    Code:
        call function u2018REUSE_ALV_GRID_DISPLAYu2019
             exporting  i_callback_program = gc_repid
                        I_CALLBACK_PF_STATUS_SET = u2018SET_PF_STATUSu2019
                        I_CALLBACK_USER_COMMAND  = u2018USER_COMMANDu2019
                        i_grid_title       = lc_grid_title
                        is_layout          = lc_layout
                        it_fieldcat        = gt_fieldcat
                        it_sort            = sort
                        i_save             = l_save
                        is_reprep_id       = l_bbs_id
                        is_variant         = l_variant
             tables     t_outtab           = %g00
             exceptions program_error      = 1
                        others             = 2.
    The parameters in capitals are the extra ones that need to be added.

  • Display zeros in ALV grid

    I have a strange problem with an ALV grid.
    I have used the FM "LVC_FIELDCATALOG_MERGE" to create a fieldcatalog from a structure. The structure contains a field called NETWR that is based on the NETWR data element (which is a CURR data type).
    When the grid is displayed, however, zero values are not displayed - the cell is blank.
    I thought the default behaviour for a CURR field was to display zeros?
    I have checked and the NO_ZERO field in the fieldcat is initial.
    Any other ideas?

    According to this link, it has to be displayed. Check it one more time whether you set No_zero is initial or not.
    http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649baf17411d2b486006094192fe3/frameset.htm
    Warm Regards,
    Vijay

  • To display Title In ALV Grid Display on first line of table

    Hi SAP Experts,
             Here is one Issue..
    I have some check boxes on selection screens,
    When i have selected one,
    The related title should be display on the first line of Itab[]...
    and if once collect is used to suppress the data
    with the same itab can we print normal itab and how...
    Waiting for Your Reply.....
    Thanks In Advance

    Hi Krishna,
    I can't imagine what you want.
    In ALV grid object, you can change the title text for each column displayed. This is done via field catalog or, in SALV, column object methods.
    In ALV fullscreen, you can define a TOP-OF-PAGE area where you may have what ever you want independent from the grid table content. I think you can not use this because you have the grid in a container.
    You may define it as a docking or splitter container and place the grid in lower and the title in upper area. But this will need some experience with container controls and a certain level of coding abilities.
    Regards,
    Clemens

  • To Display Image in Alv Grid....

    Hello Gurus,
    I want to display an image/icon ( custom icon ) in the ALV grid.
    I know to display standard icons in ALV. But i dont know how to store custom icons in the system.
    I want to display an icon or image depending upon certain conditions. i need to display these images/icons for each row of the ALV grid.
    Please let me know if i can show images or icons ( not standard ) for each row in ALV grid.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 25, 2008 10:20 AM

    check out CL_GUI_PICTURE and the demo programs
    SAP_PICTURE_DEMO
    SAP_PICTURE_DEMO_ICON
    RSDEMO_PICTURE_CONTROL
    you can fit the picture in to the control with the following modes.
    DISPLAY_MODE_FIT
    other options
    DISPLAY_MODE_NORMAL
    DISPLAY_MODE_STRETCH
    DISPLAY_MODE_NORMAL_CENTER
    DISPLAY_MODE_FIT_CENTER
    Regards
    Raja

  • Making  selected rows to display mode in ALV  grid

    I Have program with ALV grid display, which has check box as the first field.
    The requirement is like.
    When i select some rows in the grid display with the check box and click on a button , then the selected
    rows shud change to display mode and others rows shud be in edit mode as before.
    *& Report  ZSRI_CHCKBOX_ITAB_UPDATE
    REPORT  ZSRI_CHCKBOX_ITAB_UPDATE.
    TYPE-POOLS: SLIS.
    DATA: BEGIN OF ITAB OCCURS 0,
            CHK    TYPE C,
            VBELN  TYPE VBAP-VBELN,
            POSNR  TYPE VBAP-POSNR,
            MATNR  TYPE VBAP-MATNR,
            MATWA  TYPE VBAP-MATWA,
            MATKL  TYPE VBAP-MATKL,
          END OF ITAB.
    DATA: T_FCAT TYPE SLIS_T_FIELDCAT_ALV,
          W_FCAT TYPE SLIS_FIELDCAT_ALV,
          RT TYPE SLIS_SELFIELD,
          W_LAYOUT TYPE SLIS_LAYOUT_ALV  .
    PARAMETERS: S_VBELN TYPE VBAK-VBELN.
    DATA: WA LIKE LINE OF ITAB.
    DATA: G_GRID_REFERENCE TYPE REF TO CL_GUI_ALV_GRID.
    DATA: BEGIN OF ITAB1 OCCURS 0,
            CHK    TYPE C,
            VBELN  TYPE VBAP-VBELN,
            POSNR  TYPE VBAP-POSNR,
            MATNR  TYPE VBAP-MATNR,
            MATWA  TYPE VBAP-MATWA,
            MATKL  TYPE VBAP-MATKL,
          END OF ITAB1.
    DATA: T_FCAT1 TYPE SLIS_T_FIELDCAT_ALV.
    DATA: W_FCAT1 TYPE SLIS_FIELDCAT_ALV.
    START-OF-SELECTION.
      SELECT VBELN POSNR MATNR MATWA MATKL FROM VBAP
        INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE   VBELN EQ S_VBELN.
      W_FCAT-COL_POS = 1.
      W_FCAT-FIELDNAME = 'CHK'.
      W_FCAT-TABNAME = 'ITAB'.
      W_FCAT-CHECKBOX = 'X'.
      W_FCAT-EDIT = 'X'.
      W_FCAT-SELTEXT_L  = 'CHECK'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS = 2.
      W_FCAT-FIELDNAME = 'VBELN'.
      W_FCAT-TABNAME = 'ITAB'.
      W_FCAT-SELTEXT_L  = 'SALES'.
      W_FCAT-EDIT = 'X'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS = 3.
      W_FCAT-FIELDNAME = 'POSNR'.
      W_FCAT-TABNAME = 'ITAB'.
      W_FCAT-SELTEXT_L  = 'ITEM'.
      W_FCAT-EDIT = 'X'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS = 4.
      W_FCAT-FIELDNAME = 'MATNR'.
      W_FCAT-TABNAME = 'ITAB'.
      W_FCAT-SELTEXT_L  = 'MATERIAL'.
      W_FCAT-EDIT = 'X'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS = 5.
      W_FCAT-FIELDNAME = 'MATWA'.
      W_FCAT-TABNAME = 'ITAB'.
      W_FCAT-SELTEXT_L  = 'MATERIAL QTY'.
      W_FCAT-OUTPUTLEN = 20.
      W_FCAT-EDIT = 'X'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS = 6.
      W_FCAT-FIELDNAME = 'MATKL'.
      W_FCAT-TABNAME = 'ITAB'.
      W_FCAT-SELTEXT_L  = 'MATERIAL GROUP'.
      W_FCAT-OUTPUTLEN = 20.
      W_FCAT-EDIT = 'X'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = SY-REPID
         I_CALLBACK_PF_STATUS_SET          = 'STATUS1'
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         IS_LAYOUT                         = W_LAYOUT
         IT_FIELDCAT                       = T_FCAT[]
        TABLES
          T_OUTTAB                          = ITAB[].
    *&      Form  STATUS1
    FORM STATUS1 USING P_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STATUS1' EXCLUDING P_EXTAB.
    ENDFORM.                    "PF_STATUS_SET
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM TYPE SY-UCOMM
                            R_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'READ'.
    R_SELFIELD-REFRESH = 'X'.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = G_GRID_REFERENCE.
          CALL METHOD G_GRID_REFERENCE->CHECK_CHANGED_DATA.
          LOOP AT ITAB INTO WA WHERE CHK = 'X'.
            APPEND WA TO ITAB1.
          ENDLOOP.
          W_FCAT1-COL_POS = 1.
          W_FCAT1-FIELDNAME = 'CHK'.
          W_FCAT1-TABNAME = 'ITAB'.
          W_FCAT1-CHECKBOX = 'X'.
          W_FCAT1-SELTEXT_L  = 'CHECK'.
          APPEND W_FCAT1 TO T_FCAT1.
          CLEAR W_FCAT1.
          W_FCAT1-COL_POS = 2.
          W_FCAT1-FIELDNAME = 'VBELN'.
          W_FCAT1-TABNAME = 'ITAB'.
          W_FCAT1-SELTEXT_L  = 'SALES'.
          APPEND W_FCAT1 TO T_FCAT1.
          CLEAR W_FCAT1.
          W_FCAT1-COL_POS = 3.
          W_FCAT1-FIELDNAME = 'POSNR'.
          W_FCAT1-TABNAME = 'ITAB'.
          W_FCAT1-SELTEXT_L  = 'ITEM'.
          APPEND W_FCAT1 TO T_FCAT1.
          CLEAR W_FCAT1.
          W_FCAT1-COL_POS = 4.
          W_FCAT1-FIELDNAME = 'MATNR'.
          W_FCAT1-TABNAME = 'ITAB'.
          W_FCAT1-SELTEXT_L  = 'MATERIAL'.
          W_FCAT-OUTPUTLEN = 20.
          APPEND W_FCAT1 TO T_FCAT1.
          CLEAR W_FCAT1.
          W_FCAT1-COL_POS = 5.
          W_FCAT1-FIELDNAME = 'MATWA'.
          W_FCAT1-TABNAME = 'ITAB'.
          W_FCAT1-SELTEXT_L  = 'MATERIAL TYPE'.
          W_FCAT-OUTPUTLEN = 20.
          APPEND W_FCAT1 TO T_FCAT1.
          CLEAR W_FCAT1.
          W_FCAT1-COL_POS = 6.
          W_FCAT1-FIELDNAME = 'MATKL'.
          W_FCAT1-TABNAME = 'ITAB'.
          W_FCAT1-SELTEXT_L  = 'MATERIAL GROUP'.
          W_FCAT-OUTPUTLEN = 20.
          APPEND W_FCAT1 TO T_FCAT1.
          CLEAR W_FCAT1.
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
              I_CALLBACK_PROGRAM = SY-REPID
              IT_FIELDCAT        = T_FCAT1[]
              IS_LAYOUT          = W_LAYOUT
            TABLES
              T_OUTTAB           = ITAB[].
    CLEAR ITAB1.
    CLEAR ITAB1[].
    CLEAR T_FCAT1.
    CLEAR T_FCAT1[].
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Edited by: dharmaji Srinivasu on Feb 6, 2009 1:22 PM

    Hi
    Check out the following links:
    http://www.sapdev.co.uk/reporting/alv/alvgrid_rowsel.htm  " To obtain selected rows
    http://www.sapdev.co.uk/reporting/alv/alvgrid_editable.htm  "To make cells editable
    In the case stmt for particular button you can do:
    loop at itab into wa.
          if wa-sel EQ 'X'.
          Process records that have been selected
          endif.
    endloop.
    Hope this helps
    Regards,
    Jayanthi.K

  • Like SM30 ,table should be display in editable ALV Grid(for Dynamic DB )

    Hi Friends,
    plese help me how to display  ALV grid in editable mode for differnt types of data base tables.
    same as like SM30 transaction.
    Moderator message: please search for available information/documentation/previous discussions before asking.
    Edited by: Thomas Zloch on Nov 11, 2010 6:40 PM

    Hi,
    In SLIS_T_FIELDCAT_ALV you specify the field as edit = X.
    Give it as mentioned, where you assign fieldname and positions etc.
    Thanks&Regards

  • Two Internal tables to be displayed as separate ALV grid.

    Hi Friends,
    I have 2 internal tables say i_tab1 and i_tab2.
    I_TAB1 contains 10 records.
    I_TAB2 contains 15 records.
    My requirement is to display I_TAB1 with title 'Success Records' and ITAB2 with title 'Missed Records'.
    It should be done thro ALV grid Display. I can do using ALV LIST Display. But I need using GRID display.
    Its version 4.6C.
    How to do this?
    Regards,
    Viji

    Hi,
    Use a container and the spliters as below:
    DATA: container1   TYPE REF TO cl_gui_container,
          container2   TYPE REF TO cl_gui_container,
          container3   TYPE REF TO cl_gui_container,
          main1        TYPE REF TO cl_gui_custom_container,
          splitter1    TYPE REF TO cl_gui_splitter_container,
          grid1        TYPE REF TO cl_gui_alv_grid,
          grid2        TYPE REF TO cl_gui_alv_grid,
          grid3        TYPE REF TO cl_gui_alv_grid,
          ls_layo      TYPE lvc_s_layo,
          count        TYPE i VALUE 0,
          g_okcode     LIKE sy-ucomm,
          r1,r2.
    DATA: alv_fcat     TYPE lvc_t_fcat WITH HEADER LINE.
    * First Main Container
    CREATE OBJECT main1
           EXPORTING container_name = 'MAIN_CONTAINER'.
    * First Splitter Container
    CREATE OBJECT splitter1
           EXPORTING parent  = main1
                     rows    = 2
                     columns = 1.
    * Place Container1 in First row First column
    CALL METHOD splitter1->get_container
      EXPORTING
        row       = 1
        column    = 1
      RECEIVING
        container = container1.
    * Place Container2 in Second row First column
    CALL METHOD splitter1->get_container
      EXPORTING
        row       = 2
        column    = 1
      RECEIVING
        container = container2.
    * Create grids
      CREATE OBJECT grid1
             EXPORTING i_parent      = container1.
      CREATE OBJECT grid2
             EXPORTING i_parent      = container2.
    CALL METHOD grid1->set_table_for_first_display
        EXPORTING
          is_layout       = ls_layo
        CHANGING
          it_outtab       = itab1[]
          it_fieldcatalog = alv_fcat[].
    * Display itab2 in grid2
      CALL METHOD grid2->set_table_for_first_display
        EXPORTING
          is_layout       = ls_layo
        CHANGING
          it_outtab       = itab2[]
          it_fieldcatalog = alv_fcat[].

  • How to transport display variants in alv

    Hi,
    Can any one please help me in transporting alv display variants?Actually I have transported the variants ,but only selection variants are getting transported.I want to transport ALV display variants accross the clients.
    Please reply soon.It is very urgent.

    Hi,
    Please use the following :
    First execute the report .
    Then Menubar Settings> Layout> layout management>select your variant> menubar layout--> transport
    This will work only when your variant management is activve in your ALV report.

Maybe you are looking for

  • My company will no longer purchase Creative produ

    I am a purchasing manager for a mid-sized technology company. My duties include, among other things, authorizing the procurement of computers for new-hires, replacements, lending to sub-contractors in a variety of countries, et cetera. All in all, we

  • To send a mail along with a csv attachment.

    Hi All, my requirement is to send a mail along with a csv file attached to it. Could someone provide me their valuable comments that will guide me. I am using the function module. SO_NEW_DOCUMENT_ATT_SEND_API1.

  • Change the video resolution when capturing a WEB-cameras

    Language: Java It is used in addition: JMF When capturing video from WEB-cameras with JMF - getting the video is at the lowest resolution. Can you please tell how to change the video resolution? The code by which the captured image (no SWING-forms):

  • Fcp export mpeg2

    Hi! need some help. Buyed the new G5 quad with 3.5 gb ram mac osX 10.4.8 I was Really happy to noticed the difference from exporting in a G5 1.5 single processor -- to this super jet computer.... 1 hour takes 3 hours and now 45 minutes aprox. But....

  • Dynamically updating ChoiceBox contents

    I want to display a ChoiceBox and update the contents in response to some external event. I tried a simple test but have two problems: 1. The initial selection ("Select ...") is not displayed 2. The selection is cleared when new items are added Here'