10-10-2007 11:25 PM
Hi,
See the sql below... I would like to make the comparison
t1pallet_id = t2pallet_id+2(18) but it is not possible. Any help?
SELECT *
INTO CORRESPONDING FIELDS OF TABLE i_tab2
FROM t1
INNER JOIN t2
ON t1pallet_id = t2pallet_id
FOR ALL entries IN i_tab
WHERE t2~vbeln = i_tab-vbeln.
10-10-2007 11:41 PM
You cannot use offsets or substrings in a select.
You may have to load the data in an internal table and then loop at the table to do the comparison, where offset and substrings would be allowed.
If you do, just make sure that itab2 can accomodate both pallet_id fields. You may have to do explicit mapping of fields into i_tab2 in such a case, since one of the pallet fields will have to have a different name, so CORRESPONDING FIELDS won't work.
Good luck
Brian
10-11-2007 4:26 AM
Please avoid inner join
First select data from one table and then use that for other in For ALL Entries
SELECT *
FROM T1
WHERE .........conditions
Temerory table TEMP with field TMP_ID
LOOP AT T1
TEMP-TMP_ID = T1+2(18)
APPEND TEMP.
ENDLOOP
SELECT *
FROM T2
FOR ALL ENTERIS IN TEMP
WHERE ID = TEMP-TEP_ID
Rewards if useful.......................
Minal
10-11-2007 4:55 PM