Purpose
Use the built-in functions of the native control interface for handling special screens

guixt.windowSendKeys
Sends keyboard strokes to the SAP GUI window or another window

GuiXT

CallVBAsync guinet.guixt.windowSendKeys

Parameters

1 keys
String to be sent to the window. Various special keys are possible, see below.

2 hwnd    Default: 0
Window handle. If 0, the SAP GUI main window of the current mode is used.


Example:
GuiXT

CallVBAsync guinet.guixt.windowSendKeys "{TAB}{ENTER}"

All features of the Windows "SendKeys" function can be used. For example, you can send characters and function keys. See

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/sendkeys-statementkeys-statement

for a detailed description.

In addition, GuiXT provides the following commands:

{ASYNC} processes the remaining commands in a separate thread

{CLASS=classname} sends the remaining commands to a subwindow with the specified window class name

{CLICK} sends a left mouse click

{DOUBLECLICK} sends a left doubleclick

{POPUP} waits for the next popup screen and then sends the next keys

A common example for {POPUP} is the native file save dialog that is used in some  SAP transactions. It cannot be handled directly in an InputScript since it is not an SAP screen but a native Windows screen.

Please note:

  • The {POPUP} tag must be sent before executing the SAP GUI action that triggers the popup window.
  • The first character of the string entered after {POPUP} may be missing. This happens because the Windows SendKey API does not verify whether the popup window’s input queue is ready to receive input. A workaround is to first send a dummy text, e.g., "Please wait...", followed by "^a{DEL}" to delete it, and then send the actual text you want to enter (e.g., "xyz"). Overall, the full sequence is: {POPUP}Please wait...^a{DEL}xyz

{WAIT=x} waits x milliseconds before processing the remaining commands

Example

The following InputScript calls up transaction PRCR in order to download travel expenses configuration data to a local file:

GuiXT
Enter "/nPRCR"

// Travel Expenses Per Diems: Download to File

Screen RPR_CREATE_PER_DIEMS_FILE.1000

  Set R[Table T7060: Trip Areas]   "X"

  Enter "=TAB"

 

// Travel Expenses Per Diems: Download to File

Screen RPR_CREATE_PER_DIEMS_FILE.1000

  Set F[Trip Provision Variant]   "01"

  Set F[Language Key]   "EN"

 

  // fixed file name, or specified by user via SelectFile

  Set V[filename]  "F:\temp\travel_config.01.txt"


  // Enter file name on next popup

  // confirm overwriting an existing file if a second popup appears

  CallVB guinet.guixt.windowSendKeys _

    "{POPUP}&V[filename]{ENTER}{POPUP}{TAB}{ENTER}"

 

  Enter "/8" 

 

Screen SAPLKKBL.0120

  Enter "/n"   

Components
InputAssistant + Controls