
You can add your own error messages to the list during OnInputProcessing of the second page ( second.htm).
Fill the event handler OnInputProcessing of second.htm with the following coding:
if page->messages->assert( 'date_at' ) ne 0.
date_at = sy-datum + 1.
elseif date_at <= sy-datum.
date_at = sy-datum + 1.
page->messages->add_message(
condition = 'date_at'
message = 'Das Datum muss in der Zukunft liegen'
severity = page->messages->CO_SEVERITY_ERROR ).
endif.
if page->messages->assert( 'date_at' ) ne 0.
time_from = '080000'.
elseif time_from < '080000'
or time_from > '180000' .
time_from = '080000'.
page->messages->add_message(
condition = 'time_from'
message = 'Uhrzeit muss zwischen 08:00 und 17:00 Uhr liegen'
severity = page->messages->CO_SEVERITY_ERROR ).
endif.
if page->messages->assert( 'date_at' ) ne 0.
time_to = time_from + 3600.
elseif time_to <= time_from.
time_to = time_from + 3600.
page->messages->add_message(
condition = 'time_to'
message = 'Ende-Zeit muss nach Anfangszeit liegen'
severity = page->messages->CO_SEVERITY_ERROR ).
endif.
The system checks whether the date and times are possible. The date must lie in the future and the time must lie in the working time (between 08:00 and 17:00). The end time must occur after the start time.
The same conditions apply to these entries (parameter condition) as to automatically generated error messages. The advantage of this is that no additional queries are required in the layout method.
This example deliberately omits translation issues. If you manage error messages using the Online Text Repository (OTR), they are automatically output in the required language thanks to the connection to the translation tools.
For information on the OTR directives, see the section OTR Directives.
For information on using the OTR when creating BSP applications, see Internationalization and Translation: Tutorial.