Application Development and Automation 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: 
Read only

self join

Former Member
4,185

hi abapers ,

how can i use self join in abap.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
1,901

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
Read only

Former Member
0 Likes
1,901

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

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,901

HI,

Do we really need something like SELF join in abap.

Rgds,

Sandeep

Read only

1,901

Yes, we need self join in SAP.

Read only

Former Member
1,902

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