Sub topic 2
Clients as the unit of business data separation
This chapter assumes you can log on with SAP GUI and run transactions. It also assumes you know what a database table and its key are. It builds on the previous chapter's split between Customizing and Workbench changes.
What a client is
A client is a self-contained business unit inside one SAP system. Each client has its own master data, transaction data, user master records, and Customizing settings. You choose a client at logon with a three-digit number such as 100, and everything you see afterwards belongs to that client.
Several clients can share one system. They share the installation, the database, and the ABAP Repository, which holds programs, function modules, and table definitions. They do not share business data.
How the client appears in the data
In the database, a client-dependent table has a first key field, usually MANDT, that holds the client number. Every row belongs to exactly one client. In ABAP, Open SQL fills in the client condition for you, so a program only sees rows for the current logon client.
REPORT zdemo_current_client.
WRITE: / 'System ID: ', sy-sysid,
/ 'Logon client:', sy-mandt.
SELECT COUNT( * ) FROM t001 INTO @DATA(company_code_count).
WRITE: / 'Company codes in this client:', company_code_count.Run this in two clients of the same system and the count can differ, even though the program is identical. The program is a repository object and is shared. The company codes are data and belong to the client.
Why clients matter for Customizing
Configuration lives in tables, so it is separated by client too. This lets one development system hold several clients with different purposes. A common layout is:
| Client role | Typical use |
|---|---|
| Customizing client | Configuration is changed here and recorded in requests |
| Sandbox client | Free experimentation, changes are not transported |
| Unit test client | Testing with sample data |
| Production client | Live business data, configuration locked |
Separation also has limits. A client is not a security boundary against someone with administrator rights at system level. Some data is stored once for the whole system and affects every client. That is the subject of the next chapter.
Where the client concept leads next
Two questions follow from this model. First, which tables are client-dependent and which are cross-client? Second, what controls whether changes in a given client are recorded for transport? The following chapters take those in turn, starting with client dependency and then the client settings in SCC4.
Exercise
A report that selects from client-dependent table T001 gives different row counts in clients 100 and 200 of the same system. The code is identical. Why?
Show answer
The program is a repository object shared by all clients, but T001 holds business data separated by client. Open SQL restricts the selection to the current logon client, so each client returns its own company codes.