SAP OPENSQL EXCEPTIONS

Get Example source ABAP code based on a different SAP table
  



Open SQL – Exceptions




Catchable Exceptions
CX_SY_OPEN_SQL_DB
Reason for error:
A general database error occurred.
Runtime error: DBIF_RSQL_SQL_ERROR
Reason for error:
Error in module RSQL of the database interface.
Runtime error: DBIF_RSQL_INVALID_RSQL
Reason for error:
No data found for the specified key.
Runtime error: DBIF_RSQL_KEY_NOT_FOUND
Reason for error:
Unexpected end of data when accessing a table.
Runtime error: DBIF_RSQL_END_OF_DATA
Reason for error:
The key for a table was not completely specified.
Runtime error: DBIF_RSQL_KEY_NOT_SPECIFIED
Reason for error:
Es soll ein Datensatz eingefügt werden, obwohl auf der
Datenbank bereits ein Datensatz mit dem gleichen Schlüssel existiert.
Runtime error:
DBIF_RSQL_KEY_ALREADY_EXISTS
Reason for error:
An invalid database cursor was used.
Runtime error:
DBIF_RSQL_INVALID_CURSOR
Reason for error:
An attempt was made to access a closed database cursor.
Runtime error:
SAPSQL_SQLS_INVALID_CURSOR

CX_SY_DYNAMIC_OSQL_SEMANTICS
Reason for error:
The database column whose values are to be aggregated does not have a numeric type.
Runtime error:
SAPSQL_HAVING_AVG_TYPE
Reason for error:
The database column whose values are to be aggregated does not have a numeric type.
Runtime error:
SAPSQL_HAVING_SUM_TYPE
Reason for error:
Search pattern not specified in a character literal.
Runtime error:
SAPSQL_LIKE_VAL_TYPE
Reason for error:
A token cannot be interpreted as a literal or in the current context of valid variable names.
Runtime error:
SAPSQL_WHERE_ILLEGAL_VALUE and SAPSQL_SET_ILLEGAL_VALUE
Reason for error:
A table name is too long.
Runtime error:
SAPSQL_TABNAME_TOO_LONG
Runtime error:
A field name is too long.
Runtime error:
SAPSQL_FIELDNAME_TOO_LONG
Reason for error:
No table exists with the specified name.
Runtime error:
SAPSQL_INVALID_TABLENAME
Reason for error:
A field name is ambiguous.
Runtime error:
SAPSQL_AMBIGUOUS_FIELDNAME
Reason for error:
No column exists with the specified name.
Runtime error:
SAPSQL_INVALID_FIELDNAME
Reason for error:
The specified table is not declared as a table or view in ABAP Dictionary.
Runtime error:
SAPSQL_NO_DBTAB_OR_VIEW
Reason for error:
An attempt was made to select the sum of a non-numeric field.
Runtime error:
SAPSQL_FIELDLIST_SUM_TYPE
Reason for error:
An attempt was made to select the average of a non-numeric field.
Runtime error:
SAPSQL_FIELDLIST_AVG_TYPE
Reason for error:
An attempt was made to create an aggregate function using a LOB column.
Runtime error:
SAPSQL_AGGREGATE_LOB
Reason for error:
An attempt was made to sort the values of a LOB column.
Runtime error:
SAPSQL_ORDER_BY_LOB
Reason for error:
An attempt was made to use the addition DISTINCT on a LOB column.
Runtime error:
SAPSQL_DISTINCT_AND_LOB
Reason for error:
An alias is too long.
Runtime error:
SAPSQL_ALIASNAME_TOO_LONG
Reason for error:
An attempt was made to group by the values of a LOB column.
Runtime error:
SAPSQL_GROUP_BY_LOB
Reason for error:
An attempt was made to use a LOB column in a logical expression.
Runtime error:
SAPSQL_BOUND_LONG_STRING
Reason for error:
A pattern specified with LIKE is too long.
Runtime error:
SAPSQL_LIKE_PATTERN_TOO_LONG and SAPSQL_LIKE_PATTERN_TOO_LONG
Reason for error:
An attempt was made to select from a non-transparent table using the addition DISTINCT.
Runtime error:
SAPSQL_ILLEGAL_DISTINCT
Reason for error:
A field, whose value is to be changed with + or -, has a non-numeric type
Runtime error:
SAPSQL_SET_PLUS_MINUS_TYPE
Reason for error:
LIKE is used with the addition ESCAPE on a pooled table.
Runtime error:
SAPSQL_ESCAPE_WITH_POOLTABLE
Reason for error:
A pooled table or cluster table is to be read using a secondary database connection.
Runtime error:
SAPSQL_CONNECTION_ILL_TABTYPE

