Ansicht
Dokumentation

ABENOPEN_SQL_CLIENT_HANDLING - OPEN SQL CLIENT HANDLING

ABENOPEN_SQL_CLIENT_HANDLING - OPEN SQL CLIENT HANDLING

ROGBILLS - Synchronize billing plans   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- Client Handling

As a term, client handling describes the way application data in a client is handled. Client handling is generally employed to restrict user access to the application data to only the client whose client ID was specified in the logon. uses implicit client handling. This method of client handling specifies that statements handle the client column in a special way when client-specific data sources are accessed:

  • Instead, the SQL statements passed to the database by the ABAP SQL interface contain an additional condition for the client column.

  • Furthermore, joins between client-specific data sources insert an ON condition that checks the client columns for equality.

  • The variants of the write statements INSERT, UPDATE, MODIFY, and DELETE, which use data from work areas, internal tables, or subqueries specified after FROM, ignore their client columns and the value is set by instead.

Implicit client handling uses the client ID of the current client by default. This ID is also in the system field sy-mandt.

  • The condition passed implicitly in selections checks the content of the client column for equality with the client ID of the current client.
  • In write statements, uses the client ID of the current client for the client column of the target instead of the values of the client column of the work areas, internal tables, or subqueries specified after FROM.

This means that uses only the data of the current data by default and this does not need to be specified explicitly by the developer. Implicit client handling can, however, also be switched from the default current client to other clients using additions of the statements. The cases described above must also be distinguished here:

  • The implicit condition of queries and the write statements UPDATE SET and DELETE FROM can be switched from the current client to other clients as follows:
  • The addition USING CLIENT of the SELECT statement and the addition USING CLIENT of the write statements are used to specify the client ID from the addition instead of the current client ID. Implicit client handling works as if the current user is logged on with the specified client ID.

  • The additions USING $[ALL$] CLIENTS $[IN$] of the SELECT statement and USING $[ALL$] CLIENTS $[IN$] of the write statements are used to replace the equality condition for a client with different conditions for multiple clients (or remove it completely). The condition is then polyvalent instead of monovalent.

In both cases, the joins of queries preserve the additional implicit ON condition.
  • The value set implicitly for the client column of the work areas, internal tables, or subqueries specified after FROM in write statements can be switched from the current client to other clients as follows:
  • uses the addition USING CLIENT to specify the client ID from the addition instead of the current ID. Implicit client handling works as if the current user is logged on with the specified client ID.

  • If specifies the addition CLIENT SPECIFIED, no replacement takes place. The values of the client column of the work areas, internal tables, or subqueries specified after FROM are used. In internal tables and subqueries, there may be multiple client IDs.

Alongside the case of write statements with data sources after FROM (described above), the addition CLIENT SPECIFIED can also be used instead of USING in the other cases. This use is obsolete in queries and obsolete in the write statements UPDATE SET and DELETE FROM. The addition CLIENT SPECIFIED disables implicit client handling in full in these statements. This means that no implicit WHERE condition is created for the client column and no ON condition is created between the client columns in joins. The client column in the SQL conditions of the statements, on the other hand, can or must itself be evaluated. Disabling implicit client handling in this way is prone to errors and hence not recommended. The USING additions for switching implicit handling should be used instead.

Client Handling

Notes

  • The client data from an AS ABAP is represented in self-contained units. No cross-client access to databases should take place in application programs. This is why the additions USING and CLIENT SPECIFIED should never be used here. If is used, there is generally no need to access sy-mandt in application programs either.
  • For information about accessing client-specific CDS entities, see the following descriptions:

  • The DDIC database table T000 contains the potential client IDs in AS ABAP. Client columns of application tables should contain only those client IDs specified in T000. This is not, however, checked by .
  • True multitenancy, with which the system ensures that different tenants' application data is isolated from each other, is not supported by the ABAP runtime environment in the current release.
  • Native SQL and AMDP do not implement implicit client handling. The current client must always be specified explicitly here.





CPI1466 during Backup   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 9411 Date: 20240425 Time: 101140     sap01-206 ( 140 ms )