cancel
Showing results for 
Search instead for 
Did you mean: 

calculation formula userexit not working for multiple condition types

Former Member
0 Kudos

Hi,

we have a problem in the CRM ISA-B2B scenario where the custom user exit is only working for single condition type.

but we need it for multiple condition types .

the value of the subtotal is not being retrieved for multiple conditions. at a time only one condition value is being retrieved and shown in the webshop - shopping basket.

for ex:

we have scenario 1 where Y001 -Freight condition type is applicable for one customer.and Y002 is applicable for another customer.

when we are trying to show the subtotal condition value in the webshop by using a single custom user exit in the pricing procedure it is only working for either of the above 2 customers depending on the VMC cache status.

is there any problem if use the single user exit for both condition types?

and if it needs to be differentiated how exactly we can do that with the same logic in the java class.

Thanks in advance,

PSR.

Accepted Solutions (1)

Accepted Solutions (1)

prashil
Advisor
Advisor
0 Kudos

Hi Sri,

Can it be possible to maintain a table where you can assign condition type for specific customer.

This will be very dynamic solution if you could do that.

You just need to match the condition type as per customer and fetch the according subtotal value which you can adapt in your abap code very easily.

Hope this will help.

Regards,

Prashil

Answers (2)

Answers (2)

Former Member
0 Kudos

Sri,

I think there is some mistake in your code...

"@'-this not a subtotal right?

You have to specify proper char value of the corresponding sub totoal.

for freight the standard subtotal is 4.

I think this may be the error ....

Thanks and Regards

shanto aloor

Former Member
0 Kudos

Hi shanto aloor,

Thanks for your response.

It is a custom condition type and the requirement is to only show the subtotal.

With the New Character instead of @ has solved the issue.

Now it works.

Thanks for all.

PSR.

Former Member
0 Kudos

Hi Sri,

Can you please post your java code here.

Regards,

Arshi

Former Member
0 Kudos

Hi Arshi,

below is the code:

public class ZValFormula_ZZWI1 extends ValueFormulaAdapter {

private static String zzwi = "ZZWI1";

private static char zzwiC = '@';

private static UserexitLogger userexitlogger = new UserexitLogger(

ZValFormula_ZZWI1.class);

public BigDecimal overwriteConditionValue(IPricingItemUserExit item,

IPricingConditionUserExit condition) {

ICurrencyValue val = condition.getConditionValue();

userexitlogger.writeLogDebug( "value saved for " + zzwi + " (" + zzwiC + ") = "

+ val.getValueAsString());

item.setSubtotal( zzwiC, val.getValue());

return val.getValue();

}

}

hope this would give more idea to look at the problem.

Thanks,

PSR

Former Member
0 Kudos

Hi Sri,

There seems to be no problem with this code and moreover its not condition specific from logic.

By any chance, is it possible that your custom routine is not assigned to other condition types for which

its not getting called.Can you please recheck this again.

Regards,

Arshi

Former Member
0 Kudos

Hi Arshi,

I have checked and it was already assigned to both the condition types. we have tested it no:of times and the logic is only working for one condition at a time.

any input would be welcome.

Thanks,

PSR