cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPQ Quote 2.0: Custom calculation is not working for a custom cart item field.

Alexander_0001
Participant
0 Kudos
567

Dear SAP Community experts,
I have another interesting riddle. I tried to realize this documentation. I have added a custom item field to the product items table of my quote (Quote Item Status):

Now I want to add a custom calculation to this custom item field to change the value in it with Python Script:

Unfortunately even the simplest code doesn't have even any impact:

Why is this not working? Is there something wrong with the code or did I missed something for the configuration?

In the first place I just want to set the custom item field "QuoteItemStatus" to "1" just to check if I can manipulate this field with custom calculation.

On top on this I want to manipulate the custom item field "QuoteItemStatus" with an if function:
e.g.:

If the Discount of the Item is greater than [Value from a custom Table]:<br>    Set the "QuoteItemStatus" = "To be checked"<br>else:<br>    Set the "QuoteItemStatus" = "All fine!"

I just would like to know why the "Quote Item Status" doesn't change even when I just set it to 1.
This would already help me.

Look forward to your ideas! 🙂

Kind regards
Alexander

Accepted Solutions (0)

Answers (1)

Answers (1)

yogananda
Product and Topic Expert
Product and Topic Expert

alexander-maerz

you should calculate through this way..

item["QuoteItemStatus"] = 100
Alexander_0001
Participant
0 Kudos

Hi Yogananda,
I have tested your code snipped within the custom calculation for my custom item field:

Unfortunately it was not successful:



Do you have another idea, how I could add information into this custom item field with scripting logic?

Kind regards,
Alexander

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos

alexander-maerz
It won't work if you have space. your Itemcustomfield doesn't have space in between. you can copy my above code and try it.

Alexander_0001
Participant
0 Kudos

yoganandamuthaiah
I have tested it.:


It was not successful.

Also a more simple version was not successful: