Skip to Content
0
Former Member
Sep 23, 2010 at 06:01 AM

Query to Find Root ID in ABAP

93 Views

Suppose we have a database table with values as following :

ItemID -


ParentID

A1 -


Null

A2 -


A1

A3 -


A1

A4 -


A3

A5 -


A3

Now I want to find the Root ParentID of A5 , that would be A1 in this case as the corresponding ParentID of A1 is NULL.

How should I get the desired result ?

Thank You

Saurabh

Edited by: Saurabh Kapoor on Sep 23, 2010 8:02 AM