cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Condition Type VPRS in Correct Invoice Ret Document

former_member219259
Participant
0 Kudos

Hi,

An Correction Invoice Ret document (Document Type RK and SD Document Cateogry K) is created w.r.t. to the Invoice.

I am creating the document through VA01 giving refernce document as the invoice.

For calculating VPRS a routine is present (in my case a customized one 906) which fails due to SD document category being a K, then VPRS comes into pricing since it was present in Invoice and hence it has been copied from Invoice to Correction Invoice Ret.

Now the problem is when i change the pricing date in the document or carry out a new pricing.

As soon as i carry out a new pricing, VPRS disappears.

No VPRS now.

Now i dont VPRS to be copied from Material (no change in 906 routine), it was rightly copied from Invoice to the document. But i want VPRS to remain even if i carry out a new pricing.

How to resolve the issue?

Thanks and Regards,

Aayush Jain

SAP SD Consultant

Accepted Solutions (1)

Accepted Solutions (1)

amit_tunara
Active Contributor
0 Kudos

Hi Aayush,

The condition type VPRS belongs to condition category G which is internal price. When you re-calculate the pricing, please check whether your pricing procedure has any other condition type of this category. If yes, then VPRS will not be calculated.

Also make sure when re-calculating the price, the items should have a plant assigned.

Do these two checks and update the thread with your findings.

Regards,

Amit

former_member219259
Participant
0 Kudos

Hi Amit,

There is no other Condition type belonging to condition category G.

Also Plant is present in the Item.

Regards,

Aayush

amit_tunara
Active Contributor
0 Kudos

Hi Aayush,

Can you please let us know what logic is mentioned in routine 906 for VPRS?

In that routine, you can put a logic not to re-determine the cost if the value of VPRS is already a non-zero.

This logic will prevent re-determination as the VPRS is already populated from preceding document.

Regards,

Amit

former_member219259
Participant
0 Kudos

Hi Amit,

I know that changing the logic of Routine with the help of ABAP maybe a solution.

But i am looking for the reason as of why VPRS is not picked when redetermining of pricing.

Also this is the logic where 906 routine is failing. 

CHECK: KOMK-VBTYP NA 'KL'. "no debit/credit memo requests

* K: credit memo request

* L: debit memo request

Regards,
Aayush Jain

amit_tunara
Active Contributor
0 Kudos

Hi Aayush,

In your question, you have mentioned about document category K for your document type RK. Now in your routine you are checking for document categories K and L. Since the category for RK is also K, your CHECK statement in routine 906 is failing. Might be because of this your condition is not populated.

I would suggest to check document type (KOMK-BLART) instead of document category in the routine. So your modified routine will go like this.

...

CHECK KOMK-BLART NE CR   (Document is not Credit Memo request)

CHECK KOMK-BLART NE DR   (Document is not Debit Memo request)

....

So with this change, it will not populate VPRS, but for rest it will.

I hope this will help.

Regards,

Amit

former_member219259
Participant
0 Kudos

Hi Amit,

Thanks for looking in the issue.

The root cause has been found.

Firstly SAP checks the routine 906 which fails due to document category being as K. Then since RK is created from Invoice where VPRS is present, with the help of SAP standard functionality of copying pricing elements, it copies VPRS from the Invoice to RK document

Now when we carry out a new pricing in VA02 mode, again it goes into 906 routine and fails and this time there is no proceeding document from which the value could have been copied. Hence VPRS disappears.

Solution:

We cannot implement the code suggested by you because we have like 20-30 documents whose document category is K and same way number of documents having document category as L.

So the earlier code will be in place:

CHECK: KOMK-VBTYP NA 'KL'. "no debit/credit memo requests

* K: credit memo request

* L: debit memo request

But instead we are planning to add a piece of code before it as below to skip this check in case of "RK"

IF KOMK-AUART_SD NE 'RK'

CHECK: KOMK-VBTYP NA 'KL'

Most likely this solution is going to work.

I will keep this thread updated.

Regards,

Aayush Jain

SAP SD Consultant

amit_tunara
Active Contributor
0 Kudos

Hi Aayush,

Yes, instead of keeping the document type for CMR and DMR, we can just bypass the document type RK as you mentioned. I also feel that this will work.

Good that the root cause has been found and something workable is concluded.

Let us know once it is done with results.

Regards,

Amit

Answers (1)

Answers (1)

former_member182378
Active Contributor
0 Kudos

AAYUSH,

Probably a solution would be to include Sales document category = K, in your routine 906, so that cost (VPRS) is calculated in Invoice correction request too.

Questions -

1. For credit memo request the sales document category K, does that mean you shall face the same issue when creating CMR by referencing a billing document?

2. Why this routine did not include TVAK-VBTYP = K?

former_member219259
Participant
0 Kudos

Hi TW,

Business requirement is that they dont want to Calculate VPRS for Credit memo requests and hence it is added in the routine.

And yes, the VPRS disappearing will happen in case of CMR wrt billing document as well but it will not create a problem in that case.

Why it is problem in Invoice Correction is becasue there will be 2 line items for the same material, one + and one - , Now Since nothing can be changes in the + line item, so VPRS will be there in conditions but while repricing it is disappearing from the - line item. Hence it is creating a mismatch in the GL Accounting Level.

I am just looking for the reason that why VPRS was not redetermined in the pricing.

Regards,

Aayush Jain