Entering content frame

Background documentation assert Function Locate the document in its SAP Library structure

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 R/3 transaction are invalid, the screen field generates an error. R/3 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 R/3, 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.

Leaving content frame