2007 Jun 25 1:59 PM
A custom program which is scheduled to run every day as a background job, Failed yesterday with the below system log:
R3JD: SQL UPDATE FAILED. Error in ZMOMPO05. Contact R3JD Support. R3JD
Additional Info: A2000_UPDATE_PROCESS UPDATE ZMPOR FAILED.
Additional Info: SY-SUBRC RETURN CODE: 4
Transaction termination ZZ 999 ( ZMOMPO05 )
It got failed while trying to update a custom table, but when we tried to run manually in the foreground it got completed successfully, and also the problem was only for that day, as it was doing well before it failed yesterday and even today it has completed successfully as a background job itself .
I am doing an RCA on this, any sought of help would be appreciated.
Thank you
2007 Jun 25 2:21 PM
Hi,
Lets take a look at the help for the UPDATE command:
SY-SUBRC = 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.
To keep it simple I will assume the Z table does not have a unique secondary index. It is most likely that the update failed because the program tried to update a record that did not exist in the Z table. The best you can do is add reporting to the Z program so should the problem occur again you will know exactly why. You can do this by adding a SELECT statement that tries to read the record you are about to update and report an error if the record does not exist. To improve performance you could execute the SELECT after the UPDATE fails just to prove it is missing data.
Alternatively you could replace the UPDATE with a MODIFY statement so the record will be created if it does not already exist.
Hi,
Lets take a look at the help for the UPDATE command:
SY-SUBRC = 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.
To keep it simple I will assume the Z table does not have a unique secondary index. It is most likely that the update failed because the program tried to update a record that did not exist in the Z table. The best you can do is add reporting to the Z program so should the problem occur again you will know exactly why. You can do this by adding a SELECT statement that tries to read the record you are about to update and report an error if the record does not exist. To improve performance you could execute the SELECT after the UPDATE fails just to prove it is missing data.
Alternatively you could replace the UPDATE with a MODIFY statement so the record will be created if it does not already exist.
2007 Jun 25 2:21 PM
Hi,
Lets take a look at the help for the UPDATE command:
SY-SUBRC = 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.
To keep it simple I will assume the Z table does not have a unique secondary index. It is most likely that the update failed because the program tried to update a record that did not exist in the Z table. The best you can do is add reporting to the Z program so should the problem occur again you will know exactly why. You can do this by adding a SELECT statement that tries to read the record you are about to update and report an error if the record does not exist. To improve performance you could execute the SELECT after the UPDATE fails just to prove it is missing data.
Alternatively you could replace the UPDATE with a MODIFY statement so the record will be created if it does not already exist.
2007 Jun 25 3:22 PM
Hi Surbjeet,
Thanks for your time, Thats very true but when we tried doing it manually in the foreground, it got completed successfully.
Any thoughts on this.
2007 Jun 25 2:22 PM
hi
just refer to the link below
http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g
regards
ravish
<b>plz dont forget to reward points if helpful</b>
2007 Jun 25 3:27 PM
Hi,
From the error it looks like that the update process is terminated while trying to update the databse/table. You can check the system log and runtime log using txn sm21 and st22. This should give some information. You can ask basis guys for help while reading sm21 log.
2007 Jun 25 4:49 PM
Still the issue is not yet resolved, any sought of help would be appreciated. looking forward for your suggestions.
2007 Jun 25 5:15 PM
1) It looks like the program is try to update a custom Z table - what is the key? Sometimes there can be problems if one of the key fields is a date or a time.
2) Are there any processes that delete entries from the table - could one of them have been running at the same time?
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |