on 03-06-2006 2:19 PM
We are having an issue using the COM components supplied with SAP GUI 6.2 or 6.4. We used to have SAP 4.6c and now we have 5.0. When we were on 4.6c, we used these COM components to logon and execute RFC calls and we had much success. Now that we are on 5.0, we cant seem to instance any SAP functions that have something to do with SAP Workflow. We have experienced this problem when using VB6 or .NET, but our existing code that always worked is in VB 6.0.
SAP Components used:
o SAP Logon Control
o SAP Function Control
o Librfc32.dll
o Other supporting C DLLs and/or COM object supplied with the SAP GUI installation.
For example, if we want to call the RFC ARCHIV_CONNECTION_INSERT, this code fails in VB6 when the Set objworkflow = objFuncCtrl.Add(strFunction) line of code executes. Instead of returning an instance of the object ARCHIV_CONNECTION_INSERT function, no object is created. In 6.2, SAP raises no errors, but the object we are trying to create is still Nothing. If we use 6.4, SAP raises an error SAP data type not supported via a message box and then the object is still = Nothing. Interestingly enough, the 6.2 GUI COM controls dont display the error dialog. The message box that is shown comes from the SAP Function COM Object "SAP.Functions" (wdtfuncs.ocx).
Now, what is interesting is if we use the same code to call a standard function or custom function that doesnt have anything to do with SAP Workflow, then the code works fine. Again, all of our code used to work just fine on an SAP 4.6 system.
Here is the code that fails:
'SAP Logon control - object for creating connections to an SAP system
Dim objSAPLogonCtrl As Object
'SAP connection object
Dim objConnection As Object
'Object that will represent the SAP function called
Dim objSAP As Object
'SAP function control object - object factory for creating other SAP function objects
Dim objFuncCtrl As Object
'Create instance of an SAP logon conrol
Set objSAPLogonCtrl = CreateObject("SAP.Logoncontrol.1")
'Create a connection object
Set objConnection = objSAPLogonCtrl.NewConnection
'Define connecion parameters
objConnection.ApplicationServer = "sapvm"
objConnection.SystemNumber = "00"
objConnection.Client = "800"
objConnection.User = "iissap"
objConnection.Password = "tstadm"
objConnection.Language = "E"
objConnection.TraceLevel = 10
'call the logon method of the connection object
If objConnection.Logon(0, True) = False Then
MsgBox Error
Exit Sub
End If
'Create an instance of the SAP Function control object
Set objFuncCtrl = CreateObject("SAP.Functions")
'Set the function control connection object
Set objFuncCtrl.Connection = objConnection
'Function name to be generated and called
Dim strFunction As String
strFunction = "ARCHIV_PROCESS_RFCINPUT"
'Create an instance of the function defined in strFunction
Set objworkflow = objFuncCtrl.Add(strFunction)
If objworkflow Is Nothing Then
MsgBox "Could not create object " & strFunction
Else
MsgBox strFunction & " object created."
End If
If anyone has seen anything like this or has any ideas, please help!
Mike and Hameed
You are aware that GUI 6.X is not supported anymore?
You must use 7.20/7.30 gui as per note 66971
http://service.sap.com/sap/support/notes/66971
Regards,
Jude
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike and Hameed,
I guess the Reason is that Import / Export Parameters of type String are not supported. You should wrap the existing function module ARCHIV_PROCESS_RFCINPUT in an own function module where you use a parameter of type Char instead.
Best regards,
Ivo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello.
Same problem here.
The provided link to " ftp://ftp.sap.com/pub/sapgui/win/640/scripting/docs/" does not work.
Best regards,
Willy Homrighausen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hameedullah Khan Niazi,
We are also having the same issue. Is the issue solved? If yes, we would be very grateful if you willing to share the solution with us.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you have probably heard this before, but the logon and function control are obsolete. Maybe you could switch to SAP GUI Scripting.
Best regards,
Christian
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.