Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

modify

Former Member
0 Likes
349

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

2 REPLIES 2
Read only

Former Member
0 Likes
328

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.

Read only

Former Member
0 Likes
328

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