通过Excel VBA连接Sap [英] Connect Sap Through Excel VBA
问题描述
如果我们使用excel vba连接到SAP,有人可以帮助我指导。
我的机器上没有安装直接的sap,并且在下面的链接中使用SAP窗口。
https://nedc-ctx.applications.services.axa-tech.intraxa/Citrix/AccessPlatform/auth/loggedout.aspx
我知道SAP GUI的记录和运行功能,这是正常工作。我只有在培训版本的访问。但是在生产中,我无法使用运行和记录选项。
现在寻找帮助,以帮助从excel vba connect打开sap窗口并加载数据。 / p>
下面链接给出的示例不起作用,我收到错误。
我试图探索更多,并建立无法在我的机器上添加引用文件sapfewse.ocx。
如果可以通过excel连接SAP,请帮助指导我vba如果我们通过上面提供的链接访问SAP。点击上面的链接后,新的弹出窗口将与窗口连接。 SAP正在通过citix进行连接。
以下是帮助链接中的代码。
设置SapGuiAuto = GetObject(SAPGUI)获取SAP GUI脚本对象
设置SAPApp = SapGuiAuto.GetScriptingEngine'获取当前运行的SAP GUI
设置SAPCon = SAPApp.Children(0) '获取当前连接的第一个系统
设置会话= SAPCon.Children(0)'获取该连接上的第一个会话(窗口)
'启动事务以查看表
session.StartTransactionSE16
代码您提供的仅在您的计算机上安装了SAP GUI时才会起作用。
我建议询问IT团队是否可以提供您的服务器地址,以便您可以使用远程函数调用自动检索数据。这可以通过VBA完成( https://archive.sap.com/discussions/thread/129358 )
您需要调整链接中的代码以满足您的需求
Can someone help me to guide if we connect to SAP using excel vba.
I have no direct sap installed on my machine and using SAP window through below link.
https://nedc-ctx.applications.services.axa-tech.intraxa/Citrix/AccessPlatform/auth/loggedout.aspx
I am aware of Record and Run function of SAP GUI and that is working. I have this access in training version only. But in production I am unable to use run and record option.
Now looking for a help which will help to open sap window from excel vba connect and load the data.
Example given on link below is not working and I am getting error.
Excel VBA pulling data from SAP NetWeaver
I tried exploring more and founded that unable to add reference file "sapfewse.ocx" on my machine.
Please help to guide me if it's possible to connect SAP through excel vba if we access SAP through above provided link. After clicking on above link new pop-up window will get connected with sap with window. SAP is getting connected through citix.
Below is the code from help link.
Set SapGuiAuto = GetObject("SAPGUI") 'Get the SAP GUI Scripting object
Set SAPApp = SapGuiAuto.GetScriptingEngine 'Get the currently running SAP GUI
Set SAPCon = SAPApp.Children(0) 'Get the first system that is currently connected
Set session = SAPCon.Children(0) 'Get the first session (window) on that connection
'Start the transaction to view a table
session.StartTransaction "SE16"
The code you provided would only work if you have the SAP GUI installed on your computer. I would suggest asking the IT team if they can provide you the server address so you can use a Remote Function Call to retrieve the data automatically. This can be done with VBA (https://archive.sap.com/discussions/thread/129358) You would need to adapt the code in the link to match your needs
这篇关于通过Excel VBA连接Sap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!