Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FOR ALL ENTRIES with Range Component

Clemenss
Active Contributor
0 Likes
1,726

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

4 REPLIES 4
Read only

Former Member
0 Likes
802

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

Read only

alex_m
Active Contributor
0 Likes
802

I believe u cant use IN operator in FOR ALL ENTRIES where condition.

Read only

Former Member
0 Likes
802

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

Read only

0 Likes
802

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