Here is another approach for finding a table based IMG path.
At e071k , we have technical identifiers for IMG actions. You can also include them in SPRO through additional information โ Additional information โ Soft key โ IMG activity, so they will be displayed as follows:

But in the TNODEIMG table, we have GUIDs that do not match the technical ones. The link table you can use to link them, TNODEIMGR , contains both the GUID and the technology identifier of each node. By joining the parent node, node ID, and node texts from the TNODEIMGR , TNODEIMG and TNODEIMGT , we can create a full IMG path for each node:
REPORT z_img. DATA: lv_final_path TYPE string, exit_root TYPE abap_bool, out TYPE string. * picking random activity from requests SELECT SINGLE * FROM e071k INTO @DATA(lv_e071k). * finding correspondent GUID ID for tech ID SELECT gr~node_id, ach~text, img~parent_id FROM tnodeimgr AS gr JOIN cus_imgact AS ach ON ach~activity = gr~ref_object JOIN tnodeimg AS img ON img~node_id = gr~node_id AND spras = @sy-langu INTO TABLE @DATA(lt_node) WHERE ref_object = @lv_e071k-activity. LOOP AT lt_node ASSIGNING FIELD-SYMBOL(<fs_tnode>). CLEAR: lv_final_path. * writing bottom node text lv_final_path = lv_final_path && <fs_tnode>-text. DATA(lv_node_id) = <fs_tnode>-parent_id. DO 15 TIMES. * fetching parent node text SELECT SINGLE g~parent_id, text INTO @DATA(lv_node) FROM tnodeimg AS g LEFT JOIN tnodeimgt AS t ON t~tree_id = g~tree_id AND t~extension = g~extension AND t~node_id = g~node_id AND t~ext_key = g~ext_key AND t~spras = @sy-langu WHERE g~node_id = @lv_node_id. * checking if parent exists IF sy-subrc <> 0. exit_root = abap_true. EXIT. ELSE. exit_root = abap_false. ENDIF. lv_final_path = |{ lv_final_path } \n { repeat( val = |\t| occ = sy-index + 1 ) } --> { lv_node-text }|. lv_node_id = lv_node-parent_id. IF lv_node-parent_id IS INITIAL. EXIT. ENDIF. ENDDO. CHECK exit_root = abap_false. * building the path lv_final_path = | IMG path no. { sy-tabix } is \n\n { lv_final_path } \n\n |. out = out && lv_final_path. ENDLOOP. cl_demo_output=>display( out ).
However, the root IMG node itself is not available with this approach.
source share