Skip to Content
Author's profile photo Tobias Reiner Dolgener

Error V1331 “Item does not exist” in VF01 – why you should be careful with user-exits

The error message V1331 occurs most often in sales order processing and you can find threads about here in the SCN Forum. However, if custom own coding is programmed wrongly, then it can pop up as well, when you try to create an invoice via transaction VF01:

V1331.jpg

The root cause of the error is most often an accidental manipulation of the sales order number VBAK-VBELN in pricing user-exit

USEREXIT_PRICING_PREPARE_TKOMK of include RV60AFZZ.

Here in this exit the sales order header structure VBAK is available. If now a wrong select on VBAK is programmed, the number could be changed. One example for erroneous coding:

SAPLV60A                   / RV60AFZZ

FORM                           / USEREXIT_PRICING_PREPARE_TKOMK

IF ( vbrk-vkorg = ‘3000’ OR vbrk-vkorg = ‘5000’ ) AND ( sy-tcode = ‘VF01’ OR sy-tcode = ‘VF04’ ).

   SELECT * FROM vbak

     WHERE vbeln = vbrk-zuonr.

   ENDSELECT.

When VBRK-ZUONR is not filled with the sales order number currently involved, then VBAK-VBELN is changed wrongly, and the sales order numbers differ thereafter between header information VBAK and item VBAP:

VBAK.jpg

In the processing of the status, this inconsistency is detected and as the item VBAP structure FXVBAP does not contain the same VBELN number as in VBAK present, the check fails:

VBAPlesen.jpg

And the error message is issued when returning to function module RV_XVBUP_MAINTAIN_FKGSA:

A331.jpg

Conclusion: Be very careful with your modifications and assure that VBAK information is not changed wrongly!

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Shiva Ram
      Shiva Ram

      Nice documentation, thanks for sharing.

      Regards,

      Author's profile photo Former Member
      Former Member

      Useful document, easy to understand & good presentation, thanks for sharing Tobias.

      Thanks

      Sukant C

      Author's profile photo Tobias Reiner Dolgener
      Tobias Reiner Dolgener
      Blog Post Author

      Thank you for your positive feed-back! 🙂

      Author's profile photo Former Member
      Former Member

      Hi,

      It is one of the common error massage we use to get ,

      am very glad to know this information , very useful document.

      Thanks

      Yuvaraj

      Author's profile photo Former Member
      Former Member

      Hello Tobias,

      Useful document, nicely presented.

      Thank you,

      VNR

      Author's profile photo K Chowdary
      K Chowdary

      Hello Tobias,

      Is this analysis same for if we get the error in Delivery Document.Thanks in Advance

       

      Regards

      Krishna