Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
stefan_schnell
Active Contributor
These days I got an e-mail about different behaviour after installing the actual SAP GUI for Windows 7.50 with the changed ActiveX controls. This means the old ActiveX controls bases on Classic RFC library and the new ActiveX controls bases on SAP NetWeaver RFC library.

  1. The length of a return value from a table was with the old ActiveX controls corresponding to the content, but with the new ActiveX controls corresponding to the definition.

  2. The setting of a value from a table column doesn't work anymore with the new version.


For my test scenario I use an enviroment which I described here.

Here my analysis about this behaviour:


Value Length


With the old ActiveX controls delivers the call of RFC_READ_TABLE with the table USR01 exact the length of the table USR01 plus delimiters:





But with the new ActiveX controls delivers the same program the length of the data structure (UC):





If you transfer a great data volum, it could be give some memory problems.


Set Value of a Table Column


With the old ActiveX controls you can set a value of a table column. Here a snippet with AutoIt:
$Row = $ReadTableFunc.Tables("FIELDS").Rows.Add
$Row("FIELDNAME") = "BNAME"
$Row = $ReadTableFunc.Tables("FIELDS").Rows.Add
$Row("FIELDNAME") = "LANGU"

This delivers in the SAP system this:



But with the new ActiveX controls delivers the same program this:



It seems that it is not possible to set the value of a table column at the moment.

 

The Test Program


To test this different behaviour I use an AutoIt script which calls RFC_READ_TABLE with the table USR01. The code is commented and really easy to understand.
;-Begin-----------------------------------------------------------------

;-Directives----------------------------------------------------------
AutoItSetOption("MustDeclareVars", 1)

;-Sub Main------------------------------------------------------------
Func Main()

;-Variables---------------------------------------------------------
Local $SAPFunc = 0, $Connection = 0, $SAPConnection = 0
Local $ReadTableFunc = 0, $Param = 0, $Table = 0
Local $RowCount = 0, $DataLine = "", $i = 0

;-Get SAP.Functions-------------------------------------------------
$SAPFunc = ObjCreate("SAP.Functions.Unicode")
If Not IsObj($SAPFunc) Then
MsgBox(0, "Hint", "Can't create SAP.Functions.Unicode object")
Exit
EndIf

;-Get SAP.LogonControl connection-----------------------------------
$Connection = $SAPFunc.Connection
If Not IsObj($Connection) Then
MsgBox(0, "Hint", "Can't get SAP.LogonControl connection")
Exit
EndIf

;-Set connection parameters-----------------------------------------
$Connection.Client = "001"
$Connection.User = "BCUSER"
$Connection.Password = "minisap"
$Connection.Language = "EN"
$Connection.System = "NSP"
$Connection.HostName = "ABAP"
$Connection.SystemNumber = 0

;-Connect SAP system------------------------------------------------
$SAPConnection = $Connection.Logon(0, -1)
If $SAPConnection = 0 Then
MsgBox(0, "Hint", "Can't logon to the SAP system")
Exit
EndIf

;-Get ABAP function module RFC_READ_TABLE---------------------------
$ReadTableFunc = $SAPFunc.Add("RFC_READ_TABLE")
If Not IsObj($ReadTableFunc) Then
;-Logoff----------------------------------------------------------
$Connection.Logoff()
MsgBox(0, "Hint", "Can't get the function module")
Exit
EndIf

;-Define export parameters------------------------------------------
$ReadTableFunc.Exports("QUERY_TABLE").Value = "USR01"
$ReadTableFunc.Exports("DELIMITER").Value = "~"

;-Call ABAP function module RFC_READ_TABLE to read table USR01------
$ReadTableFunc.Call()

;-Show the content of the table-------------------------------------
$Table = $ReadTableFunc.Tables("DATA")
If IsObj($Table) Then
$RowCount = $Table.RowCount
For $i = 1 To $RowCount
$DataLine = $Table.Value($i, "WA")
MsgBox(0, "Data", "Length: " & StringLen($DataLine) & @CrLf & _
String($DataLine))
Next
EndIf

;-Logoff------------------------------------------------------------
$Connection.Logoff()

EndFunc

;-Main----------------------------------------------------------------
If @AutoItX64 Then
MsgBox(0, "Version", "AutoIt " & @AutoItVersion & " x64")
Else
MsgBox(0, "Version", "AutoIt " & @AutoItVersion & " x86")
EndIf

Main()

;-End-------------------------------------------------------------------

 

I asked about the future of ActiveX controls here. I wrote a recommendation about the ActiveX controls here. And a few tips how to work with it eg. here and here. I was surprised about the further development of the ActiveX controls with the SAP GUI for Windows 7.50, because for a long time it looked as if no changes could be expected.

 

2017/09/26: With the SAP GUI for Windows 7.50 PL 2 from 2017/09/12 the error is fixed. Thanks to Badari, Gaurav and Shruthi for the efforts.
11 Comments
Labels in this area