‎2010 May 10 8:56 AM
Hi guys,
I am trying to insert several line into a Z db table.
I use : modify zmm_modif from zmm_modif.
I do it 10 times with different value but i get only 1 line into my DBtable.
After searching forums, i tries several solutions :
I added : COMMIT WORK AND WAIT.
or 'COMMIT WORK'
or CALL FUNCTION 'DB_COMMIT'.
But none of these solutions work.
The only addition that works is : 'WAIT up to 1 seconds'. But it takes ages (10 sec) to do the job.
Its the same result with insert or modify.
Anyone has an idea?
Thank for your help.
Olivier.
‎2010 May 10 12:33 PM
I do it 10 times with different value but i get only 1 line into my DBtable.
You should disregard some of the answers...doing this from within a loop is NOT efficient and should be avoided. My tables update without the commit work, since my program ends normally...
As last previous poster noted, what are you changing? Unless you change the KEY fields values, there will be no additional rows.
‎2010 May 10 9:16 AM
data : begin of it_zmm_modif occurs 0.
include structure zmm_modif.
data : end of it_zmm_modif.
loop....
append value to it_zmm_modif.
endloop...
" Collect all your data in internal table within loop then
modify zmm_modif from FROM TABLE it_zmm_modif.
commit work.
a®
‎2010 May 10 9:21 AM
data : begin of it_zmm_modif occurs 0.
include structure zmm_modif.
data : end of it_zmm_modif.
loop at it_zmm_modif.
modify zmm_modif from it_zmm_modif.
endloop
‎2010 May 10 9:50 AM
Hi,
Are you in a loop or do you want to do your insert from an internal table.?
because with the additionnal key word: from wa you must do in a loop if you have severals lines.
Best regards Sylvain
‎2010 May 10 9:56 AM
Hi,
Do the operation in the lOOP-----ENDLOOP.
Before endloop .use AAPEND .It will work.
Regards,
Pravin
‎2010 May 10 10:34 AM
Hi joskin...
the modify statemente overwrite the record with the same key fields and create new record if the
aren't record without key fields equals to the new record...
so check you are changing the value of the key field in the new records.
Best regards
Marco
‎2010 May 10 12:33 PM
I do it 10 times with different value but i get only 1 line into my DBtable.
You should disregard some of the answers...doing this from within a loop is NOT efficient and should be avoided. My tables update without the commit work, since my program ends normally...
As last previous poster noted, what are you changing? Unless you change the KEY fields values, there will be no additional rows.
‎2010 May 10 12:58 PM
‎2010 May 11 6:54 AM
I changed the index and it works. Thank for your help guys !
Olivier.