You can use Open SQL to store character strings and binary
data as strings in database columns. There are two kinds of strings in the database, short strings
and long strings, which differ in the form of how the data is stored in the database. Whether a string column is a short or a long string, is specified in the ABAP Dictionary.
Short strings are only available for character strings (DDIC type SSTRING).
They are normally implemented as VARCHAR fields in the database and stored in the data record. Short
strings must always have a length restriction in the ABAP Dictionary which cannot exceed 255 characters. Trailings spaces are ignored by the database.
In Open SQL statements, you can use short strings wherever you can use C fields.
Long strings (also: "LOBcolumns") are available for character strings (DDIC type
STRING) and binary data (DDIC type RAWSTRING).
They are normally implemented as LOB in the database. The system only stores an LOB locator in the data
record while the actual string data is stored outside the data record. You can define a length restriction
for long strings in the ABAP Dictionary. For columns of the type STRING, trailing spaces are retained.
Long strings are subject to the following restrictions:
It is possible for long strings and mandatory for short strings to define a length restriction for them in the ABAP Dictionary. If this restriction is violated when data is written to the database, the system triggers an exception of the class CX_SY_OPEN_SQL_DB. Any truncation of the string when data is read from the database into a target field is ignored. You can get the value of the length restriction using the function DBMAXLEN( ).
Since the data of long strings is stored outside the data record, access to long strings is slower than to other data types. This applies particularly to set operations. This note is not applicable if you use short strings.