The routine SYSWRN is built to handle all types of warnings, which shall be displayed and maintained depending on the context within the transaction.
SYSWRN is integrated into MTABUT and thus available in all business transactions.
Type Character | Symbolic Name of Warning Type | Description |
---|---|---|
C | SysWrnTypeStartupInfo | |
S | SysWrnTypeStartup | Warnings created during startup of the transaction and which at first need to be confirmed by the user before beginning to process the transaction. |
I | SysWrnTypeInfo | |
W | SysWrnTypeWarning | Warnings which were created during normal handling of the business transaction and which are of such importance, that the user has to confirm that he has read this text. |
F | SysWrnTypeFinal | Warnings which where created after the user has finally stored the transaction and after having completed the check and store procedures. |
The type character itself should not be used within the software. The symbolic names (which are defined in D5CONST.INI) should be used instead for better readability of the source.
In case of a single check of a datafield, a coding just like the following has to be used:
Check XYZGRP\REC\ABCDAT If XYZGRP\REC\ABCDAT < Today Then SysWarningSet( SYSWRNTypeWarning, GetText( 'The ABC date is in the past.' ), "" ) Else SysWarningSet( SYSWRNTypeWarning, "", "" ) EndIf
In case multiple checks with different messages for the same datafield are to be handled, or if the warnings should be handled within event rules, a message ID should be created and used to identify the single message:
Check XYZGRP\REC\EFGDAT\\ If XYZGRP\REC\EFGDAT < XYZGRP\REC\ABCDAT Then SysWarningSet( SYSWRNTypeWarning, GetText( 'The EFG date is prio to ABC.' ), "EFGNOTPASTABC" ) Else SysWarningSet( SYSWRNTypeWarning, "", "EFGNOTPASTABC" ) EndIf
Settings of warnings should be handled on security level 5.
During background processing of business transactions initiated by webservices (SMC) or automated allNETT message background processing, system warnings in business transaction are automatically accepted and marked as being read. This will allow full STP processing even if there are warnings which is typically the case for webservices or allNETT messages.