Hello community,

in an e-mail wrotes me Stefan Geiger 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.

 

Cheers
Stefan

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Frank Krause

    Hello Stefan,

    thank you for this great post.
    I would like to quickly comment from SAP side:

    • The change you explain above is mentioned in our note “2256415 – Adaptation of RFC controls (Logon, Function, Table and BAPI) to use SAP NetWeaver RFC Library”
    • We do not intend to “revive” these controls, but we are keeping them alive for compatibility
    • The background of the switch to SAP NetWeaver RFC is the fact that the classical RFC library (librfc32.dll) – which had been used by these controls in the past – is no longer supported

    Best regards,
    Frank

    (1) 
    1. Stefan Schnell Post author

      Hello Frank,

      thank you very much for your reply.

      Thanks also for the clear words that the controls should not be revived – that is good to know.

      Cheers
      Stefan

      (0) 
  2. Badari Nath J

    Hi Stefan,

    We are from SAP GUI Controls development team and we have developed these new ActiveX controls based on SAP NetWeaver RFC library.

    Thanks a lot for sharing your observations. We have fixed both the issues observed by you.

    We have also released SAP Note 2483700 to address these issues.

    We would like to share test binaries with you so that you can recheck and share your feedback.

    It would be good if you can share you mail id so that we can share test binaries which contains fixes for both the issues.

    Please feel free to share your feedback/observations while using the new ActiveX controls based on SAP NetWeaver RFC library.

    Thanks a lot for your efforts in sharing your feedback.

    Please feel free to reach out to us in case if you need any further clarification about the new NWRFC based ActiveX controls.

    Thanks and Regards,

    Badari Nath(Badari.nath.j@sap.com), Gaurav and Shruthi.

     

    (1) 
  3. Badari Nath J

    Hi Stefan,

    You are welcome.

    Feel free to get back to us in case if you need any clarification on these new SAPNRFC based activeX controls.

    Thanks and Regards,

    Badari Nat

    (1) 

Leave a Reply