Author: Paul Trozan, Analyst
Are you hoping to take a value from quote tables to perform a calculation or to display it on another page in SAP CPQ? Pulling insights from quote tables on this platform will allow you to make data-driven decisions for your solution. The Canidium team has created this short step-by-step to help guide you through the process. Prefer to speak with a consultant? Click the button below.
In this example, the client had a separate quote tab that calculated commissions and they wanted to have it displayed on the main quote. Read this short process that breaks down how to pull information from quote tables in SAP CPQ, and also learn the correct syntax for the necessary script:
Begin by opening the tag builder in SAP CPQ.
Although there isn’t much documentation for this tag, there are clues when you first insert this tag via the tag builder. It looks like this:
|<* GetFirstFromQuoteTable( QuoteTableName, ResultColumn, Condition, SortBy ) *>|
Next, fill in the following fields:
- QuoteTableName: This is the name of the quote table. Easy
- ResultColumn: Name of the column. Note that this is the Column Name, and not necessarily the label/title that is displayed. (see image below)
- Condition: Name of a column, and then a condition that you want to place on it. For this example, it would look something like this:
|Estimated_Commission_Totals = '<b>Eligible Services</b>'|
That will search the Estimated_Commission_Totals column for the row that contains the string '<b>Eligible Services</b>'
- SortBy: You may not need to use this parameter, and it’s okay to leave it out. That is the case for this example.
For example, this is how the tag should look when the fields are filled:
|<* GetFirstFromQuoteTable( Compensation, Estimated_Commission, Estimated_Commission_Totals = '<b>Eligible Services</b>') *>|
Using an IronPython Script
We can use a similar process in the script workbench:
for row in Quote.QuoteTables["
value = Quote.QuoteTables["
if value = '<b>Eligible Services</b>':
index = row.IndexOf()
test = Quote.QuoteTables["
The for-loop above, does a search through each row to find the index of the value you're looking for. Let's break down the last line of the code. It does the following:
- Selects the Compensation quote table from the Quote object.
- It selects the row that contains '<b>Eligible Services</b>' service, based off of a numeric index.
- It pulls the value from the desired column, which in this case is ‘Estimated_Commission’
Pulling information from quote tables will improve your solution and help you get the most out of SAP CPQ whether you use an IronPython Script or the tag builder in SAP CPQ. Do you want more thought leadership surrounding SAP CPQ? Follow our blog to learn more and or reach out for your free consultation!
Happy plan building!
Want to receive more thought leadership? Opt-In to our newsletter below!