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: 

Join between two tables with the same column name

former_member355261
Participant
0 Kudos
1,150

Hi,

I want to use the JOIN statement to select the fields VBAP-NETWR and VBAK-NETWR from tables VBAP and VBAK.

I can achieve this by using AS and (VBAP~NETWR and VBAK~NETWR) but the problem is in the table that is going to hold the results.

in: INTO CORRESPONDING FIELDS OF TABLE itab

itab can't have the field NETWR more than once !

So, how can I solve this ?

Thanks in advace.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
275

You may simply name them differently in the itab.

EDIT: for instance name them netwr1 and netwr2, and in the SELECT do: select VBAP~NETWR as netwr1, VBAK~NETWR as netwr2 ...

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
276

You may simply name them differently in the itab.

EDIT: for instance name them netwr1 and netwr2, and in the SELECT do: select VBAP~NETWR as netwr1, VBAK~NETWR as netwr2 ...