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 internal table based on field

Former Member
0 Likes
8,219

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
Read only

Former Member
0 Likes
3,345

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

Read only

Former Member
3,345

Hi,

see the code.


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

rgds,

bharat.

Read only

0 Likes
3,345

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

Read only

0 Likes
3,345

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.

Read only

0 Likes
3,345

loop at itab where err = 'e'.

modify itab transporting err where err = ' '.

endloop.

Read only

Former Member
0 Likes
3,345

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.

Read only

0 Likes
3,345
MODIFY it_document FROM  w_document TRANSPORTING sel WHERE sel eq ''.
       
Read only

3,345

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

Read only

0 Likes
3,345

your code not complete, it make confuse.