on 12-30-2011 5:09 PM
Hi
I am a vba/ .net developer. An ABAP programmer created an ABAP function and I´d like to call it through VBA code.
To access it in SAP GUI, the user access the transaction /N/TENR/MM0035
However, when I access it in a VBA code I get an error
...
Set oCtrl = CreateObject("sap.Functions")
Set oLogon = CreateObject("sap.logoncontrol.1")
Set oCtrl.Connection = oLogon.newconnection
oCtrl.Connection.Logon
Set obj = oCtrl.Add("/n/TENR/MM0035")
I get an erro at last line code: Error 1001: SAP Remote Function Call
It seems it cound not find the function. When I change the function name to BAPI_MATERIAL_AVAILABILITY, for instance, it works.
Can anybody help
Thanks
Hi pklj_2000,
you can try the following:
. . .
Set oCtrl = CreateObject("sap.Functions")
Set oLogon = CreateObject("sap.logoncontrol.1")
Set oCtrl.Connection = oLogon.newconnection
oCtrl.Connection.Logon
'Set obj = oCtrl.Add("/n/TENR/MM0035")
session.findById("wnd[0]/tbar[0]/okcd").text = "/n/TENR/MM0035"
session.findById("wnd[0]").sendVKey 0
. . .
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.