2011 Jan 12 10:39 AM
Hi All ,
I have such data in two internals table :
IT_bdc
vbeln posnr
90000593 10
90000576 10
90000672 10
90000672 20
90000672 30it_konv
kbetr vbeln
6250 90000576
12160000 90000593
500000 90000672
600000 90000672
700000 90000672My current program statement is :
LOOP AT it_bdc.
READ TABLE it_konv WITH KEY
vbeln = it_bdocs-vbeln.
currency = it_konv-waers.
*******
endloop.as you can see the posnr is missing in it_konv how can i modify this read statement so
that vbeln posnr from it_bdc should get correct kbetr from it_konv.
Kindly help in this mapping.
2011 Jan 12 12:14 PM
Hi,
KONV-KPOSN = VBRP-POSNR.
So add KPOSN in your IT_KONV and modify your read statement as
READ TABLE it_konv WITH KEY
vbeln = it_bdocs-vbeln
kposn = it_bdocs-posnr..
Thanks & Regards,
Faheem.
Hi All ,
I have such data in two internals table :
IT_bdc
vbeln posnr
90000593 10
90000576 10
90000672 10
90000672 20
90000672 30it_konv
kbetr vbeln
6250 90000576
12160000 90000593
500000 90000672
600000 90000672
700000 90000672My current program statement is :
LOOP AT it_bdc.
READ TABLE it_konv WITH KEY
vbeln = it_bdocs-vbeln.
currency = it_konv-waers.
*******
endloop.as you can see the posnr is missing in it_konv how can i modify this read statement so
that vbeln posnr from it_bdc should get correct kbetr from it_konv.
Kindly help in this mapping.
2011 Jan 12 11:46 AM
Hi
sort it_konv by vbeln
then
loop at it_bdc.
read table it_konv with key vbeln = it_bdc-vbeln binary search.
if sy-subrc = 0.
perform your logic/task.
endif.
endloop.
also it depends what you want to do after reading it_konv.
in my logic if there is a vbeln in it_konv which s present in it_bdc then sy-subrc will be 0
and you can perform your logic.
and if there will be no matching vbeln in it_konv then sy-subrc will not be 0.
check the values in debugging.
Thanks
Lalit
2011 Jan 12 12:14 PM
Hi,
KONV-KPOSN = VBRP-POSNR.
So add KPOSN in your IT_KONV and modify your read statement as
READ TABLE it_konv WITH KEY
vbeln = it_bdocs-vbeln
kposn = it_bdocs-posnr..
Thanks & Regards,
Faheem.
2011 Jan 12 3:16 PM
Thanks all, I made kposn available just as mentioned in one of internal table and problem is solved now.