Sends a keyboard input event to the active window.
SapGui.bdh
SapGuiSendVKey( in nKey : number) : boolean;
| Parameter | Description | 
|---|---|
| nKey |  
                           				  
                            The ordinal number of the key that should be sent to the active window. These are predefined constants for keys that can be sent to the active window: 
 Otherwise pass the ordinal number of the keyboard event to be sent.  |  
                        			 
                     
transaction TMain
  var
    sConnID : string;
  begin
    // Connecting to SAP
    sConnID := SapGuiOpenConnection(" /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.198 0 /3");
    SapGuiSetActiveConnection(sConnID);
    SapGuiSetActiveSession("ses[0]");
    // SAP
    SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_Exact);
    SapGuiWindowAction(SAPGUI_WND_MAXIMIZE);
    ThinkTime(2.8);
    SapGuiSetText("usr/txtRSYST-BNAME", "ddic");
    // Logon to SAP System
    // Before running a test you have to customize the password parameter!
    SapGuiSetText("usr/pwdRSYST-BCODE", "********");
    SapGuiSetFocus("usr/pwdRSYST-BCODE");
    // caretPosition
    SapGuiSetProperty("usr/pwdRSYST-BCODE", "caretPosition", "7");
    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_SUCCESS);
    SapGuiSendVKey(SAPGUI_VKEY_ENTER);
    // Copyright
    SapGuiSetActiveWindow("wnd[1]", "Copyright", SAPGUI_MATCH_Exact);
    SapGuiPressButton("tbar[0]/btn[0]");
  end TMain;