是否可以使用SAP B1的DI SDK访问PPSONE数据?

本文关键字:访问 SDK PPSONE 数据 DI 可以使 SAP B1 是否 | 更新日期: 2023-09-27 18:08:31

我尝试编写一个软件,以便生产人员可以轻松确认物料项目。现在我想按键取生产订单,它找不到PO。如果我和商业伙伴做同样的事情,就会奏效。SAP B1我们使用的是PPS One插件,有问题吗?是否不可能从这个插件访问数据,或者我要改变什么?

SAPbobsCOM.BusinessPartners vBP = connection.company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
SAPbobsCOM.ProductionOrders vPO = connection.company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders);
if(vBP.GetByKey("L22437"))
{
  WriteLogLine("Name: " + vBP.CardName); // Works, i get the Name!
}
else { WriteLogLine("No matching customer record was found!");  }
if (vPO.GetByKey(anyKey)) // tried a lot of keys, no one worked
{
  WriteLogLine(vPO.GetAsXML());
}
else { WriteLogLine("No matching production order record was found!"); }

还有一件奇怪的事情,在SAP GUI中po显示为工作订单,但数据库中相应的表是@PPSONE_PRDORDERS。但如果我从SAPbobsCOM更改,它也不起作用。ProductionOrders到SAPbobsCOM.WorkOrders.

是否可以使用SAP B1的DI SDK访问PPSONE数据?

如果我理解的话,无论插件做什么,如果至少它在PO表中创建了一个记录,如果你想找到PO的记录,你必须查询OWOR表,在PO的GeyByKey方法中使用的字段是OWOR.DocEntry。

如果这是一个没有Object的UserTable,你可以使用对象UserTable

UserTable oUst = (UserTable)oCompany.UserTables.Item(YOURTABLE);
if oUst.GetByKey("1") ....

如果它是一个带有Object的UserTable,你必须查找GenericServices

Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As SAPbobsCOM.GeneralData
Dim oGeneralParams As SAPbobsCOM.GeneralDataParams
Dim sCmp As SAPbobsCOM.CompanyService
sCmp = oCompany.GetCompanyService
'Get a handle to the SM_MOR UDO
oGeneralService = sCmp.GetGeneralService("SM_MOR")
'Get UDO record
oGeneralParams =    oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)
oGeneralParams.SetProperty("DocEntry", "2")
oGeneralData = oGeneralService.GetByParams(oGeneralParams)

你可以使用PPS One的SDK。参考:C:'Program Files'SAP'SAP Business One'AddOns'PPSOne'PPSOne'X64Client'PPSOne_PPSOneSDK.dll。我不测试它