cancel
Showing results for 
Search instead for 
Did you mean: 

Query does not work in Procurement Price Specification

former_member275924
Active Participant
0 Kudos

Hi experts ,

I want to get the data of List Price of Product Portfolio using absl to overwrite the price of purchase order .

I thinks the BO of List Price is "ProcurementPriceSpecification" .

In reporsitory , I execute the data by using query "QueryByTypeCodeAndPropertyIDAndPropertyValue" .

Although I add right paramter , the result was zero .

I use some code to query "ProcurementPriceSpecification" BO.

The result also zero . So, I trace my code , I am getting the error

" (PRC_PROCUREMENT_PS, ROOT) A technical error (No business configuration to process request) occurred: PRC_ESF_CND_MAINT 109. Report an incident."

I also reference the discussion "Query Procurement Price Specification by Product ID".

I tried to do this with this code:

import ABSL;

import AP.FO.PriceAndTax.Global;

////////////////

if(this.ItemProduct.IsSet()){

   var prodID = this.ItemProduct.ProductKey.ProductID.content;

   if(!prodID.IsInitial()){

  

   var TestDate = Date.ParseFromString("20160605");

   var supplier  = this.ToParent.SellerParty.Party.Key.PartyID.content;

   var prd_cat = this.ItemProduct.ProductCategory.InternalID;

   if(!TestDate.IsInitial()){

   var priceSpecQuery = ProcurementPriceSpecification.QueryByTypeCodeAndPropertyIDAndPropertyValue;

   var params = priceSpecQuery.CreateSelectionParams();

   params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", prodID);

   params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", supplier);

   params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ",prd_cat);

   params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID");

   params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_SUPPL_ID");

   params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRD_CAT_ID");

   params.Add(priceSpecQuery.Status.ConsistencyStatusCode, "I", "EQ", "3");

   params.Add(priceSpecQuery.Status.ReleaseStatusCode , "I", "EQ", "3");

   var result = priceSpecQuery.Execute(params);

   foreach(var inst in result){

   this.ListUnitPrice.Amount.content = inst.Amount.content;

   this.ListUnitPrice.Amount.currencyCode = inst.Amount.currencyCode;

   this.ListUnitPrice.BaseQuantity.content = inst.BaseQuantity.content;

   this.ListUnitPrice.BaseQuantityTypeCode.content = inst.BaseQuantityTypeCode.content;

   }

   }

   }

}

Best Regards,

Phyo

Accepted Solutions (0)

Answers (5)

Answers (5)

dominik_g
Participant

Hi there,

var priceList : BusinessObject::ProcurementPriceSpecification;
var propertyValuation : BusinessObject::ProcurementPriceSpecification.PropertyValuation;
/*
//Bin mir nicht sicher ob dise Init Query benötigt wird
// Initialization query to define Workcenter subview, e.g. PriceList
var initQuery = ProcurementPriceSpecification.QueryByGroupCode;
var initSelParams = initQuery.CreateSelectionParams();
initSelParams.Add(initQuery.GroupCode.content, "I", "EQ", "SRM_PPS");
var initQueryResult = initQuery.Execute(initSelParams);
*/
//Fetch Purchase Price from Procuremend price List
var priceSpecQuery = ProcurementPriceSpecification.QueryByTypeCodeAndPropertyIDAndPropertyValue;
var params = priceSpecQuery.CreateSelectionParams();
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID");
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", productID); //INSERT PRODUCT NUMBER
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_SUPPL_ID");
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", supplierId); //INSERT supplier ID
 
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_TYPE_CODE");
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", "1"); //mandatory technical field ( 1 represents Material )
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation4.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID_TYPE_CODE");
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation4.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", "1"); //mandatory technical field
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation5.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRD_CAT_ID");
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation6.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRD_CAT_HIER_ID");
params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation7.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_COMPANY_ID");
//search for current validity date
params.Add(priceSpecQuery.ValidityPeriod.StartTimePoint.Date, "I", "LE", Context.GetCurrentUserDate()); // Current Date
params.Add(priceSpecQuery.ValidityPeriod.StartTimePoint.TypeCode, "I", "EQ", "1"); //mandatory technical field
params.Add(priceSpecQuery.ValidityPeriod.EndTimePoint.Date, "I", "GE", Context.GetCurrentUserDate()); // Current Date
params.Add(priceSpecQuery.ValidityPeriod.EndTimePoint.TypeCode, "I", "EQ", "1"); //mandatory technical field
params.Add(priceSpecQuery.Status.ConsistencyStatusCode, "I", "EQ", "3");
params.Add(priceSpecQuery.Status.ReleaseStatusCode, "I", "EQ", "3");
//01PP => List Price
params.Add(priceSpecQuery.TypeCode.content, "I", "EQ", "01PP");
var result = priceSpecQuery.Execute(params);
óespinar
Participant

