cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve price of product using SalesPriceList BO

Former Member
0 Kudos

Hi All,

I have one requirement to display the price and total price of the product in the products work center of the Sales Lead TI screen.

My approach:

I have first created two extension fields in sdk,now i had written the code in the After-Modify-Event of the ItemProduct node, i tried to retrieve the price of the product using the

Query QueryByTypeCodeAndPropertyIDAndPropertyValue,But queryresult is empty.

Is this the correct approach to get the price details, if we have any other approach please Guide me.

if(this.Material.IsSet())
{


var tre = Material.Retrieve(this.ProductUUID);
// Initialization query to define Workcenter subview, e.g. PriceList
var initQuery = SalesPriceList.QueryByGroupCode;
var initSelParams = initQuery.CreateSelectionParams();
initSelParams.Add(initQuery.GroupCode.content, "I", "EQ","PLPRICE1");
var initQueryResult = initQuery.Execute(initSelParams);
//Query base price list
var query = SalesPriceList.QueryByTypeCodeAndPropertyIDAndPropertyValue;
var selParams = query.CreateSelectionParams();
 ////List type 7PL0 = Price inside a list
selParams.Add(query.TypeCode.content, "I", "EQ", "7PL0");
//// Released price list
selParams.Add(query.ReleaseStatusCode, "I", "EQ", "3" );
var pidi = this.ProductKey.ProductID.content;   
//// Base price list has no header fields (= PropertyValuation), but four item fields (= PriceSpecificationPropertyValuation1-4)"
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID"); 
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyValue.ID.content, "I","EQ",pidi);
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID_TYPE_CODE");
//// 1 Means ID ( technical purpose )
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyValue.ID.content, "I","EQ","1");
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_TYPE_CODE");
//// 1 Means Material ( technical Purpose ) , 2 means service product
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyValue.ID.content, "I","EQ","1");
//selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation4.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "PRC_PRICE_LIST");
// The query should return only one price list (due to defined query parameters)!
var queryResult = query.Execute(selParams);
//
if(queryResult.Count() >0)
{
var  amo = queryResult.PriceSpecification.GetFirst().Amount;
}
<br>

Thanks,

Pranith

Accepted Solutions (0)

Answers (1)

Answers (1)

andy_blankley
Participant
0 Kudos

Hello Pranith,

If your question is still not answered, please see another query like this that explains exactly how to achieve your requirements.

Link: https://answers.sap.com/questions/357926/how-to-query-discountlist-on-overall-customer-disc.html

Please check and mark this answered as correct. 😄

Thank you,

Andy Blankley