Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem : Getting selected node data in ALV Tree display

Former Member
0 Likes
1,457

Hi experts,

I have used ALV report tree for a program. Now i want to perform some action for any node / any column of node selected .

May i know which system field i should use for getting current record selected.

Thanks,

Akash

8 REPLIES 8
Read only

Sm1tje
Active Contributor
0 Likes
1,092

there is no system field for this, but there are methods within the alv tree class which should help you. I don't have a system at hand right now, so I can't give you the exact name of the method.

Read only

Former Member
0 Likes
1,092

Hi Experts,

Can anybody help me in finding the method of class CL_GUI_ALV_TREE by which i can capture selected node data ?

Thanks,

Akash

Read only

Former Member
0 Likes
1,092

You can use the method

GET_SELECTED_NODES

Read only

Former Member
0 Likes
1,092

If you want for item then use

GET_SELECTED_ITEM

for Node use

GET_SELECTED_NODES

Read only

Former Member
0 Likes
1,092

I used this in the DOUBLE_CLICK Method


  METHOD  handle_item_double_click.
    " this method handles the item double click event of the tree
    " control instance

    " show the key of the node and the name of the item
    " of the double clicked item in a dynpro field
    g_event = 'ITEM_DOUBLE_CLICK'.
    g_node_key = node_key.
    g_item_name = item_name.
    READ TABLE item_table INTO item
      WITH KEY node_key   = g_node_key
               item_name  = 'Column3'.
    IF sy-subrc = 0.
      g_item_text = item-text.
      IF NOT g_item_text IS INITIAL.
data: tcode     type TSTC-TCODE.
        tcode = g_item_text.
        CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
             EXPORTING
                  tcode  = tcode
             EXCEPTIONS
                  ok     = 1
                  not_ok = 2
                  OTHERS = 3.
        IF sy-subrc <> 1.
          MESSAGE E208(00)
            WITH 'You are not authorized to use this transaction'.
        ELSE.

          CALL TRANSACTION g_item_text.
        ENDIF.
      ENDIF.
    ENDIF.
    CLEAR g_header_name.
  ENDMETHOD.

Read only

Former Member
0 Likes
1,092

Hi Yash,

I have tried with get_selected_nodes but it returns some numeric value however i want to capture data of selected record. Please suggest

Thanks,

Akash

Read only

Former Member
0 Likes
1,092

Hi all,

Can anybody suggest which method of class CL_GUI_ALV_TREE i can use to capture data of selected record of ALV report Tree ?

If get_selected_item method can be used then please let me know how to use that method and which parameters are essential.

Thanks,

Akash

Read only

Former Member
0 Likes
1,092

Any one know how to deal with this?