SY-SUBRC Handling
Task
Handle return codes using SY-SUBRC after a READ or SELECT statement and take appropriate action.
Write Your ABAP Code
Loading...
📥 Sample Input & Output
READ TABLE result SY-SUBRC = 0 → Record found SY-SUBRC ≠ 0 → Handle error
💡 Hint
Always check SY-SUBRC immediately after the statement.
✅ View Reference Solution
READ TABLE it_data INTO DATA(ls_row) INDEX lv_index. IF sy-subrc = 0. " Record found ELSE. " Handle not found ENDIF.