This code works perfectly.

Thanks!

planteksz
Explorer
This is exactly what I needed! This code works perfectly, thank you so much. I tried doing it with only half of these parameters but all of these had to be added.
dominik_g
Participant
0 Kudos
I'm glad that the post helped you even though that it is so old :):)
arunml
Advisor
Advisor
0 Kudos

Hi Charm,

The list price BO is Procurement Price Specification.

You can use webservice - NameManageProcurementPriceSpecificationIn to update the list prices.

You can find the sample payload in Application and User Management -> Service Explorer view -> List Price -> Click on the link button.

Best Regards,
Arun

d_weinberg
Participant
0 Kudos

Hi,

I am having the exact same issue. PriceMasterDataManagement is definitely in scope. I even get data if I execute the query without selection paramerters. Only with selection parameters I am not getting any result. Any idea what I am missing?

My query looks pretty much the same as the one stated earlier.

Regards,

Daniel

former_member186648
Active Contributor
0 Kudos

Hi Pole,

You might be getting the error because PriceMasterDataManagement might not be scoped.


might

former_member275924
Active Participant
0 Kudos

Hello Pradeep ,

So , how can I solve the problem.

Best Regards,

Pole

former_member186648
Active Contributor
0 Kudos

Hi Pole,

Check if it is scoped in Business Configuration Workcentre, if not scope it.

Thanks, Pradeep.

Former Member
0 Kudos

Hello Pole,

Try to use the SalesPriceList.bo. If you click over it in the repository, there're examples explaining how to perform the query.

Best regards,

Alexandre.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Pole,

Did you have a look at

Maybe this helps you here too

Bye,

   Horst

former_member275924
Active Participant
0 Kudos

Hi Horst ,

I had a look at Query Procurement Price Specification by Product ID .

I also try the step of it but I can't .

Best Regards,

Pole

former_member275924
Active Participant
0 Kudos

Hello Alexandre ,


I tried to do this with this code that similar with SalesPriceList.bo :

But I can't


var prodID = this.ProductKey.ProductID.content;

  if(!prodID.IsInitial()){

  var supplier  = this.ToRoot.SellerParty.Party.Key.PartyID.content;

  var prd_cat = this.ProductCategory.InternalID;

  var priceSpecQuery = ProcurementPriceSpecification.QueryByTypeCodeAndPropertyIDAndPropertyValue;

  var params = priceSpecQuery.CreateSelectionParams();

  params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID");

  params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", prodID);

  params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_SUPPL_ID");

  params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", supplier);

  params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRD_CAT_ID");

  params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ",prd_cat);

  //params.Add(priceSpecQuery.Status.ConsistencyStatusCode, "I", "EQ", "3");

  //params.Add(priceSpecQuery.Status.ReleaseStatusCode , "I", "EQ", "3");

  var result = priceSpecQuery.Execute(params);

  foreach(var inst in result){

  this.ToParent.ListUnitPrice.Amount.content = inst.Amount.content;

  this.ToParent.ListUnitPrice.Amount.currencyCode = inst.Amount.currencyCode;

  this.ToParent.ListUnitPrice.BaseQuantity.content = inst.BaseQuantity.content;

  this.ToParent.ListUnitPrice.BaseQuantityTypeCode.content = inst.BaseQuantityTypeCode.content;

}

  }