Application Development 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: 

modify internal table based on field

anil_kumar98
Participant
0 Kudos

in internal table i have

vbeln posnr qty errorlog

0001 10 2000

0001 10 200

0001 10 100 e

0002 10 1000

0002 20 2000

depending on the error at e in third item remain above in same vbeln need to make errorlog as e

vbeln posnr qty errorlog

0001 10 2000 e

0001 10 200 e

0001 10 100 e

0002 10 1000

0002 20 2000

9 REPLIES 9

Former Member
0 Kudos

Hi,

loop at table assigning <fs_table> where errorlog eq 'e'.

append <fs_table> to lt_errors.

endloop.

loop at lt_errors assigning <fs_errors>.

loop at table assigning <fs_table> where vbeln eq <fs_errors>-vbeln and posnr eq <fs_errors>-posnr.

<fs_table>-errorlog = 'e'.

endloop.

endloop.

grtz,

Koen

Former Member

Hi,

see the code.


loop at itab where errorlog = 'e'.
  MODIFY itab where vbeln = itab-vbeln TRANSPORTING errorlog = 'e'.
endloop.

rgds,

bharat.

0 Kudos

no not working

loop at itab where errlog = 'X'

search only where itfound but not in vbeln particulary need to change vbeln particularly and has to change based on particular vbeln

Regarding

anil

0 Kudos

Hi,

do like this.


DATA:wa_itab like itab.
sort itab by errorlog.
loop at itab INTO wa_itab where errorlog = 'e'.
  LOOP AT itab where vbeln = wa_itab-vbeln.
    MODIFY itab from wa_itab TRANSPORTING errorlog.
  ENDLOOP.
endloop.

rgds,

bharat.

0 Kudos

loop at itab where err = 'e'.

modify itab transporting err where err = ' '.

endloop.

Former Member
0 Kudos

Hi,

Use the below code.

data v_tabix type sy-tabix.

read table itab with key errorlog = 'e'.

if sy-subrc = 0.

v_tabix = sy-tabix - 1.

endif.

if not v_tabix is initial.

loop at itab from 1 to v_tabix.

itab-errorlog = 'e'.

modify itab.

endloop.

endif.

0 Kudos
MODIFY it_document FROM  w_document TRANSPORTING sel WHERE sel eq ''.
       

I am sure your reply must have helped him 11 years after he posted his question... :-).

0 Kudos

your code not complete, it make confuse.