2020-09-26 14:43发布
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
公共类AddBP_cls私有WithEvents SBO_Application作为SAPbouiCOM.Application
作为SAPbobsCOM.Company的私人公司
私人子SetApplication()
Dim SboGuiApi如SAPbouiCOM.SboGuiApi
将sConnectionString设置为字符串
SboGuiApi =新的SAPbouiCOM.SboGuiApi
sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
SboGuiApi.Connect(sConnectionString)
SBO_Application = SboGuiApi.GetApplication()
结束子
Public Sub New()
MyBase.New()
SetApplication()
AddBP()
结束
子私有函数SetConnectioncontext()为整数
昏暗的scookies作为字符串
昏暗的sconnectioncontext作为字符串
ocompany =新的SAPbobsCOM.Company
scookies = ocompany.GetContextCookie
sconnectioncontext = SBO_Application.Company.GetConnectionContext(scookies)
如果ocompany.Connected = True
然后ocompany.Disconnect()如果结束
SetConnectioncontext = ocompany.SetSboLoginContext(sconnectioncontext)
结束功能
私有函数ConnectToCompany()作为整数
ConnectToCompany = ocompany.Connected
私人子Class_initialize_Renamed()
如果Not ConnectToCompany()= 0,则
SBO_Application.MessageBox("无法连接到公司的数据库")
如果结束
如果Not SetConnectioncontext()= 0则
SBO_Application.MessageBox("无法连接到DI API")
私人子AddBP()
Dim bp作为SAPbobsCOM.BusinessPartners
Dim ocompany作为SAPbobsCOM.Company
ocompany = SBO_Application.Company.GetDICompany
bp = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
尝试
bp.CardCode =" C016"
bp.CardName =" C016"
bp.CardForeignName ="标记"
bp.GroupCode =" 100"
bp.CardType = SAPbobsCOM.BoCardTypes.cCustomer
bp.Addresses.AddressName =" N.P"
bp.Addresses.City ="孟买" bp.Addresses.Country ="印度"
'bp.Addresses.Nationality ="印度"
'bp.Addresses.State ="马哈拉施特拉邦"
'bp.Addresses.ZipCode =" 0231"
bp.Add()
例外捕获
MessageBox.Show(ex.Message)
结束尝试
结束类
这是我的程序
最多设置5个标签!
公共类AddBP_cls私有WithEvents SBO_Application作为SAPbouiCOM.Application
作为SAPbobsCOM.Company的私人公司
私人子SetApplication()
Dim SboGuiApi如SAPbouiCOM.SboGuiApi
将sConnectionString设置为字符串
SboGuiApi =新的SAPbouiCOM.SboGuiApi
sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
SboGuiApi.Connect(sConnectionString)
SBO_Application = SboGuiApi.GetApplication()
结束子
Public Sub New()
MyBase.New()
SetApplication()
AddBP()
结束
子私有函数SetConnectioncontext()为整数
昏暗的scookies作为字符串
昏暗的sconnectioncontext作为字符串
ocompany =新的SAPbobsCOM.Company
scookies = ocompany.GetContextCookie
sconnectioncontext = SBO_Application.Company.GetConnectionContext(scookies)
如果ocompany.Connected = True
然后ocompany.Disconnect()如果结束
SetConnectioncontext = ocompany.SetSboLoginContext(sconnectioncontext)
结束功能
私有函数ConnectToCompany()作为整数
ConnectToCompany = ocompany.Connected
结束功能
私人子Class_initialize_Renamed()
如果Not ConnectToCompany()= 0,则
SBO_Application.MessageBox("无法连接到公司的数据库")
如果结束
如果Not SetConnectioncontext()= 0则
SBO_Application.MessageBox("无法连接到DI API")
如果结束
结束子
私人子AddBP()
Dim bp作为SAPbobsCOM.BusinessPartners
Dim ocompany作为SAPbobsCOM.Company
ocompany = SBO_Application.Company.GetDICompany
bp = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
尝试
bp.CardCode =" C016"
bp.CardName =" C016"
bp.CardForeignName ="标记"
bp.GroupCode =" 100"
bp.CardType = SAPbobsCOM.BoCardTypes.cCustomer
bp.Addresses.AddressName =" N.P"
bp.Addresses.City ="孟买" bp.Addresses.Country ="印度"
'bp.Addresses.Nationality ="印度"
'bp.Addresses.State ="马哈拉施特拉邦"
'bp.Addresses.ZipCode =" 0231"
bp.Add()
例外捕获
MessageBox.Show(ex.Message)
结束尝试
结束
结束类
这是我的程序
一周热门 更多>