Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CLIENT SPECIFIED

i saw two statements in SAP abap objects performance examples(access through SE38):

SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA

WHERE CARRID = 'LH'

AND CONNID = '0400'.

ENDSELECT.

Runtime: 2.689.736 microseconds

______________________________________________

SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA

WHERE MANDT IN ( SELECT MANDT FROM T000 )

AND CARRID = 'LH'

AND CONNID = '0400'.

ENDSELECT.

Runtime: 81.329 microseconds

And usually wo do not have to specify the field "MANDT", and does the field really work like the above way?

replied

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-dependent application 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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question