Application Development 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: 

internal table error

Former Member
0 Kudos
615

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

Former Member
0 Kudos
235

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

Former Member
0 Kudos
236

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

Former Member
0 Kudos
235

you can't use in clause for for all entries

replace in with =

mukesh aggarwal

Former Member
0 Kudos
235

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

Former Member
0 Kudos
235

Hi,


WHERE kunnr = itab_vbak-kunnr.

Try it..

Former Member
0 Kudos
235

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

former_member598013
Active Contributor
0 Kudos
235

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

Former Member
0 Kudos
235

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

Former Member
0 Kudos
235

thanks

Former Member
0 Kudos
235

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.