‎2007 May 23 8:52 PM
hi
i have two itabs
ITAB1 with NAME field.
ITAB2 with NAME and MARKS fields.
if name in itab2 matches name in itab1 , i should assign marks 100 to that name.
i thought of coding this way.
loop at itab1.
loop at itab2 where name = itab1-name.
itab2-marks = 100.
endloop.
modify itab2.
endloop.
is it a right way of using modify command.
is there any way i can improve performance by sort method.
‎2007 May 23 8:55 PM
Hi,
Please try this.
LOOP AT ITAB2.
READ TABLE ITAB1 WITH KEY NAME = ITAB2-NAME.
IF SY-SUBRC = 0.
ITAB2-MARKS = 100.
MODIFY ITAB2.
ENDIF.
ENDLOOP.
Regards,
Ferry Lianto
‎2007 May 23 8:54 PM
sort itab1 by name
sort itab2 by name.
loop at itab2.
read table itab1 with key name = itab2-name binary search.
if sy-subrc eq 0.
itab2-marks = 100.
<<update itab2.
endif.
endloop.
‎2007 May 23 8:54 PM
HI,
check this..
loop at itab1.
loop at itab2 where name = itab1-name.
itab2-marks = 100.
<b>modify itab2 transporting marks.</b>
endloop.
endloop.
Regards
SAB
‎2007 May 23 8:55 PM
Hi,
Please try this.
LOOP AT ITAB2.
READ TABLE ITAB1 WITH KEY NAME = ITAB2-NAME.
IF SY-SUBRC = 0.
ITAB2-MARKS = 100.
MODIFY ITAB2.
ENDIF.
ENDLOOP.
Regards,
Ferry Lianto
‎2007 May 23 8:58 PM