cancel
Showing results for 
Search instead for 
Did you mean: 

Different calculation types for one condition

0 Kudos

Dear all,

I'm trying to find out, if it's possible to have a condition (in our case freight condition ZKOP) set up with two different calculation types?

Definition of how it should be:

- If the order value is below a specific amout, ZKOP is xxx.xx EUR.

- If the order value is above a specific amount, ZKOP should be calculated as a percentage base of the order value.

Please can you let me know if it's possible and how?

Thanks in advance.

Andreas

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member182378
Active Contributor
0 Kudos

Andreas,

As you know Alternate Calculation type is a routine (piece of code). ABAPer can create the new routine with the required logic - 2 condition, depending upon the order value.

You have to give the logic (field names, table names e.g. order value etc. etc.) to the ABAPer.

This routine can be assigned to your freight condition type in the pricing procedure.

Former Member
0 Kudos

Hi Andreas,

Please Let me know if this freight condition type is manually entered in sales order based on net value or what?

Regards

S.Siva

0 Kudos

Hi Siva,

No, it's automatically calculated as soon as you enter a material having a sales price - as you said based on net value of the order.

Regards,

Andreas

Former Member
0 Kudos

Hi Andreas,

Why dont you look at the possibilities of entering the calculation type manually in the condition record level itself. If you maintain 2 scales for this frieght charge, Have the scales with different calcultion type by entering it manually as Manual entry is the priority over the calcualtion type coming from Condition type config.

With Regards

S.Siva

Lakshmipathi
Active Contributor
0 Kudos

Through standard  configuration, it is not possible.  You can try with either of the below user exits

  • USEREXIT_PRICING_PREPARE_TKOMP in the program MV45AFZZ
  • USEREXIT_NEW_PRICING_VBAP in program MV45AFZB

In fact, you cannot change the calculation type on case to case basis, instead, you apply the logic via coding.  Update here whatever be the outcome.

G. Lakshmipathi

former_member182378
Active Contributor
0 Kudos

Would it be more suitable to create a routine (Alt Cal type), rather than use an userexit?

Basically, the requirement is related to pricing (specific procedure and condition type) rather than document types.

Thanks!

TW

Lakshmipathi
Active Contributor
0 Kudos

TW Typewriter

For the requirement posted by OP, couple of options are there.  One option is what I suggested and the other option is what you were suggesting.  In both ways, it can be achieved.  Only difference in both the cases, as you would be aware is, in case, the logic is to be added via a routine, then Access Key is needed whereas, in case of exit, it is not required.

G. Lakshmipathi

0 Kudos

Hi TW,

You're absolutely correct!

It's not document type related, more as you said condition and pricing related.

What we basically want, is to implement the attached routine for freight cost calculation when we create an SD order

Regards,

Andreas

former_member182378
Active Contributor
0 Kudos

Andreas,

For this requirement, ABAPer has to create a table (exactly as created by you above).

In this table, user can input the freight values (fixed or percentage) against process (export / inland) and INCOTERMS.

The routine will inturn "call" this table, after "knowing" the order value and incoterms from the order.

Give the logic, table,field names to the ABAPer.

After the routine is created, you have to assign it to the freight cond type in the pricing procedure and activate it.

Next would be testing.

TW

former_member182378
Active Contributor
0 Kudos

Access Key is just a "formality" in the process. And is not difficult to get an access key to do this development. Please correct me if needed.

For this requirement, probably putting the code in a userexit is not the optimal way and can lead to system performance impact. Every time an order is create, the logic will go and check this userexit. But it might not be applicable for every order (or process).

Side comment: Just want to learn from your experience.

Thanks!

TW

Lakshmipathi
Active Contributor
0 Kudos

TW Typewriter

If the coding is not written correctly, it would definitely affect the system performance.  This is not only for user exit but also will be applicable to routines.  So it makes no difference. 

And is not difficult to get an access key to do this development

Not in all cases.  In some projects, getting an Access Key itself is very difficult and it undergoes cumbersome process from client side.  So we have to take a decision on case to case basis whether to go with routine or user exit.

G. Lakshmipathi