2007 Aug 29 7:15 PM
Hi,
I need to change the following Join to a number of selects, since the Join isn't working as it should. Also, is "for all entries" obsolete or is it still relevant?
Here is the last part of the join, since I cannot list all of the fields:
-
INTO TABLE itab_data
from viqmelst as b
inner join viqmfe as c on bqmnum = cqmnum
inner join viqmaml as a on bqmnum = aqmnum and
cfenum = afenum
inner join viqmur as d on bqmnum = dqmnum and
cfenum = dfenum
inner join viqmsm as e on bqmnum = eqmnum and
cfenum = efenum
inner join TJ02T as f on bstat = fistat
WHERE a~qmnum in s_qmnum and
a~qmdat in s_qmdat and
a~qmart in s_QMART and
a~matnr in s_matnr and
b~stat in s_stat and
b~charg in s_charg and
f~spras = 'EN'.
sort itab_data by qmnum fenum.
delete adjacent duplicates from itab_data.
Thanks,
John
2007 Aug 29 7:19 PM
FOR ALL ENTRIES is not obsolete, just generally a little less efficient than a JOIN. It does have it's own issues that you have to be aware of though.
Rob
2007 Aug 29 7:37 PM
2007 Aug 29 7:46 PM
Hi John,
The FOR ALL ENTIRES option is used to avoid the adverse impact on performence that the JOINS make..
Code like this:
SELECT xx yy zz...
INTO itab1
FROM tab1
WHERE.. Condtions of select options.
IF sy-subrc EQ 0
AND itab1[] IS NOT INITIAL.
SELECT aa bb cc
INTO itab2
FROM tab2
FOR ALL ENTRIES IN tab1
WHERE join codition with tab1
AND select conditions on fields of tab2 if any.
and so on for all other tables..
Thanks and Best Regards,
Vikas Bittera.
**Points for useful answers**