‎2007 Nov 19 12:31 PM
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?
‎2007 Nov 19 12:36 PM
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á
‎2007 Nov 19 12:39 PM
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
‎2007 Nov 19 12:40 PM
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