Skip to Content
avatar image
Former Member

Does the field "MANDT" work?

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 31, 2008 at 11:56 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 01, 2008 at 01:39 PM

    Did you execute the examples twice?

    My assumption is, that the second select was much faster due to the data being buffered in the database RAM from the first select.

    Add comment
    10|10000 characters needed characters exceeded