2013 Jul 18 10:34 AM
Hi all,
I have created a ztable releted to sale order details.There is some problem in updating the table.
whenever a record is added or modified, the update gets failed untill the next change is done...
Eg..1st change which i made is updated only after the 2nd change is made and 2nd change is updated after the 3rd and so on....
Please help me in this reg.
Regards,
Sam.
2013 Jul 18 11:49 AM
2013 Jul 18 12:03 PM
Hi Sam,
Tell whether the Fields in the Z Table are standard's or custom fields.?
if it is standard then there should n't be any problem in insert/update the records.
can you tell in detail how the table is being updated...
2013 Jul 18 12:08 PM
did you use COMMIT WORK after update? if not try with using it.
2013 Jul 18 12:08 PM
Read Asking Good Questions in the SCN Discussion Spaces will help you get Good Answers
Can you precise :
Read online help like Implicit Database Commits (or what the system did that you should have done yourself before...^)
Regards,
Raymond
2013 Jul 20 6:41 AM
Dear all,
Thanks for your replies. The problem is solved.
I had to update custom field. There was a problem in commit work and was rectified.
Rgds,
Sam.
2013 Jul 21 7:37 AM
Just check the documentation in INSERT and MODIFY.
INSERT dbtab
INSERT { {INTO target VALUES source }
| { target FROM source } }.
The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
System Fields
The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.
| sy-subrc | Meaning |
| 0 | At least one row was inserted. |
| 4 | At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index. |
Example, INSERT INTO ztable VALUES wa_ztable
MODIFY dbtab
The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
System fields
The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
| sy-subrc | Meaning |
| 0 | All lines were inserted or changed. |
| 4 | At least one line could not be processed as there is already a line with the same unique name secondary index in the database table. |
The MODIFY statement sets sy-dbcnt to the number of processed lines.
The changes are finally transferred to the database table with the next database commit. Up to that point, they can be reversed with a database rollback.
The statement UPDATE changes the content of one or more lines of the database table specified in target. The entries in source determine which columns of which lines are changed, and how they are changed.
System fields
The statement UPDATE sets the values of the system fields sy-subrc and sy-dbcnt.
| sy-subrc | Meaning |
| 0 | At least one line has been changed. |
| 4 | At least one line was not able to be changed, either because no appropriate line was found, or because the change would generate a line that leads to double entries in the primary key or a unique secondary index in the database table. |
The statement UPDATE sets sy-dbcnt to the number of changed lines.
The changes are definitively copied to the database with the next database commit. Until that point, they can still be undone using a database rollback
2013 Jul 21 7:48 AM
Hi Samuel,
Did you check if other tables also have the same behavior?
One suggestion: After your first change, check for consistency of the table structure and contents in SE14 transaction. In case of any consistencies exist, you can try to adjust the table.
-Ashwin
2013 Jul 21 9:22 AM
it is a simple problem, before asking, you should try to get any help online first.
2013 Jul 21 11:09 AM
Hello Sam,
You can use "COMMIT WORK" after your statement used for Updating (either UPDATE/MODIFY/INSERT). So that all the tables related to that particular object will get updated.
Thanks & Regards,
VIJAY