Double Click on ALV Grid

Hi,
I have this doubt regarding ALV grid display.
I am displaying a list using REUSE_ALV_GRID_DISPLAY.
I need to go to a transaction when i double click on a particular line on the output list based on the content of the 1st cell of that line. (ie if i have 4 columns and 5 records and click on the 3rd column of 2nd record then i need to know the value of the 1st field of the 2nd record)
I am using a call back user command subroutine to capture the index and the field which has been clicked upon. This index is giving perfect result by which I am reading the output table and doing the later operations.
But what if i sort the list in ALV by any column? Then the index that I will get on double clicking will correspond to the index on the screen but not to the index on my internal output table. In that case I will get a wrong value of the 1st field.
I do not want to use OO alv. Is there a way to handle this situation?
Regards,
Shinjan

Hello Shinjan,
When i display an output table say t_out on ALV GRID, the records in the table shown on the grid is identical to what i have in t_out. Hence the tabindex will correspond to that very record in t_out.
But when i sort the table on the grid, the order of the rows changes... so for example a row which had index 2 will now have an index 6 (say). So on clicking this record, the tabindex will be 6 where as the same record exist in 2nd position in t_out. How to handle this?
{quote]
Did you try this scenario? Your output table t_out also gets refarranged after SORT. Good thing is you DONOT have to code anything for this )
As per your example the table t_out will be rearranged so that the initial 2nd record will be at 6th posn.
FORM f_user_command  USING   fp_v_ucomm   TYPE syucomm
                             fp_selfield  TYPE slis_selfield."#EC CALLED
  CONSTANTS:
          l_c_ic1           TYPE char4 VALUE '&IC1',
          l_c_vl            TYPE char2 VALUE 'VL',
          l_c_vl03n         TYPE char5 VALUE 'VL03N'.
  CASE fp_v_ucomm.
* Ok code for double code
    WHEN l_c_ic1.
      IF fp_selfield-tabindex NE space.
        READ TABLE it_final INTO wa_final           "it_final gets rearranged as per the SORT condition
                               INDEX fp_selfield-tabindex. "tabindex keeps the correct index after SORT
        SET PARAMETER ID l_c_vl FIELD wa_final-vbeln.
        CALL TRANSACTION l_c_vl03n AND SKIP FIRST SCREEN.
      ENDIF.
  ENDCASE.
ENDFORM.                    "f_user_command
Please check & let us know.
BR,
Suhas
Edited by: Suhas Saha on Jan 2, 2009 11:48 AM
Edited by: Suhas Saha on Jan 2, 2009 11:53 AM

