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!

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. yuvaraj v

    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

    (0) 

Leave a Reply