sample code:
Dim iData As Integer
Dim nField As Integer
Dim nData As Integer
Dim Result As Boolean
Dim vRow As Variant
MsgBox "Execution Start"
Set R3 = CreateObject("SAP.Functions")
R3.Connection.System = "XXX" '此处为系统标示
R3.Connection.SystemNumber = "XX" '系统编号
R3.Connection.client = "500"
R3.Connection.User = "ID"
R3.Connection.Password = "PWD"
R3.Connection.Language = "EN"
R3.Connection.ApplicationServer = "hostname"
If R3.Connection.logon(0, True) = True Then
MsgBox "Connection Succefully"
Else
MsgBox "Connection Failed"
E
Dim iData As Integer
Dim nField As Integer
Dim nData As Integer
Dim Result As Boolean
Dim vRow As Variant
MsgBox "Execution Start"
Set R3 = CreateObject("SAP.Functions")
R3.Connection.System = "XXX" '此处为系统标示
R3.Connection.SystemNumber = "XX" '系统编号
R3.Connection.client = "500"
R3.Connection.User = "ID"
R3.Connection.Password = "PWD"
R3.Connection.Language = "EN"
R3.Connection.ApplicationServer = "hostname"
If R3.Connection.logon(0, True) = True Then
MsgBox "Connection Succefully"
Else
MsgBox "Connection Failed"
E

这篇博客介绍了如何利用VBA(Visual Basic for Applications)编程语言与SAP系统进行连接,实现自动化数据处理和系统操作。通过VBA,用户可以创建定制化的解决方案,无缝集成SAP功能到Excel或其他Office应用中。
最低0.47元/天 解锁文章
4605

被折叠的 条评论
为什么被折叠?



