Values of Sy-Subrc After ABAP Statements
Values of Sy-Subrc After ABAP Statements
17. EXEC SQL - ENDEXEC sets SY-SUBRC to 0 in nearly all cases. It does, however, set
SYSUBRC to 4 if no entry is read in a FETCH statement.
18. FETCH sets SY-SUBRC to 0 if at least one line was read, otherwise to 4.
19. GENERATE SUBROUTINE POOL sets SY-SUBRC to 0 if the generation was
successful, otherwise to 8.
20. GET CURSOR sets SY-SUBRC to 0 if the cursor is correctly positioned, otherwise to 4.
21. GET PARAMETER sets SY-SUBRC to 0 if a corresponding value exists in SAP
memory, otherwise to 4.
22. IMPORT sets SY-SUBRC to 0 if the import is successful, otherwise to 4.
23. INSERT sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.
24. LOAD REPORT sets SY-SUBRC to 0 if the operation is successful, otherwise to 4 or 8
depending on the cause of the error.
25. LOOP sets SY-SUBRC to 0 if there is at least one pass through the extract. Otherwise, it
is set to a value other than 0.
26. LOOP AT sets SY-SUBRC to 0 if there is at least one loop pass through the internal table,
otherwise to 4.
27. MODIFY sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.
28. MODIFY LINE sets SY-SUBRC to 0 if a line in the list was changed, otherwise it sets it
to a value other than 0.
29. MODIFY sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.
30. OLE2 Automation, executed successfully, otherwise 1, 2, 3, or 4, depending on the cause
of the error.
31. OPEN DATASET sets SY-SUBRC to 0 if the file could be opened, otherwise to 8.
32. Open SQL statements set SY-SUBRC to 0 if the operation is successful, otherwise to a
value other than 0.
33. OVERLAY sets SY-SUBRC to 0 if at least one character is overlaid, otherwise to 4.
34. READ DATASET sets SY-SUBRC to 0 if the read operation was successful, otherwise to
4 or 8, depending on the cause of the error.
35. READ LINE sets SY-SUBRC to 0 if a list line exists, otherwise to a value other than 0.
36. READ TABLE sets SY-SUBRC to 0 if table lines are found, otherwise to 2, 4, or 8,
depending on the context and cause of the error.
37. REPLACE sets SY-SUBRC to 0 if the search string was replaced, otherwise to a value
other than 0.
38. SCROLL sets SY-SUBRC to 0 if the scrolling within the list was successful, otherwise to
4 or 8, depending on the cause.
39. SEARCH sets SY-SUBRC to 0 if the search string was found, otherwise to 4.
40. SELECT sets SY-SUBRC to 0 if at least one line was read, otherwise to 4, or possibly 8
in SELECT SINGLE FOR UPDATE.
41. SET COUNTRY sets SY-SUBRC if the country code exists in table T005X, otherwise to
4.
42. SET BIT sets SY-SUBRC to 0 if the bit could be set, otherwise to a value other than 0.
43. SET TITLEBAR sets SY-SUBRC to 0 if the title exists, otherwise to 4.
44. SHIFT ... UP TO sets SY-SUBRC to 0 if the position could be found within the string,
otherwise to 4.
45. SPLIT sets SY-SUBRC to 0 if the sizes of the target fields are adequate, otherwise to 4.
46. UPDATE sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.
47. WRITE ... TO sets SY-SUBRC to 0 if the assignment is successful, otherwise to 4.