04-24-2006 11:09 PM
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
04-25-2006 8:53 PM
04-25-2006 10:41 PM
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
04-25-2006 8:59 PM
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