02-26-2007 11:26 AM
i am having a select query.
Select vvbeln vspart vtext
into corresponding fields of table it_tspat
from VBAP as v INNER JOIN TSPAT as t
ON vspart = tspart
for all entries in it_zp1012_so_app_h
where spras = 'EN'
and vbeln = it_zp1012_so_app_h-vbeln+0(10).
now i have to retrieve BZIRK from table VBKD in the same select query above
and want to display vbeln,spart,vtext,bzirk in the output
02-26-2007 11:35 AM
hi santosh i sending query for inner join for three ale...u ll get all ur answers..
select bean11 amatnr cmaktx amenge ameins admbtr into
corresponding fields of table itab_main1 from ( ( makt as c inner join
mseg as a on cmatnr = amatnr ) inner join mara as b on a~matnr =
b~matnr ) where mblnr = pa.
02-26-2007 11:40 AM
Select v~vbeln v~spart a~bzirk
into corresponding fields of table i_vbkd
from VBAP as v INNER JOIN VBKD as a
ON v~vbeln = a~vbeln
AND v~posnr = a~posnr
for all entries in it_zp1012_so_app_h
where v~vbeln = it_zp1012_so_app_h-vbeln+0(10).
if sy-subrc = 0.
select vtext from tspat
into i_tspat
for all entries in i_vbkd
where spart = i_vbkd-spart
AND SPAS = 'EN'.
ENDIF.
LOOP AT i_vbkd.
READ TABLE i_tspat WITH KEY spart = i_vbkd=spart.
if sy-subrc = 0.
i_vbkd-vtext = i_tspat-vtext.
endif.
CLEAR i_vbkd.
ENDLOOP.
Hope this will oslve ir problem.
Reward if this helsp.
02-26-2007 11:41 AM
Hi,
Join VBKD also with VBAP:
Select vvbeln vspart vtext cbzirk
into corresponding fields of table it_tspat
from ( VBAP as v INNER JOIN TSPAT as t
ON vspart = tspart ) join VBKD as c
on vvbeln = cvbeln
for all entries in it_zp1012_so_app_h
where spras = 'EN'
and vbeln = it_zp1012_so_app_h-vbeln+0(10).
Regards,
Anji