top of page
blank.png
Search

ABAP tricks #20/100: šŸ˜€ SWITCH Operator

  • Writer: Smart Logic Academy
    Smart Logic Academy
  • Aug 26, 2024
  • 1 min read

• The SWITCH operator is very similar to the COND operator with some differences


• TheĀ CONDĀ operator is used for creating a result depending onĀ logical expressions but theĀ SWITCHĀ operator is used for creating a result depending onĀ case distinction.


• The positionĀ operandĀ in the parentheses is the value that is checked in the case distinction. The expression compares the values of the operandĀ operandĀ with the specified constant values one after another and chooses theĀ resultĀ afterĀ THENĀ for which the values of the operand and constant are identical for the first time.


• If no matches are found, theĀ resultĀ specified afterĀ ELSEĀ is selected.


• The specification ofĀ THROWĀ raises an exception of theĀ exception classĀ cx_class. Exception can be raised only in the ELSE part.





Please share with your ABAP friends and follow us.

If you want to dive deeper, visit our courseĀ https://lnkd.in/d35uqwud


ree


Ā 
Ā 
Ā 

Recent Posts

See All

Comments


bottom of page