You get this using flattened out hierarchy ...
Create a function module based generic extractor which extracts the hierarchy nodes data as a flat structure and add the node1, node2 node3 n so on... as attributes in the 0costelement IO. make them as navigational so that you can use that costlement group (node3) directly in the report.
Regards
KP