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: 

Difference between YVBUK and XVBUK tables

Former Member
0 Kudos

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

3 REPLIES 3

LucianoBentiveg
Active Contributor
0 Kudos

When you debug exit for UPDKZ = I Y* table have any record?

0 Kudos

To answer Peluka's question there are no entries in Y* table when UPDKZ = I or UPDKZ = U

and I dont quite understand what Ferry Lianto is saying but I think its pretty much the same as above

thanks for your help

ferry_lianto
Active Contributor
0 Kudos

Hi,

Usually table Y* is storing old conditions/values when any changing occured and table X* is storing the current conditions when changing happened.

Hoep this will help.

Regards,

Ferry Lianto