2008 Jun 26 8:25 AM
i have a requirement of having one of the field in the internal table to be assigned to another .the internal table has already data in it . when the stage is y040 and saprefno is blank then whatever the content is in networkid must be placed in saprefno.but the problem is that when i am using append or collect the i am getting a new record but it is not updating the old record .
LOOP AT itab_input1 into wa_input1 .
IF wa_input1-saprefno EQ ' ' and wa_input1-stage EQ 'Y040'.
wa_input1-saprefno = wa_input1-networkid.
append wa_input1 TO itab_input1.
ENDIF.
ENDLOOP.
2008 Jun 26 8:27 AM
Hi,
Use MODIFY instead of APPEND or COLLECT. Check the below code...
LOOP AT itab_input1 into wa_input1 .
IF wa_input1-saprefno EQ ' ' and wa_input1-stage EQ 'Y040'.
wa_input1-saprefno = wa_input1-networkid.
MODIFY itab_input1 FROM wa_input1 TRANSPORTING saprefno.
ENDIF.
ENDLOOP.
Rgds,
Bujji
Edited by: Bujji on Jun 26, 2008 9:28 AM
2008 Jun 26 8:27 AM
Hi,
Use MODIFY instead of APPEND or COLLECT. Check the below code...
LOOP AT itab_input1 into wa_input1 .
IF wa_input1-saprefno EQ ' ' and wa_input1-stage EQ 'Y040'.
wa_input1-saprefno = wa_input1-networkid.
MODIFY itab_input1 FROM wa_input1 TRANSPORTING saprefno.
ENDIF.
ENDLOOP.
Rgds,
Bujji
Edited by: Bujji on Jun 26, 2008 9:28 AM
2008 Jun 26 8:28 AM
hi,
instead of append use modify statement.
check these.
- MODIFY itab FROM wa INDEX idx ASSIGNING <fs> REFERENCE INTO dref TRANSPORTING f1 ... fn.
- MODIFY TABLE itab FROM wa ASSIGNING <fs> REFERENCE INTO dref TRANSPORTING f1 ... fn.
- MODIFY itab FROM wa TRANSPORTING f1 ... fn WHERE cond.
2008 Jun 26 8:31 AM
Hai,
Use the clauses Appending table itab... or appending lines of... or appending corresponding fields of ....