Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Hierarchy Logic Issue

$
0
0

Hi There,

 

 

 

I am stuck with a scenario where I need to find the count of direct and indirect reportees to a supervisor.

 

 

Here is the scenario

 

Source table :

 

EMP       SUPERVISOR

 

Dev         Divya

Yukta     Dev

Vidya     Jason

Ramya   Vidya

Anu       Vidya

 

 

I need to find the count of the direct and indirect reportees as below :

 

 

Emp     No of reportees (Direct + Indirect)

 

 

Vidya      4 ( 3 direct one indirect )

Jason      5 ( 1 Direct 4 indirect )

Devi        1

 

 

and so on.

 

 

Please help me out with the logic for this.

I am trying to write a recursive loop but it isn't helping.

Let me know if any FM is there for the same.

 

Thanks,

Satyavrit


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>