‎2007 Feb 21 12:59 PM
Hi all
i have 6 tables from where i need to fetch data.
ekorg from ekko, mtart and meins from mara, like wise 2 fields from mbew, 2 fields from s012, 4 fields from ekpo, one field from ausp.
how can i write a select statement in this case?
can anyone pls help me?
thanks in advance
‎2007 Feb 21 1:02 PM
Hi,
Join the EKKO,EKPO, MARA and MBEW tables and get the data into a single Int Table.
And for all entries of this table fetch the char.values from table AUSP.
Put the complete data into a single int table and display.
Regards,
Anji
‎2007 Feb 21 1:37 PM
Hi,
U can join ekko and ekpo
Select a~ekorg b~field1 b~field2 b~field3 b~field4
FROM EKKO as a inner join
EKPO as b
ON a~ebeln = b~ebeln
INTO TABLE i_ekk
WHERE a~ebeln IN s_xx (if any selection para).
Select a~mtart a~meins b~filed1 b~field2
FROM mara as a inner join
mbew as b
ON a~matnr = b~matnr
INTO TABLE i_mar
WHERE a~matnr IN s_XXX.
if sy-subrc = 0.
Select f1 f2 FROM so12
INTO TABLE i_so12
FOR ALL ENTRIES IN i_mar
WHERE matnr = i_mar-matnr.
endif.
select f1 from ausp into table i_ausp
Where .....
‎2007 Feb 21 2:49 PM
‎2007 Feb 21 3:04 PM
Hi,
Close the thread if ur problem got solved. Revert back if u have any clarification.