cancel
Showing results for 
Search instead for 
Did you mean: 

UPDKZ field in MV45AFZZ

former_member600242
Participant

Hi,

I am facing a problem when trying to put a logic in USEREXIT_MOVE_FIELD_TO_VBAP.

I want to change the field VBAP-ARKTX based on the UPDKZ field. The logic is pretty simple, if the sales quotation item is getting created, VBAP-ARKTX = X and if the sales quotation item is getting modified, thenVBAP-ARKTX = Y.

The problem is that if anyone changes manually the VBAP-ARKTX with VA22, there is no UPDKZ indicator, it comes empty and that makes it impossible to identify the change.

The thing is that, changing the VBAP-ARKTX and the quantity at the same time, does make UPDKZ = 'U', but modifying the VBAP-ARKTX will leave the UPDKZ = space. Changing the quantity alone also makes UPDKZ = 'U'.

Is there any way to track the changes of the field VBAP-ARKTX via user exit? Is there any documentation of which fields trigger UPDKZ = 'U' after a change?

For more information:

  • After changing the VBAP-ARKTX and having UPDKZ = space in the exit, the changes is getting saved in database. Also, there is no entry in YVBAP with the item that is getting changed -> ODD, I read that this is not how this works in https://wiki.scn.sap.com/wiki/display/SD/UPDKZ+modification.
  • I have made sure that there is no UPDKZ deletion in any Z code, so the problem is not in the custom code.
  • USEREXIT_MOVE_FIELD_TO_VBAP gets triggered after changing the VBAP-ARKTX and pressing enter, which is odd because it is not getting triggered after changing the quantity and pressing enter.

Best regards,

View Entire Topic
thkolz
Contributor

Maybe try this:

FORM USEREXIT_MOVE_FIELD_TO_VBAP.

IF SVBAP-TABIX = 0. "Create item *
vbap-arktx = 'Y'.
ELSEIF SVBAP-TABIX > 0. "Change item
vbap-arktx = 'X'.
ENDIF.

ENDFORM.
former_member600242
Participant

Hi,

this one seems to do the trick. Everytime an item gets created, SVBAP-TABIX = 0.

However, if a created item gets modified in the same session (for example, changing the quantity of an item that has just been added) SVBAP-TABIX <> 0. Luckily, in these cases UPDKZ = 'I' (who knows why it does not equal I before) so we can use both SVBAP-TABIX and XVBAP-UPDKZ.

Thank you very much.

Best regards.

thkolz
Contributor
0 Kudos

Great to hear!

There're quite useful comments above the form routines in MV45AFZZ (at least in S/4 systems) about the fact if data is created or changed.