Ansicht
Dokumentation

ABENCONDITIONAL_EXPRESSION_COND - CONDITIONAL EXPRESSION COND

ABENCONDITIONAL_EXPRESSION_COND - CONDITIONAL EXPRESSION COND

RFUMSV00 - Advance Return for Tax on Sales/Purchases   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

COND, Conditional Operator

... COND type( $[let_exp$]
               WHEN log_exp1 THEN $[ let_exp$] result1
             $[ WHEN log_exp2 THEN $[ let_exp$] result2 $]
             ...
             $[ ELSE $[let_exp$] resultn $] ) ...


Effect

A conditional expression with the conditional operator COND has a result, result, that is dependent on logical expressions. Either a value with the data type specified by type is created or a class-based exception is raised. The following can be specified for type:

WHEN must be specified at least once with any logical expression log_exp in the parentheses. This can be followed by any number of WHEN statements with further logical expressions. An ELSE can be specified at the end. The expression evaluates the logical expressions one after the other and selects the result specified after THEN of the first logical expression whose result is true. The selected result determines the result of the conditional expression. If none of the logical expressions are true, the result specified after ELSE is selected. If ELSE is not specified, the result is the initial value of the data type type.

To define local helper fields, an optional LET expression can be specified before the first WHEN, after every THEN, and after ELSE.

Notes

Example

Transformation of a time to 12 hour format using a conditional expression in an operand position. The type of the result is used by the operand after the first THEN specification and is therefore string.






Vendor Master (General Section)   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 3401 Date: 20240329 Time: 145623     sap01-206 ( 62 ms )