I do not know if you are still confronted with this problem,
The issue you have is to extract bottom up, i.e. you are trying to get the SETNODES & SETHEADER for a cost element / account. But SAP allows you to have several groups which contain the same elements (accounts) in parallel, i.e. your account "730000 Transporte durch Dritte" can be part of different parents. Anyhow, the TOP-Parent MUST be different.
The solution is, to select the proper TOP Parent for your B/S and then loop through the SETLEAF where all nodes which do not belong to the top parent are excluded.
1. Load SETHEADER.SETNAME into temp. Table
2. Join SETNODE.SUBSETNAME
3. Load SETLEAF.SETNAME and account assignments
4. JOIN Temps from above.
Now you can use Hierarchy() or Mappings for your B/S.
If you have any questions, please feel free.