I want to read the customizing path of an IMG-Activity in SAP via Code (abap). I have the IMG-Activity from e071K, which stores objects within a transport job. Now I found the table TNODEIMG where the tree structure of SPRO is stored. This is perfect, because it holds what I need. But I can't find the connection to my IMG-Activity. The Unique-Id in TNODEIMG is in other format and seems to be a different Id. Someone got an idea how I can read this out?
UPDATE:
@vwegert: Thank you for you helpful answer. So far I get this list filled with Node-Id's: lt_eref_list
, but don't get the parents. Do you see some missunderstood or failure here?
DATA: lt_iref_list TYPE STANDARD TABLE OF hier_ref,
lt_eref_list TYPE STANDARD TABLE OF hier_ref,
ls_ref TYPE hier_ref,
lt_parent_list TYPE STANDARD TABLE OF hier_iface,
lt_check_list TYPE STANDARD TABLE OF hier_iface.
ls_ref-node_id = 'SIMG_CFMENUOLQSOQ46'.
APPEND ls_ref TO lt_iref_list.
CALL FUNCTION 'STREE_GET_NODES_FOR_GIVEN_REF'
TABLES
i_list_of_references = lt_iref_list
e_list_of_references = lt_eref_list.
LOOP AT lt_eref_list ASSIGNING FIELD-SYMBOL(<ls_ref>).
CALL FUNCTION 'STREE_GET_PARENTS_OF_NODE'
EXPORTING
structure_id = <ls_ref>-node_id
* IMPORTING
* message = ls_message
TABLES
check_nodes = lt_check_list
parent_nodes = lt_parent_list.
ENDLOOP.
Thank you in advance.
IMG activities are maintained using the rather unwieldy transaction S_CUS_IMG_ACTIVITY
. That transaction supplies a where-used function:
Tracing that function leads through the function modules S_CUS_IMG_ACTIVITY_XREF
and S_CUS_IMG_ENTRY_VIA_ACTIVITY
to a function module named STREE_GET_NODES_FOR_GIVEN_REF
that identifies the nodes (for the preparation, check its caller). Reading these function modules gives you a lot of information about the structures and function modules to be used.
For your purposes, STREE_GET_NODES_FOR_GIVEN_REF
might be interesting. In the list of references, specify the activity ID as NODE_ID
with type COBJ
. This will give you a list of nodes including their parent IDs that you can then feed to STREE_GET_PARENTS_OF_NODE
(the structure ID is the tree ID from the result set). To get the node text, you would use STREE_NODE_READ
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With