Show TOC

assert FunctionLocate this document in the navigation structure

Use

Purpose

Generates a message when an HTML field value is in error.

Syntax

assert(<field name>.name)

Description

You use the assert function to generate field-specific error messages in an HTML page.

If the field contents in an SAP transaction are invalid, the screen field generates an error. SAP system uses the cursor position to determine the field responsible for the error. On the ITS side, a standard error message is placed in the system field ~MessageLine.

If you use the assert function for a field in an HTML template and that field generates an error in SAP system, the ITS replaces your assert statement with the standard error message. With the assert function, you can display a message (or graphic) next to a field whenever it contains invalid data.

Normally, the ITS replaces the assert with the value of the ~ErrorMarker parameter from the global service file global.srvc. ~ErrorMarker can contain any HTML statement (for example, a hyperlink to a graphic). If you do not set a value, the default is @@ Error @@.

Example
<form ...>
 ...
  Material no <input type="text" name="matnr">`assert(matnr.name)`
  Quantity    <input type="text" name="quantity">`assert(quantity.name)`
 <p>`~MessageLine`</p>
</form>
         
Note

Since only a simple replacement occurs, HTMLBusiness statements in this parameter are not analyzed.