SapGuiIgnoreError Function

Action

Ignores SapGui errors. It is scripted by the Silk Performer Recorder for ignoring errors that are indicated in the SapGui status bar during recording. Although this function is only scripted in this case it can also be applied to ignore any SapGui error.

Include file

SapGui.bdh

Syntax

SapGuiIgnoreError( in nError    : number,
                   in nSeverity : number optional := SEVERITY_SUCCESS );
Parameter Description
nError The error to be ignored in the next SapGui function call.
nSeverity Optional: Severity of the error that is raised if the verification fails. Can be one of the following values:
  • SEVERITY_SUCCESS: (Default) Success; no error (numerical value: 0)
  • SEVERITY_INFORMATIONAL: Informational; no error (numerical value: 1)
  • SEVERITY_WARNING: Warning; no error (numerical value: 2)
  • SEVERITY_ERROR: 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)

Example

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);

    // Logon to SAP System
    // Before running a test you have to customize the password parameter!
    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_ERROR);
    ThinkTime(2.8);
    SapGuiLogon("ddic", "minisap", "000", "");

    // Copyright
    SapGuiSetActiveWindow("wnd[1]", "Copyright", SAPGUI_MATCH_Exact);
    SapGuiPressButton("tbar[0]/btn[0]");

  end TMain;