Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

self join

Former Member
2,935

hi abapers ,

how can i use self join in abap.

thanks

1 ACCEPTED SOLUTION

Former Member
651

Hi,

This is just an hypothetical example of self join in abap.

select x~empid as xempid  "Employee ID
         x~empname as xempname "Employee Name
         y~empid as yempid   "Supervisor ID
         y~empname as yempname " Supervisor Name
into corresponding fields of itab
from zemployee as x
  inner join zemployee as y on x~supid = y~empid

Regards,

Vishal

4 REPLIES 4

Former Member
0 Kudos
651

Hi,

i think self join is not available in SAP...but you can make the view table from single database table in DDIC..Other wise do it using internal table....from one database table....fill up two internal tables..and making loop...store it another internal table....

Arunima

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos
651

HI,

Do we really need something like SELF join in abap.

Rgds,

Sandeep

651

Yes, we need self join in SAP.

Former Member
652

Hi,

This is just an hypothetical example of self join in abap.

select x~empid as xempid  "Employee ID
         x~empname as xempname "Employee Name
         y~empid as yempid   "Supervisor ID
         y~empname as yempname " Supervisor Name
into corresponding fields of itab
from zemployee as x
  inner join zemployee as y on x~supid = y~empid

Regards,

Vishal