Register Login

SAPshortcut: Program parameters

Updated Jul 11, 2018

Information is missing about program parameters of the SAP GUI link (for the SAPshortcut).

You can log on to an R/3 system by calling SAPshortcut with parameters in an MS-DOS window in the following format:

  •  For GUI < 45B:
    start sapsh.exe ...
  • For GUI >= 45B
    start sapshcut.exe ...

The ... are placeholders for parameters of the SAP shortcut. All parameters can start with "-" or "/".
The parameter variants ' or ...' specified below (for example, or -u=user ID) are abbreviations of the parameters available as of GUI 46C.

    1. System-independent parameters
    that can only be entered individually for the SAP shortcut command.

        a) -version
        displays the current version of the SAPshortcut.

        b) -help, -?
        The short help display for parameterization.

        c) -register
        registers the SAPshortcut in the Windows registration database.
        After the registration, Windows supports the following functions:

        Starting the shortcut by double-clicking the icon

        Logon/edit functions in the context menu of the icon

        New -> SAP shortcut in the context menu of the desktop
        As of the 45B GUI, you can simply perform registration by calling sapshcut.exe without parameters. Sapshortcut is usually registered automatically when the GUI is installed.

        d) -edit
        starts the processing dialog of the SAPshortcut and writes the input data to the file after you choose "Enter". You cannot log on using the SAPshortcut.

    2. System-dependent parameters
    that must be entered combined together for the SAP shortcut command.
    If the specified parameter is incomplete and after calling the SAP shortcut command, the system issues a dialog with an English error message such as:
      Not all data for SAP GUI Shortcut is available:
       System ID is unknown.
       Enter the missing data.

    In this case, you supplement the missing parameters in the command line as requested.

              2.1 User ID

                       a) -user="userID" or -u="userID"

                    specifies the SAP user ID.

                       b) -language=[DE|EN|...] or -l=[DE|EN|...]

                    specifies the logon language in the SAP system.

                       c) -pw="password"

                    specifies the password for automatic logon.

                    If this parameter is specified and the remaining logon data also exists (target system, client), SAPshortcut starts the transaction immediately in the target system.

                    If this parameter is not specified, the system displays the logon dialog and requests the password. It is only then that the logon is started.

                       As of 620 GUI Patch 59 and 640 Patch 15, the system supports passwords with upper and lower case letters in the SAPShortcut.

              2.2 SAP system ID

                       a) -system=SID or -sid=SID

                    specifies the SAP system ID, SID.

                       b) -client=001 or -clt=001

                    specifies the logon client.

                       c) -sysname="SID [MyGroup1]" or -desc="SID [MyGroup1]"

                    specifies the target system using the description in the SAPLogon.

                       d) -guiparm="sapserver 10" or -gui="sapserver 10"

                    specifies the target system using start parameters of SAPGUI.EXE.


                    specifies a logon using system name and logon group.



                    specifies a load balancing logon by specifying the message server and the logon group.


                    specifies a load balancing logon by specifying the system name, the message server and the logon group.

                    *** In general, you can insert all of the command parameters of sapgui.exe within the double quotation marks " ". To find the syntax and examples of SAP GUI command parameters, use the simple call of sapgui.exe (without parameters) and the additional SAP GUI call parameters in Notes 390832 and 1073779.

    3. Specification of SAP start transactions/reports/commands

              3.1 -type=[Transaction|Report|SystemCommand] or -t=[Transaction|...]

                       specifies the function type to be started.

                       The following types are supported at present:

                       a) Transaction

                    starts the function as a transaction, default value.

                       b) Report

                    starts the function as a report.

                       c) SystemCommand

                    starts the function as a system command.

              3.2 -command="se38" or -cmd="se38"

                       transfers the transaction code/report name/system command when starting the relevant function.

                       As of 620 GUI patch 59 and 640 patch 16, the string length of this parameter can be less than 256 and more than 2048 (see SAP Note 1627252 about the required kernel patch).

                       For example:

                       a) Transactions***

        Without parameter:

        Starting the ABAP editor:


        With Dynpro field parameter:

        The next command starts the SAP Note transaction with the SAP Note data as a parameter (language and SAP Note number):

        -command="*BH33 HWTX3-SPRSL=D; HWHD3-NUMM=49143;"

        HWTX3-SPRSL and HWHD3-NUMM are the field labels for batch input of the two required fields on the initial screen of transaction BH33, and they can be determined by calling the screen field help:

                    Place the cursor in the field, for example, "Number". Choose F1 and call the technical information. Choose the field description for batch input, screen fields HWTX3-SPRSL.

                    The asterisk character * before transaction code BH33 means that the initial screen is skipped when the transaction is started, provided that all required fields of the initial screen are filled with the parameter.

                    Check the validity of the command string within " "by entering the following data in the OK code field of an SAP GUI window /n that is followed by this string as below:

/n*BH33 HWTX3-SPRSL=D; HWHD3-NUMM=49143;

