on 04-24-2006 1:28 PM
Hello, all,
I have written a custom business object and its associated function module. I can single-test the business object inside native SAP, and it works successfully. I can also establish a handle to the business object from VBA (using the .GetSAPObject method of the BAPI control object.) I can't call the method of the custom BAPI, though--I get error message "UploadResults is not a BAPI method." (UploadResults is the name of both my business object and the method of the business object.) Here's my source code:
Sub UploadChemToSAP()
Dim gConnection As Object 'global connection object
Dim oBAPICtrl As New SAPBAPIControl
Dim oBAPIService As Object
Dim boFunction As Object, boResults As Object, boReturn As Object
'Set up connection object for SAP. Note that the SAP BAPI ActiveX object must be available on the form or otherwise.
Set gConnection = oBAPICtrl.Connection
'Log in to SAP. Seems like passwords must be in uppercase. There are examples of people defaulting some (or all)
'of the login values
gConnection.logon
Set boFunction = Nothing
Set boResults = Nothing
Set boReturn = Nothing
Set oBAPIService = oBAPICtrl.GetSAPObject("UploadResults")
Set boReturn = oBAPICtrl.DimAs(oBAPIService, "UploadResults", "Return")
'Log out of SAP.
gConnection.logoff
End Sub
To my knowledge, I have released both the business object and its associated method. The function module has been released, too. Any suggestions on where to go from here?
Thanks in advance,
Eric
Hey,
Please check the "Processing Type" of the function module implementing the method. It should be a Remote-Enabled module.
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, I figured it out, so I thought I'd share the solution with you. My method I was using was implemented as a local method. Once I recreated it as an API method, I was able to access it from VB/VBA immediately.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.