Open SQL: Sy-Subrc Sy-Subrc Contains Sy-Dbcnt
Open SQL: Sy-Subrc Sy-Subrc Contains Sy-Dbcnt
MODIFY Inserts lines into database tables or changes the contents of existing lines
Return Codes
All Open SQL statements fill the following two system fields with return codes:
sy-subrc
After every Open SQL statement, the system field sy-subrc contains
the value 0 if the operation was successful, a value other than 0 if not.
sy-dbcnt
After an open SQL statement, the system field sy-dbcnt contains the
number of database lines processed.
Client Handling
A single SAP system can manage the application data for several separate
areas of a business (for example, branches). Each of these commercially
separate areas in the SAP system is called a client, and has a number. When
a user logs onto the SAP Web AS ABAP, they specify a client. The first
column in the structure of every database table containing application data is
the client field (MANDT, from the German word for client). It is also the first
field of the table key. Only universal system tables are client-independent, and
do not contain a client name.
By default, Open SQL statements use automatic client handling. Statements
that access client-dependentapplication tables only use the data from the
current client. You cannot specify a condition for the client field in
the WHERE clause of an Open SQL statement. If you do so, the system will
either return an error during the syntax check or a runtime error will occur.
You cannot overwrite the MANDT field of a database using Open SQL
statements. If you specify a different client in a work area, the ABAP runtime
environment automatically overwrites it with the current one before processing
the Open SQL statement further.
Should you need to specify the client specifically in an Open SQL statement,
use the addition
... CLIENT SPECIFIED ....
directly after the name of the database table. This addition disables the
automatic client handling and you can use the field MANDT both in
the WHERE clause and in a table work area.
Reading data
Changing data
Performance Notes