CX_SY_DYNAMIC_OSQL_SYNTAX
Reason for error:
The keyword AND is missing after the lower comparison value of BETWEEN.
Runtime error:
SAPSQL_BETWEEN_MISSING_AND
Reason for error:
The logical expression has incorrect parentheses.
Runtime error:
SAPSQL_HAVING_PARENTHESES
Reason for error:
An unknown aggregate function was found.
Runtime error:
SAPSQL_ILLEGAL_AGGREGATE
Reason for error:
The operator IS NULL is not followed by the keyword NULL.
Runtime error:
SAPSQL_ILLEGAL_IS_NULL
Reason for error:
The operator IN has incorrect parentheses.
Runtime error:
SAPSQL_IN_ILLEGAL_LIST
Reason for error:
The logical expression contains a text field literal that does not have a closing quotation mark.
Runtime error:
SAPSQL_LIKE_QUOTES
Reason for error:
The logical expression ends unexpectedly.
Runtime error:
SAPSQL_MISSING_LOG_CONDITION
Reason for error:
The Escape character is missing after the addition ESCAPE.
Runtime error:
SAPSQL_WHERE_MISSING_ESCAPE
Reason for error:
An operator is missing in the logical expression.
Runtime error:
SAPSQL_WHERE_MISSING_OPERATOR
Reason for error:
A literal or name of an ABAP variable is missing in the logical expression.
Runtime error:
SAPSQL_WHERE_MISSING_VALUE
Reason for error:
The logical expression has incorrect parentheses.
Runtime error:
SAPSQL_WHERE_PARENTHESES
Reason for error:
The logical expression contains a text field literal that does not have a closing quotation mark.
Runtime error:
SAPSQL_WHERE_QUOTES
Reason for error:
An unknown operator is used in the logical expression.
Runtime error:
SAPSQL_WHERE_UNKNOWN_OPERATOR
Reason for error:
An alias is missing.
Runtime error:
SAPSQL_MISSING_ALIAS
Reason for error:
A column from the right side of a LEFT OUTER JOIN is used in a WHERE condition.
Runtime error:
SAPSQL_ACCESS_TO_RHS_TABLE
Reason for error:
Syntax error when the addition CREATING was specified dynamically.
Runtime error:
SAPSQL_NO_LOB_COLUMN
Runtime error:
SAPSQL_FOR_ALL_COLUMNS
Runtime error:
SAPSQL_TWICE_DEFINITION
Runtime error:
SAPSQL_UNION_POSSIBLE
Runtime error:
SAPSQL_MISSING_FOR_COLUMNS
Runtime error:
SAPSQL_OTHER_ONLY_AT_THE_END

The following exceptions can only occur when using the statement UPDATE:
Reason for error:
An attempt was made to change a database field using an operator other than + or -.
Runtime error:
SAPSQL_SET_NOT_PLUS_MINUS
Reason for error:
An unknown operator was used in the statement SET .
Runtime error:
SAPSQL_SET_UNKNOWN_OPERATOR
Reason for error:
A literal or name of an ABAP variable is missing in the statement SET.
Runtime error:
SAPSQL_SET_MISSING_VALUE
Reason for error:
The statement SET contains a text field literal, for which there is no closing quotation mark..
Runtime error:
SAPSQL_SET_QUOTES


Non-catchable Exceptions
Reason for error:
Invalid call of the database interface.
Runtime error: DBIF_RSQL_INVALID_REQUEST
Reason for error:
Insufficient memory is available for the statement.
Runtime error: DBIF_RSQL_NO_MEMORY
Reason for error:
Data area passed is too short for access to the table.
Runtime error: DBIF_RSQL_BUFFER_TOO_SHORT
Reason for error:
The structure of a table is inconsistent with the dictionary.
Runtime error: DBIF_RSQL_DDIC_INCONSISTENT
Reason for error:
The sort order specified for a table is not possible.
Runtime error: DBIF_RSQL_SORT_ORDER
Reason for error:
Error when accessing the buffer of a table.
Runtime error: DBIF_RSQL_BUFFER_ERROR
Reason for error:
A table is not known or does not exist.
Runtime error: DBIF_RSQL_TABLE_UNKNOWN
Reason for error:
Internal error when accessing a table.
Runtime error: DBIF_RSQL_INTERNAL_ERROR
Reason for error:
Unexpected return code when accessing a table.
Runtime error: DBIF_RSQL_UNEXPECTED_CODE