cancel
Showing results for 
Search instead for 
Did you mean: 

Condition determination based on condition value

Former Member

Hello Gurus,

I am new to pricing conditions.

I have a requirement where, a pricing condition should be determined only if its condition value is greater than a certain number, say 'X'.

I cannot achieve this using a requirement routine because it is triggered before the condition value is calculated.

Is there a way i can manually determine the condition value and use in the routine? Or is there a user exit which i can use at a later stage to remove this pricing condition ? Please guide me.

Thank you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

moazzam_ali
Active Contributor
0 Kudos

Hi

Using routine you can validate the condition value. Let the system determine the condition value and after determination system should validate this value with your allowed value which you can maintain in some Z table or in some other condition type. If value is equal to or greater than allowed limit then ok if not then XKWERT = 0. This is easily understandable for your ABAPER that how to make condition value 0.

Try it with this and I am sure this should work for you.

Thank$

Former Member
0 Kudos

Hi Moazzam,

Thanks for your reply, but i don't want that condition displayed at all.

In  'userexit_save_document_prepare', i am able to access the condition value in XKOMV structure, how about deleting the condition from XKOMV if the requirement is not satisfied. Will that work?

moazzam_ali
Active Contributor
0 Kudos

Yes this can work but I you need to test this in detail as these kind of ABAP checks can disturb other processes as well. You can also try in pricing prepare userexits in MV45AFZZ and can delete this even before saving on pressing Enter button. I did this couple of years ago and it worked.

Please test this in detail with all possible negative and positive scenarios before transporting this in PRD.

Thank$

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi all,

Thanks for all your replies.

I did try with user exits and requirement routines, didnt quite work well.

So i went with creating a condition value routine, where if my condition did not match, i set the condition value to 0. The business was ok with this solution. So all good .

former_member182378
Active Contributor
0 Kudos

Rojer,

What is the condition class and calculation type of this condition type? Is this a discount, surcharge etc.?

As Moazzam suggested, you need to see in how many processes this business need is required, how many processes use the same pricing procedure or condition type? And make a list of the tests needed to be done. Also if your business is taking printouts, and there are some logic in the smartform which could impact, then you need to check these outputs (printout etc. etc.)

TW

0 Kudos

Hello.

Possible solution 1 Standar.

You shall try with maxim or minimus value in the customizing. I really don`t remember if this customizing is in the sequence access or in the condition type. Find it !

Only one maxim value.

Possible solution 2 New variable

Also use statistical condition type (For example ZSTA) and based in ZSTA, if ZSTA is present determine the original condition.(For example ZORI)

Customizing:

     1) Create a new variable like 1 true or 0 false in the ZORI access sequence

     2) By mean user-exit fill the new variable. MV45AFZZ.

How:

     if ZSTA appear in the procedure, then new variable = 1

Functionality:

     Create ZSTA with scales. If value > CONSTANT percent = 1%

     Create ZORIG with your own variables plus new variable. If new variable = 1.

Advantage of this:

     Flexibility, because you can change CONSTANT for every possible scenary, like maximum      values by sales office for example.

kyusufzai
Participant
0 Kudos

Hi Roger,

  You can achieve this by condition exclusion.

Create a statistical condition type and maintain the "X" value (Which is your requirement of minimum value)

Now create an exclusion between the new statistical condition and the existing condition type.

1. Create  Exclusion group .

2. Assign both Condition types to exclusion group.

3. Assign exclusion group to pricing procedure with condition exclusion procedure as" A   Best condition between condition types".

This will work.

Let me know if you have any question.

Thanks

Kashif

prashant_sharma21
Contributor
0 Kudos

Hello Kashif,

How it is possible through Condition exclusion ??

Condition exclusion offers best /least condition and just compare. It does not condition certain value of the condition type.

Thanks,

Prashant Sharma