2008 Jul 01 3:04 PM
Hi guys,
help me out with this basic question.
the first select is showing a record, but I dont see that record once the second query is done. the values are not been populated in the itab_konv though i have declared all of them correctly
select vkvbeln vkkunnr vk~vbtyp
vkbukrs_vf vkvkorg vkvtweg vkspart
vknetwr vkwaerk vk~knumv
vkerdat vkernam
kn~name1
into table itabvbak
from vbak as vk
inner join kna1 as kn on knkunnr = vkkunnr
where vk~vbeln = zvbak-vbeln.
if sy-subrc = 0.
select single knumv kschl
into corresponding fields of table itab_konv
from konv
where knumv EQ itabvbak-knumv
AND kposn EQ itabvbak-kposn
AND kschl EQ 'ZMAD'.
2008 Jul 01 3:34 PM
Hi
does itabvbak has header? if so is there any value in it? try reading itabvbak and then populate itabvbak-knumv.
or
remove single and use for all entries - this is not required as u r fetching for single kschl.
Hi Anik,
In Second Select query specify FOR ALL ENTRIES IN itabvbak before the where condition..
Hope this would solve the problem.
Regards
Narin Nandivada.
2008 Jul 01 3:18 PM
hi,
just do the following modification and check
select single knumv kschl
into corresponding fields of table itab_konv
from konv
for all entries in itabvbak
where knumv EQ itabvbak-knumv
AND kposn EQ itabvbak-kposn
AND kschl EQ 'ZMAD'.
regards
padma
2008 Jul 01 3:24 PM
hi padma,
It says for all entries in itab is not allowed for select single
regards
2008 Jul 01 3:25 PM
hi,
Remove single keyword from your select query
this should work
2008 Jul 01 3:43 PM
Hi padma thats working thanx.
write : 'zmad is greater than 20% for :' itab_konv-knumv.
does this result in getting the output as the value from that internal table from the fetched record???
Regards
2008 Jul 01 3:34 PM
Hi
does itabvbak has header? if so is there any value in it? try reading itabvbak and then populate itabvbak-knumv.
or
remove single and use for all entries - this is not required as u r fetching for single kschl.
2008 Jul 01 3:46 PM
2008 Jul 01 4:43 PM
Hi Anik
itabvbak doesnt hav header?? then how can u compare this value in where condition without for all entries -??? there shud be syntax error.
i wonder how the records are fetched from 2nd query - tat record must be for blank knumv i guess
and write : ... itab_konv-knumv. ???? - does this has header? if so have you read the table into header? if itab_konv-knumv has value then write statement will definitely print it.
2008 Jul 01 6:32 PM
Hey,
thanx i used a work area and i got that ryt now.
I have to add all the amounts for a particular docu condition number which has number of items. So, can i do like this?
select knumv kposn kschl kbetr
into wa_itab_konv
from konv
FOR ALL ENTRIES IN itabvbak
where knumv EQ itabvbak-knumv
AND kposn EQ itabvbak-kposn
AND kschl EQ 'ZMAD'.
append wa_itab_konv to itab_konv.
Data: i_kbetr like konv-kbetr,
i_value type n value 0.
select single kbetr into i_kbetr.
i_value = i_kbetr + i_value.
endselect.
But, this is showing some errors...
Regards
2008 Jul 01 6:45 PM
this is wrong..
select single kbetr into i_kbetr.
i_value = i_kbetr + i_value.
endselect.
do like this
Data:v_kbetr like konv-kbetr.
select single kbetr into v_kbetr from knov where condition...
i_value = i_kbetr + i_value.
endselect.
2008 Jul 01 4:48 PM
Hi Anik,
In Second Select query specify FOR ALL ENTRIES IN itabvbak before the where condition..
Hope this would solve the problem.
Regards
Narin Nandivada.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |