Launching the SAP GUI

enaio® 10.10 »

The module implements a function with the following input parameters:

Parameter

Description

Type

-system

SAP system ID

Alphanumeric, three-digit

-client

Tenant

Alphanumeric, three-digit

-user

User name

Alphanumeric

-language

Language

Alphanumeric, two-digit

-command

Command

Alphanumeric, optional

String with additional parameters

Alphanumeric, optional

The parameters must be transferred to the command line, for example:

axJump2SAP.exe -system=SAM -client=800 -user=DEMO -language=DE -command="FB03"

The SAP GUI installation path is obtained from the local registration database. This is called using the transferred data and commands.

The system ID that was entered (SAM in the example above) must be specified in an entry in the SAP logon. The user name may not contain more than 12 characters. All entries should be made in upper case letters.

The command contains a transaction code, and can transfer parameters to this transaction. Here is an example:

axJump2SAP.exe -system=SAM -client=800 -user=DEMO -language=DE -command="*VA03 VBAK-VBELN=13373"

The asterisk in front of transaction code VA03 signifies that the initial screen of the transaction is skipped. After that, one or more fields on the initial screen can be populated with values. You can find the field names in the F1 help technical information (dynpro field) on the SAP GUI. If there is more than one field, they are separated by a semicolon.

axJump2SAP.exe -system=SAM -client=800 -user=DEMO -language=DE -command="*MIR4 RBKP-BELNR=5105608884;RBKP-GJAHR=2012"

Values cannot be transferred with certain SAP transactions. In such cases, you have to write a custom SAP transaction that takes the parameters and translates them into the required call.

If the command contains spaces, as is the case when transferring parameters, they must be enclosed in quotation marks.

If you want to test the examples above in a command line, you will first need to launch enaio® client. The path to axJump2SAP.exe must of course be specified explicitly in both the command line call and in a script call, or it must be contained in the PATH environment variable.

Error Messages

In the event of an error (for example, if SAP GUI is not installed), the program will display an error message.

Sample Script

Sub Jump2Auftrag(ByVal sAuftrag)
  sProgram = """D:\OSECM\clients\client32\axJump2SAP.exe"""
  sSAPParams = "-system=SAM -client=800 -user=DEMO -language=DE"
  Set WshShell = CreateObject("WScript.Shell")
  ' Aufruf Auftrag
  sParameter="-command=""*VA03 VBAK-VBELN=" & sAuftrag & """"
  WshShell.Run(sProgram & " " & sSAPParams & " " & sParameter)
End Sub
 
Sub Jump2Rechnung(ByVal sBelnr, ByVal sJahr)
  sProgram = """D:\OSECM\clients\client32\axJump2SAP.exe"""
  sSAPParams = "-system=SAM -client=800 -user=DEMO -language=DE"
  Set WshShell = CreateObject("WScript.Shell")
  ' Aufruf Rechnung
  sParameter="-command=""*MIR4 RBKP-BELNR="&sBelnr&";RBKP-GJAHR="&sJahr&""""
  WshShell.Run(sProgram & " " & sSAPParams & " " & sParameter)
End Sub