Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Difference between YVBUK and XVBUK tables

Hello,

Can somebody explain me the user of Y* and X* tables for application tables such as VBUK, LIKP etc. in user exits?

According to note 415716 Y* tables store the condition of the record currently in the database and X* tables stores the changed value. But what happens if its a new record (UPDKZ = I), shouldnt Y* table be blank?

We have the following code in the user exit

----


  • INCLUDE YVUEPRZ1_DOC_SAVE_PREP_CARRIER *

----


  • perform update only if insert or update carrier

  • UPDKZ : Update indicator

*

DATA : ls_vbpa LIKE xvbpa.

LOOP AT xlikp.

v_index = sy-tabix.

CLEAR ls_vbpa.

READ TABLE xvbpa INTO ls_vbpa

WITH KEY vbeln = xlikp-vbeln

parvw = 'SP'.

CASE ls_vbpa-updkz.

WHEN 'I' OR 'U'.

MOVE-CORRESPONDING xlikp TO likp.

MOVE-CORRESPONDING xlikp TO likpd.

*-- Prepare changes of the delivery header

PERFORM likp_bearbeiten_vorbereiten(sapfv50k).

likp-yylfnr = ls_vbpa-lifnr.

*-- Check and confirm changes

PERFORM likp_bearbeiten(sapfv50k).

MOVE-CORRESPONDING likp TO xlikp.

MOVE-CORRESPONDING likpd TO xlikp.

MODIFY xlikp INDEX v_index.

IF t180-trtyp = 'V'. "Modification

xvbuk-uvk03 = 'D'.

xvbuk-updkz = 'U'.

MODIFY xvbuk TRANSPORTING uvk03 updkz WHERE vbeln = xlikp-vbeln.

ENDIF.

WHEN 'D'.

MOVE-CORRESPONDING xlikp TO likp.

MOVE-CORRESPONDING xlikp TO likpd.

*-- Prepare changes of the delivery header

PERFORM likp_bearbeiten_vorbereiten(sapfv50k).

CLEAR likp-yylfnr.

*-- Check and confirm changes

PERFORM likp_bearbeiten(sapfv50k).

MOVE-CORRESPONDING likp TO xlikp.

MOVE-CORRESPONDING likpd TO xlikp.

MODIFY xlikp INDEX v_index.

IF t180-trtyp = 'V'. "Modification

xvbuk-uvk03 = 'D'.

xvbuk-updkz = 'U'.

MODIFY xvbuk TRANSPORTING uvk03 updkz WHERE vbeln = xlikp-vbeln.

ENDIF.

ENDCASE.

ENDLOOP.

Now the problem is that SAP is saying that the table YVBUK also has to have the same record as XVBUK but I think its absurd for UPDKZ = I since there will be no database image for that.

thanks

Tags:
Not what you were looking for? View more on this topic or Ask a question