Skip to main content

IF / ELSE Condition Handling

BeginnerControl Structures⏱ 10 min

Task

Write ABAP logic using IF, ELSEIF, and ELSE to determine a student’s result based on marks obtained.

  • Use IF / ELSEIF / ELSE
  • Compare numeric values
  • Assign appropriate result text

Write Your ABAP Code

ABAP Editor
Loading...
📥 Sample Input & Output
Input:
lv_marks = 65

Output:
lv_result = 'Pass'
💡 Hint

Check the marks range using IF andELSEIF. Use ELSE for the default case.

✅ View Reference Solution
IF lv_marks >= 75.
  lv_result = 'Distinction'.
ELSEIF lv_marks >= 50.
  lv_result = 'Pass'.
ELSE.
  lv_result = 'Fail'.
ENDIF.