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: 

Data from multiple tables to one table

Former Member
0 Kudos

HI Friends,

I have 4 internal tables,

it_vbak - data from VBAK

it_vbap - data from VBAP

it_vbpa _ data from VBPA

the data i got into the above tables is using vbeln as my select options.

I need to move all the data from the above internal table to one internal table it_vbak_vbap_vbpa.

with a unique key,

in the above case the unique key i am using is VBELN.

Any help on this will be appericiated.

Bye,

Shejal.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use a join and select directly into one internal table if possible.

Else you will have to loop at each table individually using a nested loop and move the data to the common internal table.

Cheers

VJ

4 REPLIES 4

Former Member
0 Kudos

Hi,

Use a join and select directly into one internal table if possible.

Else you will have to loop at each table individually using a nested loop and move the data to the common internal table.

Cheers

VJ

0 Kudos

Hi Rao,

Do u mean do an inner join. If so how should i apporach for it. first do an inner join only for 2 tables in a 3rd table and then perform another inner join between the 3rd table and the other table.

let me know,

bye,

Shejal.

0 Kudos

Hi ,

You can do a inner join on 3 tables directly using the relvant key fields if available.

Generally inner joins is preferred on 2 tables but if you have all the key fields then you can do an inner join on 3 tables or even more.

SOme times its good to use inner joins and some times its not good to use a inner join. It all depends on from which table you are selecting data , how many tables are involved and how many key fields are available.

In ur case guess u can use a inner join on all 3 tables as the sales tables are not so huge compared to finance tables.

Cheers

VJ

0 Kudos

Thanks Rao,

I think it solves my problem.

Thanks Again,

Shejal.