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

joining tables

Former Member
0 Likes
554

Can i join t178t with kna1 on kondm ?

4 REPLIES 4
Read only

Former Member
0 Likes
521

How to join VBAP with t178t ?

Read only

0 Likes
521

kondm is common to vbap and t178t so you can use join like this,

select afield1 afield2 afield3 bfield1 bfield2 bfield3 into corresponding fields of table itab from (vbap as a inner join t178t as b on akondm = bkondm).

try like this yar it will work fine.

Read only

Former Member
0 Likes
521

There is no KONDM in KNA1.

Please check it again.

Read only

Former Member
0 Likes
521

Hi,

Could you tell for which field you want to match.

Because in KNA1 we cant match any field to KONDM of T178T table.

if you want you can find mappping thru other tables like VBAP,VBRP using sold-to party or ship-to party.

In VBAK we have KUNNR field (customer number)

In Corresponding to vbeln from VBAK we have to goto VBAP for KONDM.

I think you have to match KONDM to customer.

Sample Code:::::::::::::::::::::::

tables:KNA1.

select-options:s_kunnr for kna1-kunnr.

data:begin of itab occurs 0,

kondm like vbap-kondm,

kunnr like vbak-kunnr,

end of itab.

start-of-selection.

select AKondm BKunnr into table itab

from VBAP as A inner join VBAK as B

on VBAP-vbeln = VBAK-vbeln

where B~Kunnr in S_Kunnr.

loop at itab.

write:itab-kondm.

endloop.

Please reward if useful.

Thanks

Sivaparvathi