2007 Mar 21 11:06 AM
Hi,
first I fill an internal table with matnr, sales org. Component RT_VTWEG of this itab is a range table of DDIC table TYPE range_vtweg_tab . This range table is filled with one or more distribution channels.
Then I have a select from the condition table with FOR ALL ENTRIES IN itab
WHERE matnr = itab-matnr
AND vkorg = itab-matnr
AND vtweg in itab-RT_VTWEG.
I get syntax error
The IN operator with "PT_ALV-RT_VTWEG" is followed neither by an
internal table nor by a value list.
I do not understand this because according to documentation it shoul be possible.
Regards,
Clemens
Hi,
first I fill an internal table with matnr, sales org. Component RT_VTWEG of this itab is a range table of DDIC table TYPE range_vtweg_tab . This range table is filled with one or more distribution channels.
Then I have a select from the condition table with FOR ALL ENTRIES IN itab
WHERE matnr = itab-matnr
AND vkorg = itab-matnr
AND vtweg in itab-RT_VTWEG.
I get syntax error
The IN operator with "PT_ALV-RT_VTWEG" is followed neither by an
internal table nor by a value list.
I do not understand this because according to documentation it shoul be possible.
Regards,
Clemens
2007 Mar 21 11:14 AM
Hi,
The data in the range RT_VTWEG is different from ITAB.
Don't take the RT_VTWEG as a field in internal table. Just take VTWEG field in the internal table and fill the all fields of that internal table.
then
write the select using for all entries
select from the condition table with FOR ALL ENTRIES IN itab
WHERE matnr = itab-matnr
AND vkorg = itab-matnr
AND vtweg in itab-VTWEG. or
WHERE matnr = itab-matnr
AND vkorg = itab-matnr
AND vtweg in RT_VTWEG.
it works fine.
regards,
anji
2007 Mar 21 11:15 AM
I believe u cant use IN operator in FOR ALL ENTRIES where condition.
2007 Mar 21 11:25 AM
Hi Clemens,
Alexander was right. You cannot use any operator other than,
=, EQ,
<>, NE
<, LT
>, GT
<=, LE
>=, GE
when used in conjunction with for all entries statement.
Regards,
Ravi
2007 Mar 21 3:13 PM
Hi friends,
thank you. Now I know what I experienced.
I expected a link to the documentation here.
<a href="http://help.sap.com/saphelp_erp2005/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/content.htm">Selecting Lines</a>
does not mention this restriction.
Meanwhile I solved the task by selecting all VTWEG using a local range and dumping later what has been selected too much - like Anji Reddy recommended.
Regards,
Clemens