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
419

I tried to modify data in internal table having age 23 as 25.I got the result using this code.

itab-age = 25.

modify itab transporting age where age = 23.

But when i tried to multiply age by 2(some number for eg)its not working.I got 0 only.How to do this?

3 REPLIES 3
Read only

Former Member
0 Likes
396

Hi!

That's what you can't perform with 1 line.

Make a LOOP and within the LOOP use the MODIFY.

LOOP AT itab.

itab-age =itab-age / 2.

MODIFY itab INDEX sy-tabix.

ENDLOOP.

Regards

Tamá

Read only

Former Member
0 Likes
396

hi,

data : tabix type sy-tabix.

loop at itab.

tabix = sy-tabix.

case itab-age.

when '23'.

move '25' to itab-age.

or else do wat ever modification u need.

end case.

modify table itab index tabix transporting age.

endloop.

regards

siva

Read only

Former Member
0 Likes
396

Hi,

Try this

Read table itab into ls_itab with key age ='23'.

if sy-subrc eq 0.

ls_itab-age = '25'

modify itab from ls_itab index sy-tabix.

endif.

reward point if useful

Regards,

Niyaz