2007 Aug 14 11:02 AM
Hi SDN,
I am downloading the Assets data from two tables ANLA,ANLZ.
there is a common field ANL1in both tables and i have to retrive the data by using anl1 into the internal table.
can you please send me the SELECT Syntax for this probl.....
Thank you & Regards,
Manoj
2007 Aug 14 11:07 AM
hI
FIRST RETRIVE THE DATA FROM ANLA TABLE.
select fields from anla into tabl1 itab1.
now
if itab1[] is not initial.
select fields from anlz into table itab2 for all entries in itab1 where anl1 eq itab1-anl1.
endselect.
reward points to all helpful answers
kiran.M
2007 Aug 14 11:07 AM
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.
regards,
Omkar.
2007 Aug 14 11:12 AM
Hi manoj,
Please see the following sample code. But kindly don't use join as it may hamper ur performance. No trouble in using two select query.
data: begin of itab occurs 0,
BUKRS like anla-BUKRS,
ANLN1 like anla-ANLN1,
BDATU like anlz-BDATU,
end of itab.
select anlabukrs anlaANLN1 anlzBDATU into corresponding fields of table itab from anla inner join anlz on anlaanl1 eq anlz~anl1 where (logexp).
Please come back for any clarification.
Thanks and Regards,
saurabh
2007 Aug 14 11:12 AM
Hi Manoj,
Select data from ANLA and place the data in first internal table
Select data from ANLZ and place the data in other internal table.
Loop through the 2nd internal table
Read the first internal table and
place these data in third internal table
Endloop
Regards
Arun
2007 Aug 15 1:01 PM