SapGuiVerifyCalendarFocusDate Function

Action

This function verifies whether a specified date is focused in a calendar control.

Include file

SapGui.bdh

Syntax

SapGuiVerifyCalendarFocusDate( in sControlId : string, 
                               in sDate      : string, 
                               in nOptions   : number optional,
                               in nSeverity  : number optional := SEVERITY_ERROR ) : boolean;
Parameter Description
sControlId The unique id of the calendar
sDate The date to be verified.
nOptions

This parameter specifies the type of check to be performed. Available options are:

  • SAPGUI_VERIFY_EQUAL. Verifies, whether the state of the checkbox's state is equal to the value specified in the second parameter.
  • SAPGUI_VERIFY_NOT_EQUAL. Verifies, whether the checkbox's state is not equal to the value specified in the second parameter.
nSeverity Optional: Severity of the error that is raised if the verification fails. Can be one of the following values:
  • SEVERITY_SUCCESS: Success; no error (numerical value: 0)
  • SEVERITY_INFORMATIONAL: Informational; no error (numerical value: 1)
  • SEVERITY_WARNING: Warning; no error (numerical value: 2)
  • SEVERITY_ERROR: (Default) Error; simulation continues (numerical value: 3)
  • SEVERITY_TRANS_EXIT: Error; the active transaction is aborted (numerical value: 4)
  • SEVERITY_PROCESS_EXIT: Error; the simulation is aborted (numerical value: 5)

Return value

  • true if successful
  • false otherwise

Example

transaction TMain
  var
    sConnID : string;
  begin
    // Connecting to SAP
    sConnID := SapGuiOpenConnection( " /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.132 0 /3");
    SapGuiSetActiveConnection(sConnID);
    SapGuiSetActiveSession("ses[0]");

    // SAP
    SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_ExactNoCase);
    SapGuiWindowAction(SAPGUI_WND_MAXIMIZE);

    // Logon to SAP System
    // Before running a test you have to customize the password parameter!
    ThinkTime(2.3);
    SapGuiLogon("ddic", "*******", "000", "");

    // SAP Easy Access
    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_SUCCESS);
    SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_ExactNoCase);
    SapGuiSetActiveWindow("wnd[0]", "Termine anzeigen: DDIC", SAPGUI_MATCH_ExactNoCase);
    SapGuiCalendarFocusDate( "usr/cntlCALE_CONTROL/shellcont/shell/shellcont[0]/shell", "20041105");
    SapGuiVerifyCalendarFocusDate( "usr/cntlCALE_CONTROL/shellcont/shell/shellcont[0]/shell", "20041105", SAPGUI_VERIFY_EQUAL, SEVERITY_ERROR);
  end TMain;