Similar Messages

  • Double-click in ALV Grid on BDC recording not recorded

    Hi,
    I'm recording a BDC session in a CRM system to enter a business partner.  One of the steps is to choose a marketing attribute.  To do this you have to double click on a (read only) ALV grid to select the attribute.
    When I record this in SHDB or LSMW, the double click is never recorded?
    Anybody else had problems recording a double click in an ALV grid.
    Thanks
    Naidoo

    Unfortunely, BDC and gui controls do not get along.   The ALV_Grid uses a gui control to intereactive with the user.  Doing a recording over these kinds of transaction is not suggested for this very reason.  You will have to find another way to achieve your result.  Is there any BAPI or function module which does this functionality?
    Regards,
    Rich Heilman

  • Double click in alv grid not refreshing until I click elsewhere

    Hello,
    I'm very new to abap and just managed to partly implement double click in an alv grid.
    I also created a button that calls the exact same function as double click (selects the row and fills in the data areas on the page). When I use the button, everything works fine, but when I double click, nothing changes until I click on a tab or other form of input button on the page.
    I have followed the process in debugging and can't find the fault anywhere.
    My double click is implemented by:
               create object lcl_event_receiver.
               set handler lcl_event_receiver->double_click
                    for search_alv_grid.
              endif.
    CLASS lcl_event_handler DEFINITION.
        public section.
        methods:
        double_click         for event double_click
                             of cl_gui_alv_grid.
    ENDCLASS.               "lcl_event_handler
    CLASS lcl_event_handler IMPLEMENTATION.
    *       METHOD double_click                                           *
      method double_click.
      perform select_search_result.
      endmethod.                    "double_click
    ENDCLASS. 
    Any help would be much appreciated

    Hello,
    Try using the template code given below.  Let me know if you have any questions.
    data : GT_EVENTS TYPE SLIS_T_EVENT.
    get event
    PERFORM BUILD_EVENT_TOPOFPAGE USING GT_EVENTS[].
    display alv data
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = W_xxxxx
    IT_FIELDCAT = GT_xxxx
    IT_EVENTS = GT_EVENTS[]
    TABLES
    T_OUTTAB = T_xxxx
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    get event perform
    FORM BUILD_EVENT_TOPOFPAGE USING LT_EVENTS TYPE SLIS_T_EVENT.
    DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = LT_EVENTS.
    Read double click event using the below statement
    READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
    INTO LS_EVENT.
    IF SY-SUBRC = 0.
    ENDIF.
    ENDFORM. " BUILD_EVENT_TOPOFPAGE
    FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM
    LS_SELFIELD TYPE SLIS_SELFIELD.
    CASE L_UCOMM.
    WHEN <double click>
        Perform do_something.
    ENDCASE.
    ENDFORM. " USER_COMMAND
    Best Regards,
    Krishna

  • Double-click in ALV grid should take to BSP application

    Hi,
    In the portals, in an application, R/3 ALV grid is displayed. On double clicking one of the entries in the list, corresponding transaction in R/3 is opened and the details are displayed. Now, instead of opening the transaction in R/3, Corresponding PCUI application has to be opened. Is it possible to do it Portals? Can you please tell me how this can be acheived?
    Thanks & Regards
    G.Raja
    P.S:- I'm not sure whether this topic can be discussed in this forum. Since the functionality is required in Portals, I'm putting it here.

    Hello G.Raja,
    I think we should connect the Topics:
    <a href="https://forums.sdn.sap.com/thread.jspa?threadID=70688">Calling PCUI application on clicking ALV grid in portals</a> by a link.
    Regards
    Gregor

  • How to handle double click on alv grid

    When I want to double click on a row of the alv grid, I want to give a message or redirecting the user to the row details screen..
    I wait for your helps.
    Thanks alot.

    Hello,
    Check this report:
    FORM ALV_DISPLAY.
    *--- ALV List Display
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM          = G_PROGNAME
                I_CALLBACK_USER_COMMAND    = G_CALLBACK_USER_COMMAND
                IT_FIELDCAT                 = G_T_FIELDCAT
    *            IT_EVENTS                   = IT_EVENTS
           TABLES
                T_OUTTAB                    = G_T_OUTTAB
           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.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  F_USER_COMMAND_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM F_ALV_USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                                  RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
    *--- Hotspot selektion
          CASE RS_SELFIELD-FIELDNAME.
            WHEN 'POSID'.
    *------ PSP-Element
    *-------- Click auf PSP Element -> PSP Element anzeigen (CJ12)
              SET PARAMETER ID 'PSP' FIELD SPACE.
              SET PARAMETER ID 'PRO' FIELD RS_SELFIELD-VALUE.
              CALL TRANSACTION 'CJ12' AND SKIP FIRST SCREEN.
            WHEN 'STTXT_INT'.
    *------ Systemstatus
              G_STTXT_INT = RS_SELFIELD-VALUE.
    *-------- G_T_LEGENDE erfüllen
              PERFORM F_FILL_G_T_LEGENDE_INT.
              G_R_LAYOUT-WINDOW_TITLEBAR = 'Systemstatus'(004).
              PERFORM F_STATUS_LEGENDE_POPUP.
            WHEN 'STTXT_EXT'.
    *------ Anwenderstatus
              G_STTXT_EXT = RS_SELFIELD-VALUE.
    *-------- G_T_LEGENDE erfüllen
              PERFORM F_FILL_G_T_LEGENDE_EXT.
              G_R_LAYOUT-WINDOW_TITLEBAR = 'Anwenderstatus'(005).
              PERFORM F_STATUS_LEGENDE_POPUP.
          ENDCASE.
      ENDCASE.
    ENDFORM. "F_USER_COMMAND_ALV
    IF useful reward.
    Vasanth

  • Double click in ALV.

    How do I execute Double click event in grid and list disaplay?

    Hi
    Kindly check the following threads:
    Re: Double click event of alv grid control
    double click on alv grid
    Re: Using double click event in ALV Grid
    you can find some code samples from the above links.
    Hope this helps!
    best regards,
    Thangesh

  • Double click in ALV tree output????

    Hi all,
    I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issue of double clicking.
    Please tell how to handle events in this report tree display.
    For the following code its displaying output in tree format and in right way. But i need to add double click functionality to this.
    So provide me some sample program for this one....
    * create hierarchy
      CALL METHOD tree1->set_table_for_first_display
              EXPORTING
                   it_list_commentary   = lt_list_commentary
                   i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = ls_variant
              CHANGING
                   it_sort              = gt_sort[]
                   it_outtab            = itab_outtab
                   it_fieldcatalog      = t_fieldcat. "gt_fieldcatalog.
    * expand first level
      CALL METHOD tree1->expand_tree
             EXPORTING
                 i_level = 1.
    * optimize column-width
      CALL METHOD tree1->column_optimize
               EXPORTING
                   i_start_column = tree1->c_hierarchy_column_name
                   i_end_column   = tree1->c_hierarchy_column_name.
    In grid ALV we can have double cilck functionality using code:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program       = w_repid
                i_callback_pf_status_set = 'PF_STATUS'
                i_callback_user_command  = 'USER_COMMAND'
                is_layout                = ls_layout
                it_fieldcat              = gt_fc[]
    Here we can write subroutine for USER_COMMAND and handle the double click evenet. But tell me how to provide this in tree ALV.
    <REMOVED BY MODERATOR>
    Regards,
    Sachin
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 1:47 PM

    Hello Sachin
    The following sample report ZUS_SDN_ALV_TREE_DEMO demonstrates the crucial parts for double-click event handling (nodes & items) in ALV trees.
    *& Report  ZUS_SDN_ALV_TREE_DEMO
    *& Thread: double click in ALV tree output????
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="742412"></a>
    REPORT  zus_sdn_alv_tree_demo.
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    TYPE-POOLS: abap.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knvv AS data.
    TYPES: nkey       TYPE lvc_nkey.
    TYPES: parent_key TYPE lvc_nkey.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA: gt_outtab    TYPE ty_t_outtab.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      gt_fcat          TYPE lvc_t_fcat,
      gs_layout        TYPE lvc_s_layo,
      gs_variant       TYPE disvariant,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_tree          TYPE REF TO cl_gui_alv_tree.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
        handle_node_double_click
          FOR EVENT node_double_click OF cl_gui_alv_tree
          IMPORTING node_key,
        handle_item_double_click
          FOR EVENT item_double_click OF cl_gui_alv_tree
          IMPORTING node_key
                    fieldname.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_node_double_click.
        message 'Event=Double-Click on Node' type 'I'.
        call transaction 'XD03'.
      ENDMETHOD.                    "handle_node_double_click
      METHOD handle_item_double_click.
        message 'Event=Double-Click on Item' type 'I'.
        call transaction 'VA03'.
      ENDMETHOD.                    "handle_item_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      PERFORM init_controls.
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      container                   =
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          lifetime_dynpro_dynpro_link = 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.
      CALL SCREEN '0100'.
    ** NOTE: no elements on screen
    **  PROCESS BEFORE OUTPUT.
    **    MODULE STATUS_0100.
    **  PROCESS AFTER INPUT.
    **    MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
      CASE gd_okcode.
        WHEN 'BACK'  OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'REFRESH'.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  init_controls
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          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 tree control
      CREATE OBJECT go_tree
        EXPORTING
            parent              = go_docking
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple
            item_selection      = 'X'  " required for double-click event on item
            no_html_header      = ''
            no_toolbar          = ''
        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.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    * create Hierarchy-header
      DATA ls_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING ls_hierarchy_header.
      PERFORM build_fieldcatalog.
      PERFORM set_layout_and_variant.
    * create emty tree-control
      CALL METHOD go_tree->set_table_for_first_display
        EXPORTING
    **      i_structure_name     = 'KNVV'
          is_variant           = gs_variant
          i_save               = 'A'
    *      i_default            = 'X'
          is_hierarchy_header  = ls_hierarchy_header
    *      is_exception_field   =
    *      it_special_groups    =
    *      it_list_commentary   =
    *      i_logo               =
    *      i_background_id      =
    *      it_toolbar_excluding =
    *      it_except_qinfo      =
        CHANGING
          it_outtab            = gt_outtab
    *      it_filter            =
          it_fieldcatalog      = gt_fcat.
    * create hierarchy
      PERFORM create_hierarchy.
    * register events
      PERFORM register_events.
    * adjust column_width
      CALL METHOD go_tree->column_optimize.
    ENDFORM.                    " init_controls
    *&      Form  build_hierarchy_header
    *       build hierarchy-header-information
    *      -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.          "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'.  "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
      REFRESH: gt_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNVV'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        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.
      DELETE gt_fcat FROM 8.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT_AND_VARIANT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout_and_variant .
      CLEAR: gs_layout,
             gs_variant.
      gs_variant-report = syst-repid.
      gs_variant-handle = 'TREE'.
    ENDFORM.                    " SET_LAYOUT_AND_VARIANT
    *&      Form  create_hierarchy
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_hierarchy .
      DATA: ls_knvv    TYPE sflight,
            ls_outtab  TYPE ty_s_outtab,
            lt_outtab  TYPE ty_t_outtab.
    * get data
      SELECT * FROM knvv INTO CORRESPONDING FIELDS OF TABLE lt_outtab
                            UP TO 200 ROWS .                "#EC CI_NOWHERE
      SORT lt_outtab BY kunnr vkorg.
    * add data to tree
      DATA: ld_kunnr_key TYPE lvc_nkey,
            ld_vkorg_key TYPE lvc_nkey,
            ld_last_key  TYPE lvc_nkey.
      LOOP AT lt_outtab INTO ls_outtab.
        ON CHANGE OF ls_outtab-kunnr.
          PERFORM add_customer_line USING    ls_outtab-data
                                  CHANGING ld_kunnr_key.
        ENDON.
        ON CHANGE OF ls_outtab-vkorg.
          PERFORM add_salesorg_line USING    ls_outtab-data
                                             ld_kunnr_key
                                  CHANGING ld_vkorg_key.
        ENDON.
        PERFORM add_complete_line USING  ls_outtab-data
                                         ld_vkorg_key
                                CHANGING ld_last_key.
      ENDLOOP.
    * calculate totals
      CALL METHOD go_tree->update_calculations.
    * this method must be called to send the data to the frontend
      CALL METHOD go_tree->frontend_update.
    ENDFORM.                    " create_hierarchy
    *&      Form  add_customer_line
    *       add hierarchy-level 1 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_customer_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_data TYPE ty_s_outtab-data.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@A0@'.  " icon_customer.
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    * add node
      l_node_text =  us_data-kunnr.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_data
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_customer_line
    *&      Form  add_salesorg_line
    *       add hierarchy-level 1 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_salesorg_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_data TYPE ty_s_outtab-data.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@DS@'.  " ICON_PARTNER_SALES_ACTIVITY
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    * add node
      l_node_text =  us_data-vkorg.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_data
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_salesorg_line
    *&      Form  add_cmplete_line
    *       add hierarchy-level 3 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_complete_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
    **  ls_item_layout-editable = 'X'.
      APPEND ls_item_layout TO lt_item_layout.
    **  CLEAR ls_item_layout.
    **  ls_item_layout-fieldname = 'PLANETYPE'.
    **  ls_item_layout-alignment = cl_gui_column_tree=>align_right.
    **  APPEND ls_item_layout TO lt_item_layout.
      l_node_text =  us_data-vtweg.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = us_data
          i_node_text      = l_node_text
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_complete_line
    *&      Form  register_events
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM register_events.
    * define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    * define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_header_click.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
    **  APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_double_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
      APPEND l_event TO lt_events.
      CALL METHOD go_tree->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    * set Handler
      set handler:
        lcl_eventhandler=>handle_node_double_click for go_tree,
        lcl_eventhandler=>handle_item_double_click for go_tree.
    **  DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
    **  CREATE OBJECT l_event_receiver.
    **  SET HANDLER l_event_receiver->handle_node_ctmenu_request
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_node_ctmenu_selected
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_item_ctmenu_request
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_item_ctmenu_selected
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_checkbox_change FOR tree1.
    ENDFORM.                               " register_events
    Regards
      Uwe

  • Single click in alv grid

    Hi friends,
    below statement is for double clicking,
    WHEN '&IC1'. " SAP standard code for double-clicking, but i need single click because when i select field(not doubble click only single click) in alv grid it has to trigger and perform some action  ,can any one know please tell me.

    gwa_fldcat-col_pos       = 2.
      gwa_fldcat-fieldname     = 'CHK'.
      gwa_fldcat-tabname       = 'GT_FINAL'.
    gwa_fldcat-EMPHASIZE = 'C310'.
    gwa_fldcat-input        = 'X'.
      gwa_fldcat-edit          = 'X'.
      gwa_fldcat-checkbox      = 'X'.
      gwa_fldcat-just          = 'C'.
      gwa_fldcat-key           = 'X'.
      gwa_fldcat-outputlen     = 16.
      gwa_fldcat-seltext_l     = 'Selection'.
      gwa_fldcat-hotspot        = 'X'.
      APPEND gwa_fldcat TO git_fldcat.
      CLEAR gwa_fldcat.
      gs_events-name = 'USER_COMMAND'.
      gs_events-form = 'USER'.
      append gs_events to gi_events.
    call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
         i_callback_program                = sy-repid
         i_callback_pf_status_set          = 'PFSTATUS'
         i_callback_user_command           = 'USER'
         I_CALLBACK_TOP_OF_PAGE            = ' '
         I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
         I_CALLBACK_HTML_END_OF_LIST       = ' '
         I_STRUCTURE_NAME                  =
         I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      =
          I_GRID_SETTINGS                   = wa_grid
         is_layout                         = gs_layout
         it_fieldcat                       = git_fldcat
         IT_EXCLUDING                      =
         IT_SPECIAL_GROUPS                 =
         IT_SORT                           =
         IT_FILTER                         =
         IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = ' '
         IS_VARIANT                        =
         it_events                         = gi_events
         IT_EVENT_EXIT                     =
         IS_PRINT                          =
         IS_REPREP_ID                      =
         I_SCREEN_START_COLUMN             = 0
         I_SCREEN_START_LINE               = 0
         I_SCREEN_END_COLUMN               = 0
         I_SCREEN_END_LINE                 = 0
         IT_ALV_GRAPHICS                   =
         IT_HYPERLINK                      =
         IT_ADD_FIELDCAT                   =
         IT_EXCEPT_QINFO                   =
         I_HTML_HEIGHT_TOP                 =
         I_HTML_HEIGHT_END                 =
    IMPORTING
         E_EXIT_CAUSED_BY_CALLER           =
         ES_EXIT_CAUSED_BY_USER            =
    tables
         t_outtab                          = gt_final.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-zebra             = 'X'.
      gs_layout-info_fieldname    = 'COLOR'.
    gs_layout-KEY_HOTSPOT       = 'X'.
    form user using lv_okcode   like sy-ucomm
                           rs_selfield type slis_selfield.
      lv_okcode = sy-ucomm.
    case lv_okcode.
    when '&IC1'.
    loop at gt_final into gwa_final .
    where chk = 'X'.
      if gwa_final-chk is not initial.
    gwa_final-color = 'C111' .
    modify gt_final from gwa_final
       index sy-tabix transporting color.
    clear gwa_final.
    endif.
    endloop.
    encase.
    form Grid_settings .
    wa_grid-EDT_CLL_CB = 'X'.
    endform.

  • Double Click on ALV Report Output, Bringing to selections creen

    Hello Gurus,
    Please help me When i do double click on ALV Report  output , it is going back to Selection screen, actually its working as Back button. Now how to stop it.. I did debugging but i cannot trace it.

    PERFORM SUB_CREATE_FCAT.
    DATA W_REPID LIKE SY-REPID.
        W_REPID = SY-REPID.
    ls_layout-colwidth_optimize = 'X'.
    ls_layout-zebra = 'X'.
    PERFORM SUB_SORT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                 = SY-CPROG
          I_CALLBACK_PF_STATUS_SET          = 'STATUS'
           I_CALLBACK_USER_COMMAND           = 'C_USERCOMMAND '
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
           IS_LAYOUT                         = ls_layout
           IT_FIELDCAT                       = IT_FIELDCAT
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
           IT_SORT                           = IT_SORT
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
          I_SAVE                            = 'U'
    *     IS_VARIANT                        =
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     I_HTML_HEIGHT_TOP                 = 0
    *     I_HTML_HEIGHT_END                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
         TABLES
           t_outtab                          = T_FINAL
    *   EXCEPTIONS
    *     PROGRAM_ERROR                     = 1
    *     OTHERS                            = 2
       IF sy-subrc <> 0.
    * Implement suitable error handling here
       ENDIF.

  • Double click in alv list

    Hi all,
    Here is the code:
    my aim is to double click the alv list and display the correspoonding data .can any one tell me how to solve this.
    regards,
    Lisa
    Message was edited by: Lisa Roy

    Hi Lisa,
    **-ALV list Display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = SY-REPID
       <b>   I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'</b>
        <b>  I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'</b>
          IS_LAYOUT                = X_LAYOUT
          IT_FIELDCAT              = IT_FIELDCAT
          IT_EVENTS                = IT_EVENTS
        TABLES
          T_OUTTAB                 = IT_FINAL
        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.
    you need to pass these two forms
    FORM PF_STATUS_SET USING    P_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD' EXCLUDING P_EXTAB.
    ENDFORM.                    "PF_STATUS_SET
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE
                                                             SLIS_SELFIELD.
    case UCOMM.
    when '&IC1'.  "this is for double click.
    "do some thing..
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • Double Click in ALV Report in Web dynpro ABAP4

    Hi All,
    I am very much new to WDA4 , can anybody plz guide me how to enable double click in ALV Report in Web dynpro ..
    Plz help it is urgent .....
    Thnks
    Sahil

    Hi All,
    I am very much new to WDA4 , can anybody plz guide me how to enable double click in ALV Report in Web dynpro ..
    Plz help it is urgent .....
    Thnks
    Sahil

  • On Double Clicking An ALV

    Hi ALL,
    I have a doubt in ALV,
    My requirement is that, I developed one ALV report.
    Now when i double click one field i have to show some fields in a new report.
    How this can be done.
    Thanks & Regards,
    Pradeep Alex

    BC ALV report will help you using OOABAP.
    any method you want to use, what you need to do is pass a subroutine name to the  USER_COMMAND method. either directly in the  ALV FM export parameter or in the event table.
    in this subroutine which you have defined for USER_COMMAND, do what ever code you want. this will trigger when you double click the ALV output.

  • Help in double click in alv

    hi,
    i doing alv and it working o.k. and i wont to add the double click on field and move it to transction how can i do that?
    I reward
    thankes
    "this is my declartion alv
    FORM f_display_data.
      DATA:
        ls_layout   TYPE slis_layout_alv,
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
      m_fieldcat 'OBJECT' 'ITAB' 'X' 'Object'.
      m_fieldcat 'OBJECT_NAME' 'ITAB' 'X'  'Oject Name'.
    * Fill Layout - Name of the field with color
      ls_layout-info_fieldname = 'LINE_COLOR'.
      ls_layout-colwidth_optimize = 'X'.
    * Display the list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout    = ls_layout
          it_fieldcat  = lt_fieldcat
          i_grid_title = 'User Exit & Badi'
        TABLES
          t_outtab     = itab.
      CASE wf_object.   "this lines is what i wont to add for double click
        WHEN 'SMOD'.
          SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
          CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
        WHEN 'SXSD'.
          SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).
          CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
      ENDCASE.
    Regards

    Hi
    Here is an example program which illistrates how to handle the double click event.
    REPORT ZRICH_0001.
    TABLES: MARA.
    DATA: BEGIN OF I_ALV OCCURS 0,
          MATNR TYPE MARA-MATNR,
          MAKTX TYPE MAKT-MAKTX,
          END OF I_ALV.
          CLASS cl_event_receiver DEFINITION      Handles Double Click
    CLASS CL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
        METHODS HANDLE_DOUBLE_CLICK
          FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
          IMPORTING E_ROW E_COLUMN.
      PRIVATE SECTION.
    ENDCLASS.
          CLASS CL_EVENT_RECEIVER IMPLEMENTATION    Handles Double Click
    CLASS CL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_DOUBLE_CLICK.
        PERFORM DRILL_DOWN USING E_ROW-INDEX.
      ENDMETHOD.
    ENDCLASS.
    DATA: ALV_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: EVENT_RECEIVER TYPE REF TO CL_EVENT_RECEIVER.
    DATA: ALV_GRID       TYPE REF TO CL_GUI_ALV_GRID.
    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'.
    Create Controls
      CREATE OBJECT ALV_CONTAINER
             EXPORTING
                   CONTAINER_NAME    = 'ALV_CONTAINER'.
      CREATE OBJECT ALV_GRID
             EXPORTING
                   I_PARENT          =  ALV_CONTAINER.
    Create Event Receiver
      CREATE OBJECT EVENT_RECEIVER.
    ALV Specific. Data selection.
    Populate Field Catalog
      PERFORM GET_FIELDCATALOG.
      CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          CHANGING
               IT_OUTTAB       = I_ALV[]
               IT_FIELDCATALOG = FIELDCAT[].
      handler for ALV grid
      SET HANDLER EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR ALV_GRID.
    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.
    DRILL_DOWN
    FORM DRILL_DOWN USING INDEX.
      READ TABLE I_ALV INDEX INDEX.
      IF SY-SUBRC = 0.
    Do whatever you need to do, in this case, I'm driling into tcode MM03
        SET PARAMETER ID 'MAT' FIELD I_ALV-MATNR.
        CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDFORM.
    <b>Reward if useful</b>

  • Problem in double click in ALV

    In the ALV GRID , I have used the following code to go to VA02 and VA22 .
    WHEN c_ic1.
        Retrieve the vbeln value of the record selected and use it to open tcode VA02.
          CLEAR wa_outtab.
          READ TABLE i_outtab INTO wa_outtab with key p_rs_selfield-fieldname.
          SET PARAMETER ID c_pid FIELD wa_outtab-vbeln.
          if wa_outtab-auart eq  C_ZQT .
          CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.
          ELSEIF wa_outtab-auart eq  C_ZQR .
          CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.
          ELSE.
          CALL TRANSACTION c_tcode1 AND SKIP FIRST SCREEN.
          ENDIF .
          IF sy-subrc <> 0.
            no requirement to display error message in case error
            in opening tcode va02.
          ENDIF.
    Now My problem is that when the user clicks on a particular sales order in ALV GRID , that particular sales order should be displayed in VA02 .I,e instead of user entering the value of sales order manualy in VA02 . It has to automatically take from the ALV GRID tht particular sales order whic he has double clicked in the ALV .
    Please tell me how to achieve this functionality ..
    Regards
    pavan

    refer this code.....
    pass USER_COMMAND IN ALV AND THEN
    ADD THE CODE LIKE THIS..
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    *break mtabap.
      data : lv_vbeln TYPE vbeln_va.
      CASE r_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname = 'VBELN' .
           Read table  IT_FINAL into  wa_FINAL index rs_selfield-tabindex.
            if sy-subrc = 0.
              lv_vbeln = wa_FINAL-vbeln.
              SET PARAMETER ID 'AUN' FIELD lv_vbeln.
              CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN .
           clear lv_vbeln.
            endif.
          ENDIF.
          clear wa_final.
            ENDCASE.
    ENDFORM. "user_command

  • Double click in ALV tree display....

    Hi all,
    I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issue of double clicking.
    My code as of now is as below:
    Please tell how to handle events in this report tree display and how and where to write the code for this functionlity of double click.
    FORM alv_tree.
    PERFORM build_sort_table.  “----
    table is sorted
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      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 tree1
        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      = ''
            i_no_toolbar          = ''
        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 info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader.
      PERFORM build_comment USING
                     lt_list_commentary. “----
    already created
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    register events
      PERFORM register_events.
    create hierarchy
      CALL METHOD tree1->set_table_for_first_display
              EXPORTING
                   it_list_commentary   = lt_list_commentary
                   i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = ls_variant
              CHANGING
                   it_sort              = gt_sort[]
                   it_outtab            = itab_outtab
                   it_fieldcatalog      = t_fieldcat. "gt_fieldcatalog.
    expand first level
      CALL METHOD tree1->expand_tree
             EXPORTING
                 i_level = 1.
    optimize column-width
      CALL METHOD tree1->column_optimize
               EXPORTING
                   i_start_column = tree1->c_hierarchy_column_name
                   i_end_column   = tree1->c_hierarchy_column_name.
    ENDFORM.                    " alv_tree
    FORM register_events.
    define the events which will be passed to the backend
      data: lt_events type cntl_simple_events,
            l_event type cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      append l_event to lt_events.
      call method tree1->set_registered_events
        exporting
          events = lt_events
        exceptions
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    ENDFORM.                    " register_events

    hi
    (also check u have refresh the field)
    Check the demo program,In this double click the data fields it will display some field in screen,You can check it
    BCALV_GRID_DND_TREE
    Thanks
    Edited by: dharma raj on Jun 17, 2009 7:41 PM

