查询在采购价格规范中不起作用

2020-08-23 15:57发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)专家们, 我想使用absl覆...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


专家们,

我想使用absl覆盖采购订单的价格来获取产品组合的标价数据。

我认为标价的BO是" ProcurementPriceSpecification"。

在报告中,我通过使用查询" QueryByTypeCodeAndPropertyIDAndPropertyValue"执行数据。

尽管我添加了正确的参数,但结果为零。

我使用一些代码来查询" ProcurementPriceSpecification" BO。

结果也为零。 所以,我跟踪我的代码,我得到了错误

"(PRC_PROCUREMENT_PS,ROOT)发生技术错误(无业务配置要处理请求):PRC_ESF_CND_MAINT109。报告事件。"

我还参考了"按产品ID查询采购价格规格"的讨论。

我尝试使用以下代码执行此操作:

导入ABSL;

导入AP.FO.PriceAndTax.Global;

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

if(this.ItemProduct.IsSet()){

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

if(!prodID.IsInitial()){

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

var provider = 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",供应商);

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){

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;

}

}

}

}

最好的问候

Phyo

7条回答
追夢秋陽
2020-08-23 16:39

嗨,

 var priceList:BusinessObject :: ProcurementPriceSpecification;
 var propertyValuation:BusinessObject :: ProcurementPriceSpecification.PropertyValuation;
/*
//Bin mir nicht sicher ob dise Init Querybenötigtwird
//初始化查询以定义Workcenter子视图,例如 价目单价目表
 var initQuery = ProcurementPriceSpecification.QueryByGroupCode;
 var initSelParams = initQuery.CreateSelectionParams();
 initSelParams.Add(ini​​tQuery.GroupCode.content," I"," EQ"," SRM_PPS");
 var initQueryResult = initQuery.Execute(initSelParams);
 */
//从采购价格表中获取采购价格
 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); //插入产品编号
 params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content," I"," EQ"," CND_SUPPL_ID");
 params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyValue.ID.content," I"," EQ",SupplierId); //插入供应商ID
 
 params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content," I"," EQ"," CND_PRODUCT_TYPE_CODE");
 params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyValue.ID.content," I"," EQ"," 1"); //必填技术领域(1代表材料)
 params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation4.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content," I"," EQ"," CND_PRODUCT_ID_TYPE_CODE");
 params.Add(priceSpecQuery.PropertyValuationPriceSpecificationElementPropertyValuation4.PriceSpecificationElementPropertyValue.ID.content," I"," EQ"," 1"); //强制性技术领域
 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");
//搜索当前有效日期
 params.Add(priceSpecQuery.ValidityPeriod.StartTimePoint.Date," I"," LE",Context.GetCurrentUserDate()); //当前日期
 params.Add(priceSpecQuery.ValidityPeriod.StartTimePoint.TypeCode," I"," EQ"," 1"); //强制性技术领域
 params.Add(priceSpecQuery.ValidityPeriod.EndTimePoint.Date," I"," GE",Context.GetCurrentUserDate()); //当前日期
 params.Add(priceSpecQuery.ValidityPeriod.EndTimePoint.TypeCode," I"," EQ"," 1"); //强制性技术领域
 params.Add(priceSpecQuery.Status.ConsistencyStatusCode," I"," EQ"," 3");
 params.Add(priceSpecQuery.Status.ReleaseStatusCode," I"," EQ"," 3");
//01PP =>标价
 params.Add(priceSpecQuery.TypeCode.content," I"," EQ"," 01PP");
 var结果= priceSpecQuery.Execute(params);
 

一周热门 更多>