cancel
Showing results for 
Search instead for 
Did you mean: 

issue using the COM components supplied with SAP GUI 6.2 or 6.4

Former Member
0 Kudos

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 can’t 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 don’t 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 doesn’t 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

Accepted Solutions (0)

Answers (5)

Answers (5)

jude_bradley
Advisor
Advisor
0 Kudos

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

Former Member
0 Kudos

I am using version 7.20 (7200.3.7.1066). The export parameter as string was an issue on Function Module RSDRI_INFOPROV_READ_RFC. I copied the function module into a new one and removed (with some extra code) the problematic parameter and it worked OK.

jude_bradley
Advisor
Advisor
0 Kudos

Thanks for the update Alfonzo,

ivo_schmidt
Discoverer
0 Kudos

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

Former Member
0 Kudos

Thanks a lot for your clarification on Import / Export parameters with String. It saved me a lot of grief!

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Christian_Cohrs
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

documentation on the Scripting API is available at ftp://ftp.sap.com/pub/sapgui/win/640/scripting/docs/

This API is a replacement of the existing, obsolete COM interfaces.

Best regards,

Christian

Christian_Cohrs
Product and Topic Expert
Product and Topic Expert
0 Kudos

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