EVENT Statement
Use
You use the EVENT element to define a destination after an event has been triggered. The destination is either a template or a state. You can define several events in a flow file.
Properties
|
Property |
Description |
|
next_state |
Specifies the next state. Example: next_state = "nextstate" |
|
next_template |
Determines the next HTML template without an HTML extension. next_template = "nexttemplate" |
Event Types
|
Type |
Description |
|
onload |
This event is processed when an HTML template is displayed for the first time. It does not trigger a subsequent refresh of the same page. |
|
ontouch |
This event is processed whenever an HTML template is loaded or refreshed. |
Integration
Events that are triggered in the HTML page must be processed in the integrated ITS as OK codes. When doing so, you can implement next_state in ABAP as processing blocks and next_template as the call of the next screen in ABAP.
Example
Syntax in the Standalone ITS
In the HTML template in the standalone ITS, the syntax is as follows:
<label>Max rows: <input type=text" name="MAX_ROWS" value="10" />
<input type="submit" name="~event" value="do1" />
<input type="submit" name="~event" value="do2" />
In the flow file in the standalone ITS, the syntax is as follows:
<event name="do1" next_template="test1" />
<event name="do2" next_state="state1" />
Syntax in the Integrated ITS
In the HTML template in the integrated ITS, the syntax is as follows:
<label>Max rows<label>:
<input type="text" name="MAX_ROWS" value="10" />
<input type="submit" name="~OkCode" value="do1" />
<input type="submit" name="~OkCode" value="do2" />
In the ABAP PAI modules, you could handle this as follows:
CASE ok_code.
WHEN 'DO1'.
CALL SCREEN 140.
WHEN 'DO2'.
idx = 1.
field-get 'MAX_ROWS' idx wide_row len.
IF sy-subrc <> 0.
EXIT.
ENDIF
READ TABLE wide_row INDEX 1 INTO maxrows.
...