2008 Oct 21 5:31 AM
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.
2008 Oct 21 5:33 AM
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
2008 Oct 21 5:33 AM
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
2008 Oct 21 5:33 AM
you can't use in clause for for all entries
replace in with =
mukesh aggarwal
2008 Oct 21 5:35 AM
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
2008 Oct 21 5:38 AM
2008 Oct 21 5:40 AM
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
2008 Oct 21 5:45 AM
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
2008 Oct 21 5:48 AM
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
2008 Oct 21 5:52 AM
2008 Oct 21 6:02 AM
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.