Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

UPDKZ indicator is not getting set correctly in VA01/VA02

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Clemenss
Active Contributor
0 Kudos

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

16 REPLIES 16

Former Member
0 Kudos

Can you try to read the value from YVBAP which will have the modified value?

Clemenss
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Could you share a snippet of your code?

former_member203305
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

Share a snippet of your code, otherwise we can only keep shooting random answers...

0 Kudos

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.

0 Kudos

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?

0 Kudos

Hi

The internal table contains both the item details, but UPDKZ flag is getting set for first line item.

Regards

Sunil

0 Kudos

Please check my point. Both items updated?

Clemens

0 Kudos

No only one item is getting updated with U.

0 Kudos

So everything's fine, isn't it?

Clemens

0 Kudos

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.

0 Kudos

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

Jelena
Active Contributor
0 Kudos

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.