cancel
Showing results for 
Search instead for 
Did you mean: 

sap cpq script inside of the quote in product how to modify the custom column?

pepeverdu
Explorer
0 Kudos
482

Hello everybody,

I am trying to do script to modify the value of custom columns that have been add "Unit Price 500"... How can I change the value of this columns?

Thanks in advance,

José Verdú Cano

LukaPilipovic
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jose! Providing a bit more context would be helpful for community members. Most likely what you need is calculation but ... do you use quote 1.0 or quote 2.0? on which particular event you want to calculate those/ how those columns are to be used / what is actual business requirement?

Accepted Solutions (0)

Answers (1)

Answers (1)

pepeverdu
Explorer
0 Kudos

hello,

Thanks for replying. Sorry if i didnt explain myself well. I am new with cpq. its for quote 1.0. When it's add to the quote.

The problem was that the name of the column I created (unit price 500) have to be the same name in the script that's why I wasn't able to access the variable.

Here is the solution I have found:

for it in Quote.MainItems:
	total_amount=it.ExtendedAmount
	it.UnitPrice500.Value = 500 * 0.95 * total_amount
	it.UnitPrice800.Value = 800 * 0.9 * total_amount
	it.UnitPrice1000.Value = 1000 * 0.85 * total_amount