Hi,
I know functions that get the structure to the deepest level but on the opposite way not ... and it would interesting to learn.
I might suggest that you work with a loop in order to get the top-level in the structure:
DO WHILE SUBRC = 0.
Call function CS_WHERE_USED_MAT
exporting
MATNR = MYMATNR
importing
exceptions.
if sy-subrc = 0.
read table MATCAT where ....
move MATCAT-MATNR to MYMATNR.
else.
subrc = 4.
endif.
ENDDO.
Add a comment