Maybe you are looking for

  • SAP Multi Resource Scheduling

    Hi All, We have implemented SAP MRS for our PS system. We started converting old networks into MRS. So we activated the process variant at header level and and set the 'STPL'  status for  some activities. Its fine till here. When we pulled some netwo

  • Not much information from jwsc

    I am using jwsc to build my weblogic 10 artifacts. jwsc also compiles the files. It is giving me an error: UILD FAILED C:\bea10\user_projects\Sept23workspace\BVoIPServicesWeb\build.xml:91: weblogic.wsee.tools.jws.build.CompileException: Error compili

  • EPIC_APP Error on Startup

    I used the Adobe 8 Customization Wizard to create a transform for our college so that I can get a silent install with the Serial No. pre populated. I used the files I received via the FTP site for the Opt-out option. The install is pushed via Zenwork

  • SQL*Plus Not Responding

    I have a query in 8i that sums the pages entered into a database by month as follows: SELECT DISTINCT c.study , DECODE(r.pass_one_by, NULL, SUBSTR(s.entered_by, 5), SUBSTR(r.pass_one_by, 5)) p1_by ,SUM(DECODE(TO_CHAR(TRUNC(r.pass_one_ts),'MON'),'JAN'

  • I wanna know how binding to LDAP V3

    If it is binding to LDAP V3, in case of storing Korean Language, doesn't is really have to need to conver to UTF-8 type? If so, is is binding sample code to LDAP V2, I wanna know how binding to LDAP V3 LDAP V2 Sample Code if ( ldap_simple_bind_s( ld,