‎2008 Nov 14 5:46 AM
Hi,
I have two internal tables one is contains matnr and another contains objnr.
i want to select the data from another database table which contains same matnr,objnr in internaltables.
How to write select statement.
Regards,
Suresh.
‎2008 Nov 14 6:08 AM
Hi
If there some relation B/W matnr and objnr then put these two in one intenal table and then write SELECT with these two in where condition .
Otherwise read table based on material (also select objnr ) then filter entries comparing OBJNR form earlier Intrenal Table.
Regards
Sachin Sharma
‎2008 Nov 14 5:51 AM
hi,
at first merge the two internal tables into it_merge in which matnr & objnr both fields are present...
now
select .......
<fieldname>
from <dbtab>
into corresponding fields of table it_final
for all entries in it_merge
where matnr eq it_merge-matnr
and objnr eq it_merge-objnr.
Arunima
‎2008 Nov 14 6:08 AM
Hi
If there some relation B/W matnr and objnr then put these two in one intenal table and then write SELECT with these two in where condition .
Otherwise read table based on material (also select objnr ) then filter entries comparing OBJNR form earlier Intrenal Table.
Regards
Sachin Sharma
‎2008 Nov 14 6:26 AM
Hi Suresh,
Retrieve the data for first internal table. After that use the for all entries command to fetch the data for second internal table.
Eg:
DATA: tab_spfli TYPE TABLE OF spfli,
tab_sflight TYPE SORTED TABLE OF sflight
WITH UNIQUE KEY table_line,
wa LIKE LINE OF tab_sflight.
SELECT carrid connid
INTO CORRESPONDING FIELDS OF TABLE tab_spfli
FROM spfli
WHERE cityfrom = 'NEW YORK'.
SELECT carrid connid fldate
INTO CORRESPONDING FIELDS OF TABLE tab_sflight
FROM sflight
FOR ALL ENTRIES IN tab_spfli
WHERE carrid = tab_spfli-carrid AND
connid = tab_spfli-connid.
LOOP AT tab_sflight INTO wa.
WRITE: / wa-carrid, wa-connid.
ENDLOOP.
Regards,
Santosh
‎2008 Nov 14 6:42 AM
Hi,
Please see the link below for mapping tables
http://www.sap-img.com/general/sap-r3-tables.htm
Regards
Raheed