Hi,
My issue is :
I want to calculate the total amount for a particular document no..
select belnr
bschl
dmbtr
zuonr
kunnr
zfbdt
from bseg
into table gt_bseg
for all entries in gt_bsak
where bukrs eq p_bukrs
and belnr eq gt_bsak-belnr
and gjahr eq gt_bsak-gjahr
and buzei in gr_buzei1
and augbl eq gt_bsak-augbl
and bschl eq '09'.
select kunnr
belnr
dmbtr
from bsid
into table gt_bsid
for all entries in gt_bseg
where bukrs eq p_bukrs
and kunnr eq gt_bseg-kunnr
and umsks in gr_umsks
and umskz in gr_umskz
and augdt in gr_augdt
and augbl in gr_augbl
and zuonr eq gt_bseg-zuonr
and gjahr in gr_gjahr
and belnr in gr_belnr
and buzei in gr_buzei
and budat eq gt_bseg-zfbdt
and blart eq 'DX'.
from the above select if i get more than one doc.(same doc.) then i have to sum up the dmbtr values and to display it in the o/p.
kunnr belnr dmbtr
9211004088 9500000088 30,000.00
9211004088 9500000089 30,000.00
depending on kunnr i have calculate dmbtr.in the above case i should get the o/p as
9211004088 60,000