05-25-2016 2:10 PM
Hi Team,
Currently we are updating a custom table on the save of a sales order in VA01/VA02 transaction. We are using the User exit save section to update the custom table which gets triggered based on update indicator (UPDKZ) from XVBAP table.
But I am facing one issue when we update the contract related dates for both the line items and click save button. The update indicator U is getting set for only one line item UPDKZ and it is not getting set for second line item.
Please let me know why it could be failing and not able to recognize or set up the indicator to U when multiple line item details gets changed.
Thanks in advance.
Regards
Sunil Kumar.
05-25-2016 3:10 PM
Hi sunil,
did you make sure that both VBAP records have been modified?
I don't think any reords with update indicator = space will be changed in database.
Regards Clemens
05-25-2016 2:22 PM
Can you try to read the value from YVBAP which will have the modified value?
05-25-2016 3:10 PM
Hi sunil,
did you make sure that both VBAP records have been modified?
I don't think any reords with update indicator = space will be changed in database.
Regards Clemens
05-25-2016 3:28 PM
Hi Clemens,
Yes.. both the records are modified but still the indicator is not getting set appropriately to U. It sets correctly incase if we change mutliple records and also add new item using VA02.
Regards
Sunil Kumar
05-25-2016 3:44 PM
05-25-2016 9:09 PM
Hi,
check where you are adding the code, maybe the code is getting update at the header, that's why u get update just one item...maybe the location of the code of updating is not correct.
it should be done at item level.
what exit or badi are u using?
Regards
Miguel
05-26-2016 10:16 AM
Hi Miguel,
I am using the userexit_save_document in MV45AFZZ program. Updating the custom table is based on the indicator i.e. if UPDKZ is equal to U or I or D.. performing various operations.
Regards
Sunil Kumar.
05-26-2016 10:26 AM
Share a snippet of your code, otherwise we can only keep shooting random answers...
05-26-2016 10:45 AM
The code sniplet is as below.
Loop at XVBAP.
Case XVBAP-UPKDZ.
When 'I'.
Capture details and modify into local internal table.
set the lv_flag = 'X'.
When 'U'.
Capture required details into local internal table.
set the lv_flag = 'X'.
ENDCASE.
Endloop.
if lv_flag = X.
Modify table from local itnernal table.
Endif.
05-26-2016 10:53 AM
Ok, now it's a bit more clear.
Please, let me re-formulate your issue:
Your internal table contains only the data for the 1st record modified in VBAP instead of both of them, correct?
And are you sure (with debug) both the records in XVBAP have not the correct UPDKZ set?
05-26-2016 11:18 AM
Hi
The internal table contains both the item details, but UPDKZ flag is getting set for first line item.
Regards
Sunil
05-26-2016 1:16 PM
05-26-2016 1:28 PM
05-26-2016 1:42 PM
05-26-2016 1:48 PM
No Clemens.
I believe you did not get my point. The problem is when we loop the XVBAP table and check for UPDKZ field is equal to U.. It satisfies only one record and other record UPDKZ indicator is blank.
That is the reason when I change/update multiple line items it is not getting updated into custom table.
Regards
Sunil Kumar.
05-26-2016 2:42 PM
Hi,
i think that i know the problem...the modify of the table need to before the endloop, not inside the case.
for example:
Loop at XVBAP.
Case XVBAP-UPKDZ.
When 'I'.
Capture details and modify into local internal table.""" WRONG..!!!
set the lv_flag = 'X'.
When 'U'.
Capture required details into local internal table.
set the lv_flag = 'X'.
ENDCASE.
*** here do the modification of xvbap...always need to be here, never inside case.
Endloop.
Regards
Miguel
05-26-2016 6:31 PM
What exactly is the name of user exit you are using?
It'd seem like a major bug if the indicator wasn't set because the standard code is also based on it. So I'm inclined to think that either there is some other code in the same user exit that messes up XVBAP or you're wrong about the VBAP fields being updated.
What are the exact technical field names that you believe are updated? Kindly provide more specific information when asking questions on SCN, don't expect us to guess.