cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP CPQ - How to Select Custom Table - Syntax - Python on Developer - Custom Cart Calculations

samuelconceicao
Participant
0 Kudos
1,016

Hi Experts

I have a Custom Table, that i'm trying to get a spcifict value from it using The "Custom Cart Calculations" insite the Developer. (Iron Python)

So I have a Custom table "Z_Table"

Field_A, Field_B
A , 30

I need to get te Value 30 and I saw sSomething like this, but it doesnt works:

SqlHelper.GetList("SELECT Field_B FROM Z_Table WHERE Field_A = '{A}' ")

Do you know how to declare the right syntax to get the Field B??

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Yogananda
Product and Topic Expert
Product and Topic Expert
query=SqlHelper.GetList("select FIELD_B from Z_table WHERE FIELD_A='CTX TAG'")

hi samuelconceicao
you can run this in sql workbench and you will receive the result but you need to construct the CTX Tag according to your need.

samuelconceicao
Participant

Or how to use th syntax with the object from API Explorer

"Quote.ShipToCustomer.StateAbbreviation"

something like:

query=SqlHelper.GetList("select FIELD_B from Z_table WHERE FIELD_A='Quote.ShipToCustomer.StateAbbreviation'")

Thanks a lot
samuelconceicao
Participant

Hi Yogananda Muthaiah

Thanks for your answer, but I didint works to me when I trying to use CTX TAG, like:

query=SqlHelper.GetList("select FIELD_B from Z_table WHERE FIELD_A='<*CTX(Quote.Customer(ShipTo).StateAbbrev)*>'")

I pinted the value of my CTX <*CTX(Quote.Customer(ShipTo).StateAbbrev)*> in a custom field and It returns the value, but doesnt works in this query...