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: 

Issue with the VOFM Pricing routine

Former Member
0 Kudos

Hi Experts,

I have developed a VOFM Pricing routine to apply specific condition type related to the Deals & Promotions. I have an issue as per the below scenario.

The deal is activated based on the Materials in the Sales Order. If a Customer already receives it then from the next order he will not be getting the deal.

For example in a order if I have 2 items (Say 10 & 20) in which if Item 10 has not received the deal then my routine is getting is triggered and the condition type is getting determined and working fine and if Item 20 has received the deal then my routine is returning SY-SUBRC = 4 and deal (Condition Type) is not getting applied to the items and this works fine.

But if I enter Item 20 as Item 10 (Not eligible for the deal) and Item 10 as Item 20 (Eligible for the deal) then in this case by routine RV61AXXX is not even triggering for Item 20. It is called for Item 10 and SY-SUBRC is set 4 and for the next it is not even calling the routine and this condition is not getting determined.

I have checked  USEREXIT_NEW_PRICING_VBKD and I set NEW_PRICING to 'C' and seems to be fine. Also revisited the V/06 setting for this pricing condition and I have "Item Condition" checked not Exclusions. But not sure why my routine is called only for the first item. If it is called for the first item and if the routine is falied then after it is not called for the remaining items.

Can anyone share the info like if I did a mistake in calling the routine or is this something I need to do to call the routine for every item in the Order even it fails for one item.

Finally I need to make sure to check the routine for every item.

FYI..,

USEREXIT_NEW_PRICING_VBAP will be called only if we change the items.


Thanks & Regards,

Srinivas

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Resolved by myself.

After analyzing the the function module "PRICING" found that it determines all the pricing conditions from T683S table (Program LV61AA12). Using these entries it will determine all eligible pricing conditions by calling their pricing routines and their I realized that my routine was failing which I configured for our condition type. Due to this reason it is not even calling routine for any of the items.

So, I realized that if routine is called for overall Pricing condition types determination then it will call the subroutine KOBEV_XXX (Program LV61AA67) and if it called for individual items then it will execute the subroutine KOBED_XXX. By default when the routine RV61AXXX is generated it will program structure as below.

FORM KOBED_XXX.

My own condition type determination logic was here and is getting failed during the overall document processing.

SY-SUBRC = 0 or 4.

ENDFORM.

FORM KOBEV_XXX.

 

  no check for SY-SUBRC

  PERFORM KOBED_XXX.

ENDFORM.

And to avoid this I added SY-SUBRC = 0 and EXIT in subroutine KOBEV_XXX so that be default my condition type will get determined for the overall document.

FORM KOBEV_XXX.

 

  SY-SUBRC = 0.

  EXIT.

  PERFORM KOBED_XXX.

ENDFORM.

Thanks & Regards,

Srinivas

1 REPLY 1

Former Member
0 Kudos

Resolved by myself.

After analyzing the the function module "PRICING" found that it determines all the pricing conditions from T683S table (Program LV61AA12). Using these entries it will determine all eligible pricing conditions by calling their pricing routines and their I realized that my routine was failing which I configured for our condition type. Due to this reason it is not even calling routine for any of the items.

So, I realized that if routine is called for overall Pricing condition types determination then it will call the subroutine KOBEV_XXX (Program LV61AA67) and if it called for individual items then it will execute the subroutine KOBED_XXX. By default when the routine RV61AXXX is generated it will program structure as below.

FORM KOBED_XXX.

My own condition type determination logic was here and is getting failed during the overall document processing.

SY-SUBRC = 0 or 4.

ENDFORM.

FORM KOBEV_XXX.

 

  no check for SY-SUBRC

  PERFORM KOBED_XXX.

ENDFORM.

And to avoid this I added SY-SUBRC = 0 and EXIT in subroutine KOBEV_XXX so that be default my condition type will get determined for the overall document.

FORM KOBEV_XXX.

 

  SY-SUBRC = 0.

  EXIT.

  PERFORM KOBED_XXX.

ENDFORM.

Thanks & Regards,

Srinivas