Video Lesson 4.8: ABAP IF statement and CASE

Video Lesson 4.8: ABAP IF statement and CASE

This lesson shows how to use the IF statement and the CASE statement for conditioning.

  • In ABAP you have two ways to execute different sequences of statements, depending on certain conditions:
  • In the IF construct you can define any logical expressions as check conditions.
  • You can use nested IF statements, using the ELSEIF clause.
  • You can use the CASE construct to clearly distinguish cases.
  • The content of the field specified in the CASE part is checked against the data objects listed in the WHEN branches to see whether they match.

  • In both constructs the condition or match check happens sequentially from the top down.
  • As soon as the statement block of a branch has been executed, the system immediately jumps to ENDIF or ENDCASE.