‎2008 Dec 17 10:57 AM
‎2008 Dec 17 11:00 AM
Maybe the other two are already existing in the table with the same keyfield values.
Regards
‎2008 Dec 17 11:03 AM
Hi
Check the key combination of the records, if the key combination is different then only it inserts else modifies the records
Regards
Shiva
‎2008 Dec 17 11:07 AM
Try this:
data: inserted type i,
modified type i.
loop at itab.
insert itab into table itab.
if sy-subrc = 0 .
add 1 to inserted
else.
modify table from itab.
if sy-subrc = 0.
add 1 to modified.
endif.
endif.
endloop.
write: 'Inserted', inserted,
/ 'Modified', modified.
Regards
Marcin
‎2008 Dec 17 11:10 AM
Thanks for the help of everyone, could solve the problem
Thank´
‎2008 Dec 17 11:19 AM
hi,
this is due to double entry of data based on key combination
MODIFY
a line is searched for in the database table that has the same content in the primary key as the corresponding beginning part of the work area.
If such a line is not found, a new line is inserted according to the same rules as for the INSERT statement.
If such a line is found, this line is overwritten according to the same rules as for the UPDATE statement.
If the change would lead to a double entry in a unique secondary index, then it is not executed
hope it helps you.
thanks
Sachin
‎2008 Dec 31 6:19 PM
Hi Friend,
The Modify statement checks the key fields first, if the key fields are same them it will modify the same record without inserting the new record. Therefore check with the key fields and see that it already exist, If this is the case then it will not insert the new record instead modify the same record as well.
If the key fields have some different values then it will append the new record in the internal table.
Hope the answer of your question.
Regards,
Md Ziauddin.