B1 SDK:基本引用编号无法正常工作

2020-09-13 07:46发布

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

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


我当前正在制作一个引用AP良好收据订单项的附件来创建AP发票。

下面是我必须添加前5个订单项的代码

 oAP_Inv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

 oAP_Inv.CardCode = cardCode
 oAP_Inv.DocDate =" 2018-10-01"
 oAP_Inv.DocDueDate =" 2018-10-01"
 oAP_Inv.TaxDate =" 2018-10-01"
 oAP_Inv.NumAtCard =" 1515165"
 oAP_Inv.Comments ="通过William Grant"

 oAP_Inv.Lines.SetCurrentLine(0)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 0
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(1)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 1
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(2)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 2
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(3)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 3
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(4)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 4
 oAP_Inv.Lines.Add()

 如果retVal <> 0然后
 oCompany.GetLastError(retVal,retStr)
 MsgBox(retStr)
 万一
 

添加文档后,这就是GR收据的样子,其中我添加的5个订单项已关闭。

接下来,当我尝试使用以下代码添加上面第6行中显示的项目时,出现此错误

 oAP_Inv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

 oAP_Inv.CardCode = cardCode
 oAP_Inv.DocDate =" 2018-10-01"
 oAP_Inv.DocDueDate =" 2018-10-01"
 oAP_Inv.TaxDate =" 2018-10-01"
 oAP_Inv.NumAtCard =" 1515166"
 oAP_Inv.Comments ="通过William Grant"

 oAP_Inv.Lines.SetCurrentLine(0)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 5
 oAP_Inv.Lines.Add()

 如果retVal <> 0然后
 oCompany.GetLastError(retVal,retStr)
 MsgBox(retStr)
 万一

 

但是,如果我使用下面的代码,那么第6行将毫无问题地添加

 oAP_Inv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

 oAP_Inv.CardCode = cardCode
 oAP_Inv.DocDate =" 2018-10-01"
 oAP_Inv.DocDueDate =" 2018-10-01"
 oAP_Inv.TaxDate =" 2018-10-01"
 oAP_Inv.NumAtCard =" 1515166"
 oAP_Inv.Comments ="通过William Grant"

 oAP_Inv.Lines.SetCurrentLine(0)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 6
 oAP_Inv.Lines.Add()

 如果retVal <> 0然后
 oCompany.GetLastError(retVal,retStr)
 MsgBox(retStr)
 万一
 

您知道为什么我在添加第6行时遇到问题吗?

oAP_Inv.Lines.BaseLine = 5

似乎有些原因,当我想将基本参考编号用于"良好收据"时,索引就是其他原因。 这是我写的一个查询,用VisOrder查找行号

(3.9 kB)

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

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


我当前正在制作一个引用AP良好收据订单项的附件来创建AP发票。

下面是我必须添加前5个订单项的代码

 oAP_Inv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

 oAP_Inv.CardCode = cardCode
 oAP_Inv.DocDate =" 2018-10-01"
 oAP_Inv.DocDueDate =" 2018-10-01"
 oAP_Inv.TaxDate =" 2018-10-01"
 oAP_Inv.NumAtCard =" 1515165"
 oAP_Inv.Comments ="通过William Grant"

 oAP_Inv.Lines.SetCurrentLine(0)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 0
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(1)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 1
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(2)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 2
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(3)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 3
 oAP_Inv.Lines.Add()

 oAP_Inv.Lines.SetCurrentLine(4)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 4
 oAP_Inv.Lines.Add()

 如果retVal <> 0然后
 oCompany.GetLastError(retVal,retStr)
 MsgBox(retStr)
 万一
 

添加文档后,这就是GR收据的样子,其中我添加的5个订单项已关闭。

接下来,当我尝试使用以下代码添加上面第6行中显示的项目时,出现此错误

 oAP_Inv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

 oAP_Inv.CardCode = cardCode
 oAP_Inv.DocDate =" 2018-10-01"
 oAP_Inv.DocDueDate =" 2018-10-01"
 oAP_Inv.TaxDate =" 2018-10-01"
 oAP_Inv.NumAtCard =" 1515166"
 oAP_Inv.Comments ="通过William Grant"

 oAP_Inv.Lines.SetCurrentLine(0)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 5
 oAP_Inv.Lines.Add()

 如果retVal <> 0然后
 oCompany.GetLastError(retVal,retStr)
 MsgBox(retStr)
 万一

 

但是,如果我使用下面的代码,那么第6行将毫无问题地添加

 oAP_Inv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

 oAP_Inv.CardCode = cardCode
 oAP_Inv.DocDate =" 2018-10-01"
 oAP_Inv.DocDueDate =" 2018-10-01"
 oAP_Inv.TaxDate =" 2018-10-01"
 oAP_Inv.NumAtCard =" 1515166"
 oAP_Inv.Comments ="通过William Grant"

 oAP_Inv.Lines.SetCurrentLine(0)
 oAP_Inv.Lines.BaseType = 20'这是用于GR
 oAP_Inv.Lines.BaseEntry = grDocEntry
 oAP_Inv.Lines.BaseLine = 6
 oAP_Inv.Lines.Add()

 如果retVal <> 0然后
 oCompany.GetLastError(retVal,retStr)
 MsgBox(retStr)
 万一
 

您知道为什么我在添加第6行时遇到问题吗?

oAP_Inv.Lines.BaseLine = 5

似乎有些原因,当我想将基本参考编号用于"良好收据"时,索引就是其他原因。 这是我写的一个查询,用VisOrder查找行号

(3.9 kB)
付费偷看设置
发送
1条回答
shere_lin
1楼 · 2020-09-13 08:18.采纳回答

您可以忽略此信息。 我了解到问题是我需要使用数据库中的行号作为我要参考的收据,而不是VisOrder。

一周热门 更多>

点击此处---> EasySAP.com 一起学习S4 HANA ...

相关问答