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: 

Best SD userexit to use for checking 'material pricing conditions' (KOMV-KSCHL)?

former_member195355
Participant
0 Kudos

Hiya,

When creating a sales document I'd like to check the material pricing conditions (KOMV-KSCHL), specifically for rate(KBETR), when a material is entered into an order.

If the Rate value is not as expected then I'd like to raise a pop-up to inform the user.

I was searching for a userexit to use and I can't find anything that fits my requirement...

I was therefore thinking of using USEREXIT_PRICING_PREPARE_TKOMP or USEREXIT_PRICING_PREPARE_TKOMK.

But I thought I'd just check with you experts first.

Would anyone have any suggestions?

Thanks in advance!

1 ACCEPTED SOLUTION

Jelena
Active Contributor
0 Kudos

The ...PREPARE... user exits are meant to manipulate pricing determination, so normally (as name suggests) they're called before pricing is carried out (although Vijay has a good point that some user exits are triggered multiple times).

We have a minimum order value checked programmed in the good old ...SAVE_PREPARE... user exit, but it was done many years ago. If you're on EHP6 and higher there may be new BADIs available. Also check for the enhancement points rather than old-fashioned user exits.

However I also wonder why does this require ABAP? Just maintain the pricing condition records correctly and then there should not be anything "unexpected". Looks suspiciously like an ABAP "band aid" on a process/configuration issue...

6 REPLIES 6

vijayanandpaul_puvvula3
Active Participant
0 Kudos


Hello Robert,

I would suggest using 'USEREXIT_PRICING_PREPARE_TKOMP' which is for Item level fields. However, why would the rate be not as expected, is there a limit that you want to set ?

Also its worth noting that these user-exits get triggered 3-4 times every change is made. You may want to restrict that.

Another option is to set a flag in a requirement routine for the condition type and use it to send a pop up in User-Exit.

Rgds,

Vijay.

Jelena
Active Contributor
0 Kudos

The ...PREPARE... user exits are meant to manipulate pricing determination, so normally (as name suggests) they're called before pricing is carried out (although Vijay has a good point that some user exits are triggered multiple times).

We have a minimum order value checked programmed in the good old ...SAVE_PREPARE... user exit, but it was done many years ago. If you're on EHP6 and higher there may be new BADIs available. Also check for the enhancement points rather than old-fashioned user exits.

However I also wonder why does this require ABAP? Just maintain the pricing condition records correctly and then there should not be anything "unexpected". Looks suspiciously like an ABAP "band aid" on a process/configuration issue...

0 Kudos

Haha,

I feel honored to have a reply from Jelena - you're one of my favorite contributors on SCN!

You're always so funny and I catch myself nodding in agreement whenever you post comments or write a blog.

Great idea about checking for enhancements or BADIs. I think there must be a way to find them that is easier than debugging - I'll have a search on the interweb, that question must have been asked before.

And you're right I think this is an ABAP band aid - it's just that sometimes that's easier, and more robust, than hoping certain users will behave themselves.

Thanks again!

Jelena
Active Contributor
0 Kudos

Aaawww, thank you!

Yes, there are already posts on SCN how to find BADIs or enhancement points as well as the whole bunch of posts on SD user exits (many of which are nonsense, unfortunately). There was a blog on new BADIs in SD but from a quick glance I don't see anything suitable for pricing verification. This is probably because it's rather unusual requirement.

I'm still a bit fuzzy on the business purpose though - what exactly are you checking the conditions for? Having trouble imagining a valid business scenario for this...

Former Member
0 Kudos

Hi Robert,

Did you mean that the rate should not go below a certain percentage from your margin. In the pricing procedure  configuration (T.Code:V/08). under Calculation Type, there is cost dialogue.

I am not sure whether this fill your requirement. It can inform the user when the rate go below a certain  percentage.

Regards,

Nigil Wilson

0 Kudos

Hi Nigil,

Sorry for not being clear - I'd like to check the rate between two pricing conditions.

If they don't match then I'd like the pop-up to appear.

Thanks.