SapGuiVerifyTextValue Function


This function verifies the value of a SapGui text control. This may either be a label or an edit field.

Include file



SapGuiVerifyTextValue( in sControlId : string, 
                       in sText      : string, 
                       in nOptions   : number optional,
                       in nSeverity  : number optional := SEVERITY_ERROR ) : boolean;
Parameter Description
sControlId The unique id of a text element or edit field.
sText Compares the current text of the control to the value specified in this parameter according to the comparison flags in the third parameter.
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.
  • SAPGUI_VERIFY_CASE_SENSITIVE. Performs a case sensitive comparison. By default the comparison is done case insensitive.
  • SAPGUI_VERIFY_IGNORE_WHITESPACE. Ignores any whitespaces found in the values to be compared.
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


transaction TMain
    sText : string;
    sConnID : string;

    // Connecting to SAP
    sConnID := SapGuiOpenConnection( " /SAP_CODEPAGE=1100 /FULLMENU 0 /3");

    // SAP
    SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_ExactNoCase);
    SapGuiLogon("ddic", "minisap", "000", "");
    SapGuiVerifyTextValue( "/usr/sub:SAPMSYST:0020/txtINFO_TAB-TDLINE[8,0]", "Only released for training purposes", SAPGUI_VERIFY_EQUAL | SAPGUI_VERIFY_CASE_SENSITIVE,OR); 
  end TMain;