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

internal table error

Former Member
0 Likes
1,782

first i populated internal table itab-vbak where p_vbeln is a select option

SELECT vbeln

vkorg

vtweg

spart

erdat

kunnr

into corresponding fields of TABLE itab_vbak

FROM vbak

WHERE vbeln IN p_vbeln.

and then itab-kna1

SELECT kunnr

name1

ort01

land1

pstlz

INTO corresponding fields of TABLE itab_kna1

FROM kna1

FOR ALL ENTRIES IN itab_vbak

WHERE kunnr IN itab_vbak-kunnr.

but while activating i am getting error

the IN operator with itab_vbak-kunnr is follwoed neither by an internal table nor by a value list.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,402

hi,

SELECT kunnr

name1

ort01

land1

pstlz

INTO corresponding fields of TABLE itab_kna1

FROM kna1

FOR ALL ENTRIES IN itab_vbak

WHERE kunnr = itab_vbak-kunnr.

Make the above change . It will work fine..

Rgds.,

subash

9 REPLIES 9
Read only

Former Member
0 Likes
1,403

hi,

SELECT kunnr

name1

ort01

land1

pstlz

INTO corresponding fields of TABLE itab_kna1

FROM kna1

FOR ALL ENTRIES IN itab_vbak

WHERE kunnr = itab_vbak-kunnr.

Make the above change . It will work fine..

Rgds.,

subash

Read only

Former Member
0 Likes
1,402

you can't use in clause for for all entries

replace in with =

mukesh aggarwal

Read only

Former Member
0 Likes
1,402

Hi,

The itab_vbak-kunnr denotes a single KUNNR value whereas it should actually be a range or an internal table containing number of KUNNR values. Thats why its throwing the error.

You need to take all the kunnr values from you table populate it in a range and then use it after IN operator.

Thanks

Vasudha

Read only

Former Member
0 Likes
1,402

Hi,


WHERE kunnr = itab_vbak-kunnr.

Try it..

Read only

Former Member
0 Likes
1,402

Hi,

Find the corrected code below.

SELECT vbeln

vkorg

vtweg

spart

erdat

kunnr

into corresponding fields of TABLE itab_vbak

FROM vbak

WHERE vbeln IN p_vbeln.

if not itab_vbak is initial.

SELECT kunnr

name1

ort01

land1

pstlz

INTO corresponding fields of TABLE itab_kna1

FROM kna1

FOR ALL ENTRIES IN itab_vbak

WHERE kunnr IN itab_vbak-kunnr.

endif.

This should work

Read only

Former Member
0 Likes
1,402

Hi Vishal,

Use the code.


SELECT kunnr
name1
ort01
land1
pstlz
INTO corresponding fields of TABLE itab_kna1
FROM kna1
FOR ALL ENTRIES IN itab_vbak
WHERE kunnr IN kunnr.

Thanks,

Chidanand

Read only

Former Member
0 Likes
1,402

Hi,

In operator can be used when you are populating the internal table with reference to Select-options

When you are populating the internal table with reference to other internal table variable ' = ' operator should be used

Read only

Former Member
0 Likes
1,402

thanks

Read only

Former Member
0 Likes
1,402

Hi,

U can make a small change in query as :

SELECT kunnr

name1

ort01

land1

pstlz

INTO corresponding fields of TABLE it_kna1

FROM kna1

FOR ALL ENTRIES IN it_vbak

WHERE kunnr = it_vbak-kunnr.

Because for all entries will take all the data and will iterate till all the data is visisted.