Editable Field in ALV TREE Display Using OOPs

Hi,
I am trying to make a field editable on the ALV Tree display. I could create an editable check box. But could not make a field Editable. I have made EDIT = 'X' in the fieldcatalog for the particular field. but  it is not working.
Please help me in solving this. Its very urgent.

You do this with the following code example
  DATA: ls_layout TYPE lvc_s_layi.
  CLEAR ls_layout.
  ls_layout-class     = cl_item_tree_control=>item_class_text.
  ls_layout-editable   = 'X'.
  ls_layout-fieldname = your fieldname.
  APPEND ls_layout TO lt_layout.
add PO header to tree
      CALL METHOD tree->add_node
        EXPORTING
          i_relat_node_key = space
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_po_item
          is_node_layout   = wa_layout_node
          it_item_layout   = lt_layout
Roy

Similar Messages

  • Editable field in alv tree output using cl_gui_alv_tree

    Hi,
    i need Editable field with F4 help in alv tree output using cl_gui_alv_tree.
    regards,
    Naresh

    sadly, this is not possible. An ALV Tree cannot by editable.
    Regards

  • Editable field in alv list display

    i WANT TO GIVE COLOR FOR EDITABLE FIELD IN ALV LIST DISPLAY.i TRIED WITH EMPHASIZE IN FIELD CATALOGUE ASSIGNING.bUT,IT IS NOT WORKING.HOW TO DO.tHANX IN ADVANCE.........

    HI,
    Please refer the link below:
    http://www.****************/Tutorials/ALV/Edit/demo.htm
    http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
    Thanks,
    Sriram Ponna.

  • ALV Tree Hierarchy using OOPS

    Hi all,
    I have developed a program for ALV Tree Hierarchy using OOPs.I followed the SAP demo program.I am not able to get the values in the output.Please can anyone guide me where to correct my program. I am placing the entire code so that you all can also debug and see what is wrong.
    *& Report  ZZHIERARCHY_TEST1
    REPORT  zzhierarchy_test1.
    DATA : alv_container TYPE REF TO cl_gui_custom_container,
           alv_tree      TYPE REF TO cl_gui_alv_tree,
           gt_fcat          TYPE lvc_t_fcat,
           gt_vbrk TYPE vbrk OCCURS 0.                             "Output Table
    DATA : gs_hirarchy_header TYPE treev_hhdr.
    START-OF-SELECTION.
    END-OF-SELECTION.
      CALL SCREEN 9100.
    *&      Module  STATUS_9100  OUTPUT
    MODULE status_9100 OUTPUT.
      SET PF-STATUS 'ALV_TREE'.
      IF alv_container IS INITIAL.
        PERFORM tree_dev.
      ENDIF.
    ENDMODULE.                 " STATUS_9100  OUTPUT
    *&      Form  tree_dev
          text
    FORM tree_dev .
      DATA lv_container_name(20) TYPE c.
      lv_container_name = 'ALV_TREE'.
      CREATE OBJECT alv_container
        EXPORTING
          container_name              = lv_container_name
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          OTHERS                      = 6.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CREATE OBJECT alv_tree
        EXPORTING
          parent                      = alv_container
          node_selection_mode         = cl_gui_column_tree=>node_sel_mode_single
          item_selection              = 'X'
          no_toolbar                  = ''
          no_html_header              = 'X'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          illegal_node_selection_mode = 5
          failed                      = 6
          illegal_column_name         = 7
          OTHERS                      = 8.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      PERFORM build_hirarchy_header CHANGING gs_hirarchy_header.
      PERFORM buid_fieldcatalog.
      CALL METHOD alv_tree->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = gs_hirarchy_header
        CHANGING
          it_outtab           = gt_vbrk               "Table Must be Empty
          it_fieldcatalog     = gt_fcat.
      PERFORM create_hierarchy.
      CALL METHOD alv_tree->frontend_update.
    ENDFORM.                    " tree_dev
    *&      Form  build_hirarchy_header
         <--P_GS_HIRARCHY_HEADER  text
    FORM build_hirarchy_header  CHANGING p_gs_hirarchy_header TYPE treev_hhdr.
      p_gs_hirarchy_header-heading   =  'Company Code'(001).
      p_gs_hirarchy_header-tooltip   =  'Comapny Code'(002).
      p_gs_hirarchy_header-width     =   35.
      p_gs_hirarchy_header-width_pix =   ''.
    ENDFORM.                    " build_hirarchy_header
    *&      Form  buid_fieldcatalog
    FORM buid_fieldcatalog .
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
         i_structure_name             = 'VBRK'
        CHANGING
          ct_fieldcat                  = gt_fcat
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT gt_fcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN 'NETWR'.
            ls_fcat-do_sum = 'X'.
            ls_fcat-h_ftype = 'MAX'.
        ENDCASE.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
    ENDFORM.                    " buid_fieldcatalog
    *&      Form  create_hierarchy
    FORM create_hierarchy .
      DATA : lt_vbrk TYPE TABLE OF vbrk,
             ls_vbrk TYPE vbrk.
      DATA : top_key     TYPE lvc_nkey,
             company_key TYPE lvc_nkey,
             bzirk_key   TYPE lvc_nkey.
      DATA : lv_bukrs     TYPE bukrs,
             lv_bukrs_prv TYPE bukrs,
             lv_bzirk     TYPE bzirk,
             lv_bzirk_prv TYPE bzirk.
      SELECT * FROM vbrk INTO TABLE lt_vbrk UP TO 500 ROWS.
      SORT lt_vbrk BY bukrs .
      CALL METHOD alv_tree->add_node
        EXPORTING
          i_relat_node_key     = ''
          i_relationship       = cl_gui_column_tree=>relat_last_child
          i_node_text          = 'Company Code'
        IMPORTING
          e_new_node_key       = top_key
        EXCEPTIONS
          relat_node_not_found = 1
          node_not_found       = 2
          OTHERS               = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT lt_vbrk INTO ls_vbrk.
        lv_bukrs = ls_vbrk-bukrs .
        lv_bzirk = ls_vbrk-bzirk .
        IF lv_bukrs <> lv_bukrs_prv.
          lv_bukrs_prv =  lv_bukrs.
          PERFORM add_node USING lv_bukrs
                                 top_key
                        CHANGING company_key.
        ENDIF.
        IF lv_bzirk <> lv_bzirk_prv.
          lv_bzirk_prv = lv_bzirk.
          PERFORM add_posnr USING lv_bzirk
                                  company_key
                         CHANGING bzirk_key.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " create_hierarchy
    *&      Form  add_node
         -->P_LV_BUKRS  text
         -->P_TOP_KEY  text
         <--P_COMPANY_KEY  text
    FORM add_node  USING    p_lv_bukrs    TYPE bukrs
                            p_top_key     TYPE lvc_nkey
                   CHANGING p_company_key TYPE lvc_nkey .
      DATA: l_node_text TYPE lvc_value,
            ls_vbrk TYPE vbrk.
      l_node_text = 'Company' .
      CALL METHOD alv_tree->add_node
        EXPORTING
          i_relat_node_key     = p_top_key
          i_relationship       = cl_gui_column_tree=>relat_last_child
          is_outtab_line       = ls_vbrk
          i_node_text          = l_node_text
        IMPORTING
          e_new_node_key       = p_company_key
        EXCEPTIONS
          relat_node_not_found = 1
          node_not_found       = 2
          OTHERS               = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " add_node
    *&      Form  add_posnr
          text
         -->P_LV_POSNR  text
         -->P_COMPANY_KEY  text
         <--P_POSNR_KEY  text
    FORM add_posnr  USING    p_lv_bzirk    TYPE bzirk
                             p_company_key TYPE lvc_nkey
                    CHANGING p_bzirk_key   TYPE lvc_nkey.
      DATA ls_vbrk TYPE vbrk.
      CALL METHOD alv_tree->add_node
        EXPORTING
          i_relat_node_key     = p_company_key
          i_relationship       = cl_gui_column_tree=>relat_last_child
          is_outtab_line       = ls_vbrk
          i_node_text          = 'Sales District'
        IMPORTING
          e_new_node_key       = p_bzirk_key
        EXCEPTIONS
          relat_node_not_found = 1
          node_not_found       = 2
          OTHERS               = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " add_posnr
    *&      Module  USER_COMMAND_9100  INPUT
    MODULE user_command_9100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
      CALL METHOD alv_container->free.
      LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9100  INPUT

    Check this forum there are many threads on this.

  • Editable Field in ALV Tree Control

    Hello All,
    Can anyone tell me how can i make a field editable in an Alv Tree grid. I have tried with fiedcatalog-edit = 'X'. but that doesn't work. 
    also please provide a piece of code to be clear ...
    Thanks,
    Ravi Aswani

    hI ,
    Data : LI_fieldcat  type lvc_t_fcat,
              ls_fcat type lvc_s_fcat.
    IF OKCODE = 'MAIN'.
          CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
        I_BUFFER_ACTIVE              =
          i_structure_name             = 'ZCUS'
        I_CLIENT_NEVER_DISPLAY       = 'X'
        I_BYPASSING_BUFFER           =
        I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = LI_fieldcat[]            .
      LOOP AT LI_FIELDCAT INTO LS_FCAT.
        CASE ls_fcat-fieldname.
          WHEN 'KUNNR'.
            ls_fcat-col_pos = 1.
          WHEN 'NAME1'.
            ls_fcat-edit = 'X'.
            ls_fcat-col_pos = 2.
          WHEN 'ORT01'.
            ls_fcat-edit = 'X'.
            ls_fcat-col_pos = 3.
            ls_fcat-drdn_hndl = '1'.
            ls_fcat-outputlen = 20.
          WHEN 'LAND1'.
            ls_fcat-edit = 'X'.
            ls_fcat-col_pos = 4.
        ENDCASE.
        MODIFY LI_fieldcat FROM ls_fcat.
      ENDLOOP.
    ENDIF.
    With this The internal Table contains 4 fields Kunnr Name1 Ort01 Land1 Here Kunnr is the Key field so , it is not editable , reaming fields are Editable.
    There u must write the Modify statement.
    check it once
    Regards
    Krishna

  • ALV GRID Display using oops in sub screen in which sub screen is in tab

    Hi Mac,
    My requirement is to display an ALV Grid with data in a subscreen which is called in tab strip.
    Could you please help me the code of how actaully i can call th ALV in the tab.
    I want to display one field in editable and remaining 4 fields in display mode.
    Does any one had faced the same issue.This is standard program cloning object.
    Thanks
    Satish Raju

    what is the question? Callin grid in subscreen is the same as in other screen. Create PBO module for creating the grid, PAI to evaluate comands.
    Regards,
    Clemens

  • Editable field with F4 help in alv tree output using cl_gui_alv_tree

    HI
    i need Editable field with F4 help in alv tree output using cl_gui_alv_tree
    Regards
    Naresh

    Hi Naresh,
    Pass the field catalog with the additional parameter (ls_fcat-edit = 'X'.).
    for F4 help if the data element have the search help it automatically will come. other wise include the additional parameter in the field catalog (ls_fcat-F4AVAILABL = 'X')
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • Edit a field in ALV tree in a subscreen of a module pool

    Hi
    I want to make a field editable in the ALV tree based on some condtions in a subscreen of a module pool.  I used the edit = 'X' field in the fieldcatalog still it  is showing the field as display and not edit.
    Please help me to get the field as editable and save it to the database table.
    Please not this is ALV TREE
    Regards,
    Mozila

    Hi Mayank,
    Thanks for the reply
    I am using oops method.
    I tried making the field which is to be made editable  as wa_fieldcatalog-edit = 'X'. But its not working. I didnt get you when you said  edit in layout object.
    I also went through the demo programs but these programs are not having editable fields.
    My code is as follows:
    IF tree4 IS INITIAL.
    * create container for alv-tree
      l_tree_container_name = 'TREE4'.
      CREATE OBJECT l_custom_container
        EXPORTING
          container_name              = l_tree_container_name
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5.
    * create tree control
      CREATE OBJECT tree4
        EXPORTING
          i_parent                    = l_custom_container
          i_node_selection_mode       = cl_gui_column_tree=>node_sel_mode_multiple
          i_item_selection            = 'X'
          i_no_html_header            = 'X'
          i_no_toolbar                = 'X'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          illegal_node_selection_mode = 5
          failed                      = 6
          illegal_column_name         = 7.
    * create hierarchy
      CALL METHOD tree4->set_table_for_first_display
        EXPORTING
          is_layout       = s_layo
        CHANGING
          it_sort         = it_sort
          it_outtab       = it_final
          it_fieldcatalog = it_fieldcat.
    ELSE.
      CALL METHOD tree4->refresh_table_display
        EXPORTING
          it_sort           = it_sort
        EXCEPTIONS
          program_error     = 1
          failed            = 2
          cntl_system_error = 3
          others            = 4
      IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endif.

  • How to make some fields in ALV tree editable

    Hello All,
    Can any one tell me how to make some fields in ALV tree editable.
    If possible please post some code.
    Regards,
    Lisa.

    Hi Lisa,
    I want to make 3 fields in the ALV tree editable and update the saved values in ztable.
    I tried making the wa_fieldcat-edit = 'X' But in vain.
    Also i made the layout fields  wa_layout-edit = 'X'  and wa_layout-edit_mode = 'X'.
    But still the alv tree field appears as display.
    As you have mentioned in the post as answered, So please guide me to make the field editable.
    I am using oops method.
    Please provide me code if any.
    Thanks & Regards,
    Mozila

  • Toolbar in alv display using oops alv

    i have written code for displaying toolbar in alv display using oops, but it is not displaying please find the below code and let me know reason.
    *& Report  ZTRANSFER_ORDER2                                            *
    REPORT  ZTRANSFER_ORDER2   .
    *& Report  ZTRANSFER_ORDER                                             *
       TABLES:sflight.
       TYPE-POOLS : icon.
      * G L O B A L   I N T E R N  A L   T A B L E S
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    types : begin of ty_mara,
            matnr type matnr,
            mtart type mtart,
            mbrsh type mbrsh,
            matkl type matkl,
            bismt type bismt,
            meins type meins,
            end of ty_mara.
      DATA: t_mara type STANDARD TABLE OF ty_mara.
      * G L O B A L   D A T A
       DATA: ok_code LIKE sy-ucomm,
             g_wa_mara type ty_mara.
        DATA : t_fcat type LVC_T_FCAT.
      DATA  : l_VAR TYPE disvariant.
      DATA :  gs_layout type lvc_s_layo.
      * Declare reference variables to the ALV grid and the container
    G L O B A L   D A T A
      DATA: ok_code LIKE sy-ucomm.
    Declare reference variables to the ALV grid and the container
       DATA:
         go_grid             TYPE REF TO cl_gui_alv_grid,
         go_custom_container TYPE REF TO cl_gui_custom_container.
      data :  it_toolbar  TYPE stb_button,
      event_receiver TYPE REF TO lcl_event_receiver.
      * S T A R T - O F - S E L E C T I O N.
       START-OF-SELECTION.
        CALL SCREEN 100   .
    *CLASS lcl_event_receiver DEFINITION.
    CLASS lcl_event_receiver DEFINITION.
    PUBLIC SECTION.
        CLASS-METHODS:
    *handling toolbar for interactive
         handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
    *handling menu button
         handle_menu_button
            FOR EVENT menu_button OF cl_gui_alv_grid
                IMPORTING e_object e_ucomm,
    *On click of the menu button
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
        PRIVATE SECTION.
        ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
    METHOD handle_toolbar.
    handle toolbar
    CLEAR it_toolbar.
    MOVE 'DETAIL' TO it_toolbar-function.
        MOVE icon_detail TO it_toolbar-icon.
        MOVE 2 TO it_toolbar-butn_type.
        APPEND it_toolbar TO e_object->mt_toolbar.
        ENDMETHOD.                    "handle_toolbar
        METHOD handle_menu_button.
    handle own menubuttons
        IF e_ucomm = 'DETAIL'.
          CALL METHOD e_object->add_function
            EXPORTING
              fcode = 'DISPLAY'
              text  = 'DISPLAY'.
        ENDIF.
      ENDMETHOD.                    "handle_menu_button
      METHOD handle_user_command.
    *On click
        CASE e_ucomm.
          WHEN 'DISPLAY'.
            MESSAGE 'Menu Clicked' TYPE 'I'.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
      *&      Module  USER_COMMAND_0100  INPUT
      MODULE user_command_0100 INPUT.
        CASE ok_code.
          WHEN 'EXIT'.
            LEAVE TO SCREEN 0.
        ENDCASE.
      ENDMODULE.                 " USER_COMMAND_0100  INPUT
      *&      Module  STATUS_0100  OUTPUT
       MODULE status_0100 OUTPUT.
        sET PF-STATUS 'STATUS'.
    Create objects
         IF go_custom_container IS INITIAL.
           CREATE OBJECT go_custom_container
             EXPORTING container_name = 'ALV_CONTAINER'.
           CREATE OBJECT go_grid
             EXPORTING
               i_parent = go_custom_container.
           PERFORM load_data_into_grid.
         ENDIF.
       ENDMODULE.                 " STATUS_0100  OUTPUT
      *&      Form  load_data_into_grid
       FORM load_data_into_grid.
    Read data from table SFLIGHT
         SELECT matnr mtart mbrsh matkl bismt meins
           FROM mara
           INTO corresponding fields of TABLE t_mara.
       PERFORM fld_cate changing T_fcat.
        l_var-report = sy-repid.
      gs_layout-grid_title = 'Analysis Report'.
    gs_layout-NO_TOOLBAR = 'X'.
    gs_layout-BOX_FNAME = 'Selection'.
    Load data into the grid and display them
            caLL METHOD go_grid->set_table_for_first_display
            EXPORTING
            i_structure_name = 'S_MVKE'
              i_save          = 'A'
               is_variant       = l_var
                is_layout             = gs_layout
           CHANGING
             it_outtab        = t_mara[]
             it_fieldcatalog  = t_fcat.
      endform.
    *&      Module  pai  INPUT
          text
    MODULE pai INPUT.
    data: l_valid type c.
       clear ok_code.
       break-point.
       ok_code = sy-ucomm.
           CASE ok_code.
           WHEN 'EXIT'.
             LEAVE TO SCREEN 0.
           WHEN 'BACK'.
             call method go_grid->check_changed_data
                 importing
                    e_valid = l_valid.
            loop at t_mara into g_wa_mara.
            endloop.
         ENDCASE.
    ENDMODULE.                 " pai  INPUT
    *&      Form  fld_cate
          text
         <--P_T_FCAT  text
    FORM fld_cate  CHANGING P_T_FCAT  TYPE lvc_t_fcat.
    DATA : s_fcat type LVC_S_FCAT .
    REFRESH: t_fcat.
      CLEAR s_fcat.
    s_fcat-fieldname = 'BOX1'.
    s_fcat-coltext =   'Box1'.
    s_fcat-seltext =   'Box1'.
    s_fcat-CHECKBOX = 'X'.
    s_fcat-EDIT = 'X'.
    APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
      s_fcat-row_pos = 1.
      s_fcat-col_pos = 1.
      s_fcat-fieldname = 'MATNR'.
      s_fcat-ref_field = 'MATNR'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Material'.
      s_fcat-seltext =   'Material'.
    s_fcat-EDIT = 'X'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
       s_fcat-row_pos = 2.
      s_fcat-col_pos = 2.
      s_fcat-fieldname = 'MTART'.
      s_fcat-ref_field = 'MTART'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Material type'.
      s_fcat-seltext =   'Material type'.
      APPEND s_fcat TO P_T_FCAT.
    CLEAR s_fcat.
    s_fcat-fieldname = 'BOX2'.
    s_fcat-coltext =   'Box2'.
    s_fcat-seltext =   'Box2'.
    s_fcat-CHECKBOX = 'X'.
    s_fcat-EDIT = 'X'.
    APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
      s_fcat-row_pos = 3.
      s_fcat-col_pos = 3.
      s_fcat-fieldname = 'MBRSH'.
      s_fcat-ref_field = 'MBRSH'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Industry Sector'.
      s_fcat-seltext =   'Industry Sector'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
        s_fcat-row_pos = 4.
      s_fcat-col_pos = 4.
      s_fcat-fieldname = 'MATKL'.
      s_fcat-ref_field = 'MATKL'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Material Group'.
      s_fcat-seltext =   'Material Group'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
        s_fcat-row_pos = 5.
      s_fcat-col_pos = 5.
      s_fcat-fieldname = 'BISMT'.
      s_fcat-ref_field = 'BISMT'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Old material number'.
      s_fcat-seltext =   'Old material number'.
      APPEND s_fcat TO P_T_FCAT.
      CLEAR s_fcat.
        s_fcat-row_pos = 6.
      s_fcat-col_pos = 6.
      s_fcat-fieldname = 'MEINS'.
      s_fcat-ref_field = 'MEINS'.
      s_fcat-ref_table = 'T_MARA'.
      s_fcat-coltext =   'Base Unit of Measure'.
      s_fcat-seltext =   'Base Unit of Measure'.
      APPEND s_fcat TO P_T_FCAT.
    CLEAR s_fcat.
    s_fcat-fieldname = 'BOX3'.
    s_fcat-coltext =   'Box3'.
    s_fcat-seltext =   'Box3'.
    s_fcat-CHECKBOX = 'X'.
    s_fcat-EDIT = 'X'.
    APPEND s_fcat TO P_T_FCAT.
    ENDFORM.                    " fld_cate                     .

    MOVE 2 TO it_toolbar-butn_type.
    Try changing the 2 (menu) to 0 (button) and see if that helps
    also you need to set the event handler after you create your alv object
    set handler handle_toolbar for [whatever object is called].
    Edited by: Kev Mycock on Jul 24, 2008 7:59 AM

  • Problem in displaying Alv grid output  using oops........

    hi,
    i have two problems in displaying ALV grid output Using Oops.
    1) How to modify the fieldcatalog after we getting a field catalog using general FM.
    2) initialy it is displaying 13 fields but there are 63 fields .
       eventhough we chage the layout to 63 fields it is displaying only 13 fields , these 13 fields may be different based on our selection but count  of displayed fileds are same . how can display 63 fields at a time .

    Hi,
    You can chnage using below code:
    loop at gt_fieldcat.
    if <gt_fieldcat-field_name> = 'FIELDNAME'.
    endif.
    modify gt_fieldcat.
    clear gt_fieldcat.
    endloop.
    Make sure that all the field should not have no_out = 'X' and tech = 'X'.
    Thanks,
    Sriram Ponna.

  • How to display the fields in ALV Output without using Field catalog?

    How to display the fields in ALV Output without using Field catalog?
    Could you pls tell me the coding?
    Akshitha.

    Hi,
    u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
    data: itab type table of mara.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_structure_name = itab
    CHANGING
    ct_fieldcat = lt_fieldcat[]
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *Pass that field catalog into the fillowing FM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_grid_title            = 'REPORTING'
                is_layout              = gt_layout
                it_fieldcat             = lt_fieldcat[]
           tables
                t_outtab                = itab.

  • End of page in ALV display using OOPS

    Hi all,
       How can i display end of page or footer in ALV display using OOPS concept.
    Thanks,
    vinit

    Hi ,
    Try using this code.
    First add a handler method in your handler class definition as:
    e.g. METHOD handle__end_of_page
    FOR EVENT print_end_of_page OF cl_gui_alv_grid .
    Then implement the method in the implementation part of your local class.
    e.g. METHOD handle_print_end_of_page .
    WRITE:/ 'Flights Made on ', sy-datum .
    ENDMETHOD .
    And register this method as the handler.
    SET HANDLER gr_event_handler->handle_print_end_of_page FOR gr_alvgrid .
    Hope this helps.
    Regards,
    Janaki.

  • ALV Report Development using OOPs concept

    complete details of " ALV Report Development using OOPs concept".
    Thanks in advance ...

    hi Sudharshan,
    please use these sample codes to understand about OOALV
    BC_ALV_GRID_CONTROL
    BC_ALVHIERGRID1_D100
    BC_ALVHIERGRID1_D210
    BC_ALVHIERGRID1_HIER
    BC_ALV_DEMO_HTML_D0100
    BC_ALV_GRID_CONTROL
    BC_ALVEXCEL
    BC_ALVEXCEL_D100
    BC_ALVEXCEL_D210
    BC_ALVEXCEL_HIER
    BC_ALVEXCEL_SAP_TEMPL
    BC_ALVEXCEL_SAP_TEMPL_F01
    BC_ALVEXCEL_SAP_TEMPL_TOP
    BC_ALVEXCELTOP
    BC_ALVHIERGRID1_D100
    BC_ALVHIERGRID1_D210
    BC_ALVHIERGRID1_HIER
    BC_ALVHIERTOP
    For learning OOPS-ALV in every SAP their is transaction named ZALV
    or try the following links:
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    The ALV object Grid methods allow the same functionality as ALV grid report function modules but are displayed within
    a screen (dialog program). SAP has provided a suit of programs which demonstrate how to For examples see standard SAP
    programs as detailed below:
    BCALV_EDIT_01 This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.
    BCALV_EDIT_02 This report illustrates how to set chosen cells of an ALV Grid Control editable.
    BCALV_EDIT_03 In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.
    The report checks the input value(s) semantically and provides protocol messages in case of error
    BCALV_EDIT_04 This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to
    implement the saving of the new data.
    BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:
    (1) how to define a column for editable checkboxes for an attribute of your list
    (2) how to evaluate the checked checkboxes
    (3) how to switch between editable and non-editable checkboxes
    BCALV_EDIT_06 This example shows how to define a dropdown listbox for all cells of one column in an editable ALV
    Grid Control.
    BCALV_EDIT_07 This example shows how to define dropdown listboxes for particular cells of your output table.
    BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects
    are dealt with:
    (1) how to replace the standard f4 help
    (2) how to pass the selected value to the ALV Grid Control
    (3) how to build an f4 help, whose value range depend on a value of another cell.

  • Get cursor field in ALV Tree

    Hello all,
    How do I get a cursor field on ALV Tree report? I have output with po number, vendor no etc. When I double click PO, i shuold display ME23N and on vendor no 'XK03' etc. Double click event is triggered, but how do I check which field is clicked? Anybody pls suggest me.
    Thanks,
    Chandni

    Hi,
    you can use method to get the select lines:
      CALL METHOD TREE->GET_SELECTED_NODES
       CHANGING
         CT_INDEX_OUTTAB   = SELECTED_NODES
        EXCEPTIONS
          CNTL_SYSTEM_ERROR = 1
          DP_ERROR          = 2
          FAILED            = 3
          OTHERS            = 4.
    or in double click:
        METHODS HANDLE_DOUBLE_CLICK
          FOR EVENT ITEM_DOUBLE_CLICK OF CL_GUI_ALV_TREE_SIMPLE
          IMPORTING FIELDNAME INDEX_OUTTAB GROUPLEVEL.
    just read tables with index_outttab
    READ TABLE GT_TAB INTO IGT_TAB INDEX INDEX_OUTTAB.
    to check which  field is clicked use the FIELDNAME field.
    regards