Then choose ENTER.

                    If this does not work using the direct OK code call, it cannot work in the case of shortcuts either.

                    *** For a parameter transaction such as F-01 that calls a native transaction (FBM1) with default values for one or more screen fields, or for a variant transaction such as YVA03 that is created using transaction SHD0 for the native transaction such as VA03 with a transaction variant, the default values CANNOT be written to the corresponding field for the

transaction call with parameter

                    using OK-CODE as /n*F-01 BKPF-BUKRS=1000; or

                    /n*YVA03 VBAK-VBELN=1234;

                      You must enter the following OK-CODE instead:

                    /n*FBM1 BKPF-BUKRS=1000;


                    /n*VA03 VBAK-VBELN=1234;

                    Therefore, parameter transactions and variant transactions of this type cannot be populated correctly with default values by Sapshortcut. You should always enter the native transaction such as

                     -command="*FBM1 BKPF-BUKRS=1000;"

                    instead of

                     -command="*F-01 BKPF-BUKRS=1000;"

                    To determine whether the transaction is a parameter transaction such as F-01 or a variant transaction, call transaction SM31, specify the table name TSTC, and choose "Display". Then specify the transaction code and choose the glasses icon to display the data.

                       b) Reports

                     -command="grbusg_3" -type=Report

                    The variant of the report can (as of 4.6D GUI) be specified as follows:

                     -command="report variant"

                    as in, for example -command="RSPARAM TEST"

                    if the ABAP report RSPARAM has the variant TEST.

                    To be able to carry out the report, the SAPShortcut user must be authorized to call transaction SUB%.

                       c) System commands

                     -command="/H" -type=SystemCommand

                    activates the debugger

                     -command="?STAT" -type=SystemCommand

                    displays the status.

              3.3 -title="Any Title for the function" or -tit="My Test"

                       specifies the title of the function to be started (this appears in the logon dialog for example).

    4. The following parameters are available as of GUI Release 4.6B:

        a) To diagnose the Sapshortcut program:
        -trace=3 or -trc=3

    5. To set the working directory:
    -workdir="C:temp" or -wd="C:temp"

    In SAP GUI 620 patch lower than 56 and SAP GUI 640 patch lower than 12:
    This setting determines the trace directory where you want to write the SAPShortcut and other SAP GUI trace files.
    For a later SAP GUI version:
    This setting no longer has any effect. The trace files are always written to SAPWorkdir. You can change the standard SAPWorkdir (see Note 519852) so that you can change the trace directory.

    6. To set the window size of the Sapgui

        a) -maxgui or -max
        sets the registry entry 'Maximize' under
        HKEY_CURRENT_USERSoftwareSAPSAPGUI FrontSAP Frontend ServerWindow
        to 1 so that the GUI is started in a maximum window after logging on (through Sapshortcut or Saplogon).
        This parameter is available from GUI 46B 4620.1.0.1433 (frontend version). It can be used alone or together with other system-dependent parameters (see below).

    7. The following parameter is available as of 640 GUI Patch 13:

        a) To set whether or not an existing connection should be reused:
        -reuse=1(reuse, default setting)
        -reuse=0 (do not reuse)

        Reuse only occurs when the system ID specified (parameter -system=SID),client(parameter -client=###), user (parameter -user=...), and logon language (parameter -language=??) matches the ID of an existing connection. If a session from the existing connection has the initial screen, that is, transaction SESSION_MANAGER ("SAP Easy Access") or S000, the session is reused. Otherwise, a new session is started for the existing connection.

    8. The following parameters are available since 46D GUI Compilation 3:
    (File version: sapshcut.exe >= 659 and sapsmlib.dll >= 642)
    (File version: sapgui.exe >= 8852, read Note 396559)

        a) To support SNC logons:
        -snc_name="p:CN=SID, O=SAP-AG, C=DE" (SNC name)
        -snc_qop=9                          (activates SNC logon)

        For more information about SNC (Single Sign On), see Note 138498.

Note on SAPGui Release 40b
With this release, the SAP shortcut was delivered for the first time. The above listed parameter is contained in these, except for the transfer of the password.
If you need the transfer with password, you can transfer the SAP shortcut from Release 45a to Release 40b in exceptional cases. To do this, you must copy the files "sapsmlib.dll" and "sapsh.exe" from the SAPGui directory of Release 45a into the SAPGui directory Release 40b. The parameter -pw should function the next time you start the program.


  • 11 Jul 2018 11:16 am Guest

    Hi ,

    I am able to launch the SAP GUI,select the system and also able provide the TCODE, but unable to provide the table name,run the table and export the data through command line.

    Can please provide the commands to provide table name,run the table and export the report.

    Thanks in advance.

    Script i have written:

    @echo off
    set /p Username= Enter username:
    set /p Password= Enter password:
    set /p Tcode= Enter Tcode:
    set /p Database=Enter Database: 
    REM: cd Program FilesSAPFrontEndSapGui
    start sapshcut.exe -system=%Database% -client=320 -command=%Tcode% -user=%Username% -pw=%Password%