‎2006 Dec 18 4:02 PM
Hello,
I tried to use the following code to update an internal table. It did not work as I expected.
In debug mode, I saw the change of ITEM_ITAB-TX which is what I wanted. But when I really ran the program, the ITEM_ITAB-TX did not change. Should I add some more code? Please advise. Thanks.
LOOP AT I_ITAB.
READ TABLE I_DITAB WITH KEY NR = I_ITAB-NR.
*IF A RECORD IS FOUND
IF SY-SUBRC = 0.
I_ITAB-TX = I_DITAB-TX.
ENDIF.
ENDLOOP.
‎2006 Dec 18 4:04 PM
‎2006 Dec 18 4:04 PM
‎2006 Dec 18 4:04 PM
Small change in code
LOOP AT I_ITAB.
READ TABLE I_DITAB WITH KEY NR = I_ITAB-NR.
*IF A RECORD IS FOUND
IF SY-SUBRC = 0.
I_ITAB-TX = I_DITAB-TX.
MODIFY I_ITAB<- Here
ENDIF.
ENDLOOP.
‎2006 Dec 18 4:04 PM
Do the changes below
LOOP AT I_ITAB.
READ TABLE I_DITAB WITH KEY NR = I_ITAB-NR.
*IF A RECORD IS FOUND
IF SY-SUBRC = 0.
I_ITAB-TX = I_DITAB-TX.
MODIFY I_ITAB. "Do these changes
ENDIF.
ENDLOOP.
Rgards,
Ravi
Note - Please mark all the helpful answers
‎2006 Dec 18 4:09 PM