cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Read offline Prices in SAP C4C

0 Kudos

Hi Folks,

I have a requirement in which I have to read offline pricing data that is available in prices view of product work center in C4C. I use Sales Price Specification BO to retrieve the data. There are two Query 1st is for initializing which is QueryByGroupCode and second is QueryByTypeCodeAndPropertyIDAndPropertyValue.

Initial query is returning correct config data for offline pricing but second query is not producing any records from the prices.

Below is screen shot of offline pricing that I have to read.

2. During debugging, I can see 1st query is giving result but when we execute the second one it is not giving any records. Below is the screen shot of debugging :-

I am using following code to get the data of Offline pricing.

Kindly suggest me how I will get data of offline pricing which i have mentioned in 1st screen shot.

import ABSL; import AP.FO.PriceAndTax.Global;
import AP.Common.GDT; 
var ID = "A112ATZ"; 
var priceList : BusinessObject::SalesPriceSpecification; 
var propertyValuation : BusinessObject::SalesPriceSpecification.PropertyValuation; 
//// Initialization query to define Workcenter subview,
var initQuery = SalesPriceSpecification.QueryByGroupCode; 
// offline pricing 
initSelParams.Add(initQuery.GroupCode.content, "I", "EQ","COD_PRICES"); 
var initQueryResult = initQuery.Execute(initSelParams); /
/// Query base price list 
var query = SalesPriceSpecification.QueryByTypeCodeAndPropertyIDAndPropertyValue; 
var sel = query.CreateSelectionParams(); sel.Add(query.TypeCode.content,"I","EQ","ZJPS"); sel.Add(query.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content,"I","EQ","CND_PRODUCT_ID"); //sel.Add(query.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyValue.ID.content, "I","EQ",ID); 
var Result = query.Execute(sel); if(Result.GetFirst().IsSet()) 
{ 
}




0 Kudos

Hi Sunny,

Is this something you managed to resolve? I am also trying to query the same object but with no success.

Appreciated if you could share your working solution.

Thanks!

0 Kudos

Hi,

I resolved the issue long back . Apology for not updated in forum since long time.

while executing query I was unable to debug further as system does not allow me to do so pull me out from debugging, So I tried to add a code and raised a message so that I can check whether further line of code after result = query.Execute(sel);. is being executed or not.

I was right and system is raising messages so it is executed but I was unable to debug up to that point.

I have to update custom field on product master and this particular code is written in action of product Extension.

I wrote below code and update custom fields.

if (Result.Count() > 0)

{

foreach (var priceList in Result)

{ foreach (var price in priceList.PriceSpecification)

{ foreach (var _valuation in price.PropertyValuation)

{

if (_valuation.PriceSpecificationElementPropertyValuation.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content == "CND_PRODUCT_ID" && _valuation.PriceSpecificationElementPropertyValuation.PriceSpecificationElementPropertyValue.ID.content == this.ZProduct_Clinic.content.RemoveLeadingZeros())

{ this.customefield = price.Amount;

this.customfield.currencyCode = price.Amount.currencyCode;

break;

}

}

}

}

}

Hope this will help other people also.

Regards,

Sunny

View Entire Topic
0 Kudos

Hi Sunny,

I have similar requirement and I am struggling with this query, could you help me out on you resolved this issue?

Thanks in advance.

Rocky