‎2007 Nov 06 1:56 PM
hi
i need fetch bset-fwste(tax amount), comparing with bkpf fields of bukrs,belnr,gjahr.
if for particuler belnr has 5 line items then tax amount contains 5 values for all those 5 line items .how to use modify for these line items in read table .
please help me urgent
thanks in advance
‎2007 Nov 06 2:08 PM
Hi,
make use of flags and control breaks.
check below code
DATA : V_FLAG TYPE FLAG.
data : v_tabix type sy-tabix.
at new belnr .
v_flag = 'X'.
endat.
if v_flag = 'X'.
append itab.
v_tabix = v_tabix + 1.
else.
modify itab where index = v_tabix.
endif.
‎2007 Nov 06 2:13 PM
Hi
BELNR line items will bein BSEG table
so write a select to BSEG for the required fields (check if these line items are in BSIS<BSAS,BSID,BSAD,BSIK,BSAK then use that table)
into itab
for all enteries of this itab fetch the data from BSET into itab1.
loop at itab.
read table itab1 with key belnr = itab-belnr gjahr = itab-gjahr buzei = itab-buzei.
if sy-subrc = 0.
itab- field1 = itab1-field1.
...assign like this..
modify itab index sy-tabix transaporting field1..
endif.
endloop.
Regards
Anji