Hi,
I need to write a procedure to get the hierarchy of a resource in SAP CRM source system using SAP HANA SQL Code.
Below is the logic to get the hierarchy but i'm not sure how to loop the respective.
Can anyone kindly help to achieve the below logic.
1. Select all the Resource from tables by joining PLOGI and HRP1000 tables.
2. Fetch Relationships between Org. Units by joining T77AW and T777E tables.
3. Loop step1 result i.e for each resource for a specific evaluation path (Bottom to Up or Top to Bottom).
4. Loop step2 for Relation between Org. Units.
5. Select hierarchy Object ID's against each Resource from step1 and relation from step2 from HRP1001.
6. Repeat step4 & step5 until there is no hierarchy object ID against the Previous Object ID from HRP1001.
In the above logic i need loop twice and also select on HRP1001 will be multiple times.
I get the above logic from the standard report RHXSTR02.
Kindly guide me how to implement this Nested Recursive Loop with Select on same table multiple times.
Regards,
Ramana.