on 2024 Jun 13 6:30 PM
Hi Gurus,
As per the business requirement , I have added custom field ZZETA to LIKP table along with screen enhancement using BADI LE_SHP_TAB_CUST_HEAD.
TR got moved to production and everything was working fine. Now the user asked me he needs validation before saving in VL01N for ZZETA which I have added.
I have done some research and implemented the implicit enhancement for USEREXIT_SAVE_DOCUMENT in MV50AFZ1 .
The following is the code used in the enhancement implementation.
I am just validating the custom field with empty ZZETA and the following message is getting displayed
So far it is fine.
Now I have inserted ZZETA date and saved.
The document got saved.
When I closed the page the following page is getting displayed.
From ST22 analysis,
ABAP programming error
DBSQL_DUPLICATE_KEY_ERROR
CX_SY_OPEN_SQL_DB
SAPLV05I
An exception has occurred in class "CX_SY_OPEN_SQL_DB". This exception was not
caught
in procedure "SD_PARTNER_UPDATE" "(FUNCTION)" or propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated this
exception, the current program was terminated.
The reason for the exception occurring was:
The reason for the exception is:
When an Open SQL array insert is performed, trying to insert a record
into the database table "VBPA" causes the function to terminate if a
record with the same key already exists.
The major concern here is though it is showing that Delivery of the product has been saved , it is not
getting updated in the LIKP table.
However, I am not working on VBPA table in this scenario. How to fix this error ?
Is that the code which is causing the issue, though there is no syntax error ? OR
is this the wrong FM USEREXIT_SAVE_DOCUMENT I have used for validation ?
I am completely clueless now..............................Plz give me some hint how to proceed further.
Request clarification before answering.
Hi,
i recommend to delete modification in USEREXIT_SAVE_DOCUMENT in MV50AFZ1 and implement BADI LE_SHP_DELIVERY_PROC. In method SAVE_DOCUMENT_PREPARE add Your check, and change type message to type E - Error not I - Information. This should solved Your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.