Maybe you are looking for

  • Snapshot boot with TuxOnIce?

    Hi, Is it possible to snapshot boot with TuxOnIce? That means, to have a image of booted system and "resume from hybernate" each time instead of normal booting. When i boot → open xterm → hybernate → resume (without anything opened), resuming takes a

  • Org unit error !!!

    Hi I have a few questions and an org unit error when trying to process a quotation. Details below. If anyone can help, then that would be great. "ORG UNIT (SALES) DOES NOT HAVE THESE ATTRIBUTES" Org unit (sales) does not have these attributes Message

  • How to call dicoverer through menu option in forms

    Hi, Need help.........Can anybody tell me .....how to call dicoverer through menu option in forms. Thanx Sunil

  • Trying to activate my 3GS and the phone will not recognise the sim and will not activate

    Help Please I have changed my call plan with my service provider from contract to PAYG and have just tried to upgrade my 3Gs to IOS 5.0.1. I have purchase a iPhone 4 and was using the 3Gs as  back up. I set the phone to factory restore as it was bein

  • Optimize after 10.9.5 update

    After I updated from 10.9.4 to 10.9.5, I had a small window next to Notifications saying something about Optimize my Mac or else  -.. I forget, battery life or slower until I optimize.  I clicked on it & noting happened. I could only click "close." T