Skip to Content
Technical Articles
Author's profile photo Stefan Schnell

How to use Freestyle BASIC Script Language (FBSL) with SAP GUI Scripting

Freestyle BASIC Script Language (FBSL) is a true multitalent, but it is unfortunately not more available. It is possible to use it inside ABAP and to use SAP GUI Scripting with it, as the example here shows. It is only a simple logon, but it shows how to use FBSL in this case. This example has now only historical museum character.


    #AppType Console
    #Option Strict

    #Include <>

    Sub Main()

        Dim %SAPROTWrapper, %SapGuiAuto, %application, %connection
        Dim %session

      SAPROTWrapper = CreateObject("SapROTWr.SapROTWrapper", "")
      If Not SAPROTWrapper Then
      End If

      SapGuiAuto = GetValue("%o", SAPROTWrapper, ".GetROTEntry(%s)", _
      If Not SapGuiAuto Then
      End If

      application = GetValue("%o", SapGuiAuto, ".GetScriptingEngine")
      If Not application Then
      End If

      connection = GetValue("%o", application, ".Children(%d)", 0)
      If Not connection Then
      End If

      session = GetValue("%o", connection, ".Children(%d)", 0)
      If Not session Then
      End If

      PutValue(session, ".findById(%s).text = %s", _
        "wnd[0]/usr/txtRSYST-MANDT", "001")
      PutValue(session, ".findById(%s).text = %s", _
        "wnd[0]/usr/txtRSYST-BNAME", "BCUSER")
      PutValue(session, ".findById(%s).text = %s", _
        "wnd[0]/usr/pwdRSYST-BCODE", "minisap")
      PutValue(session, ".findById(%s).text = %s", _
        "wnd[0]/usr/txtRSYST-LANGU", "EN")
      CallMethod(session, ".findById(%s).sendVKey %d", _
        "wnd[0]", 0)


    End Sub


FBSL can compile scripts to executable. On this way you can deliver your SAP GUI script to any target computer on Windows platform, without any dependencies.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sayuti Azmi
      Sayuti Azmi

      interesting.. as always. 🙂