06-17-2008 7:06 AM
Hi experts.
i have a problem.when i use the code shown below.Move command actually moves the kbetr field to corresponding fields of table itab.but it is not appending that field to itab.wat shoul i use after move to fill the kbetr coloumn of table itab.append is not valid.if i use modify itab then it gives a syntax error.plz solve ma problem.
LOOP AT IT_FINAL.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR.
ENDLOOP.
regards,
raman
06-17-2008 7:09 AM
HI,
you forgot the modify itab or append itab inside the loop.
LOOP AT IT_FINAL.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR.
modify itab.
ENDLOOP.
Reward points if helpfull
Nicole
06-17-2008 7:09 AM
LOOP AT IT_FINAL.
read table itab with key field1 = it_final-field1.
if sy-subrc eq 0.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR.
modify itab.
endif.
ENDLOOP.
Regards,
Dhana
06-17-2008 7:09 AM
Hi Raman,
Add APPEND statement.
LOOP AT IT_FINAL.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR.
APPEND itab. "Add this line if ur itab don't have any data.
MODIFY itab. " Add this line if ur itab has data already(U have read
"itab with appropriate keys).
ENDLOOP.
Thanks,
Vinod.
06-17-2008 7:10 AM
Hi,
You are just moving the data into the header and not into the table...After move statement, use the append statement.
LOOP AT IT_FINAL.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR.
Append ITAB.
Clear ITAB.
ENDLOOP.
The above code will solve the issue
Reward if useful
Regards
Shiva
06-17-2008 7:10 AM
Try this code,
LOOP AT IT_FINAL.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR.
APPEND ITAB_KBETR.
ENDLOOP.
06-17-2008 7:12 AM
remove ':' after move.
if itab contains values and u only need to fill value of column kbetr for the records contained in itab, use
modify itab transporting kbetr.
plz reward points if dis helps.
06-17-2008 7:14 AM
Hi,
use as following.
It will help you to modify itab at specific record.
Data index2 type sy-tabix.
LOOP AT itab.
INDEX2 = SY-TABIX.
READ TABLE IT_FINAL WITH KEY <common field> = <field>.
IF SY-SUBRC = 0.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR..
MODIFY itab INDEX INDEX2.
CLEAR INDEX2.
ENDIF.
ENDLOOP.
Reward pts. if helpfull.
Regards,
Dhan
06-17-2008 7:23 AM
Hi Raman,
Why dont you try with the append statement. Also if you get the same functionlaity then what you need ot do is just to append the data intot he internal table and thenafter delete that record form the it_final table.