Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPOPEN_SQL_TARGET - OPEN SQL TARGET

ABAPOPEN_SQL_TARGET - OPEN SQL TARGET

CPI1466 during Backup   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

Syntax

... dbtab $|view$|(target_syntax)  $[USING CLIENT clnt$] $| $[CLIENT SPECIFIED$] ...

Alternatives:

1. ... dbtab$|view

2. ... (target_syntax)

Additions

1. ... USING CLIENT clnt

2. ... CLIENT SPECIFIED

Effect

The entries in target determine, statically or dynamically, which database table or which view is accessed, and control client handling. Only views whose key fields are located together at the beginning of the view can be accessed.

Note

Write access to tables or classic views with replacement objects is still performed on the database table or the classic view and lead to a syntax warning.

Alternative 1

... dbtab$|view


Effect

dbtab can be a database table defined in ABAP Dictionary and view can be a classic view .

Only views that refer to a single database table, and whose status in ABAP Dictionary permits changes can be specified. No external views or CDS entities can be specified.

Note

Alternative 2

... (target_syntax)


Effect

Instead of specifying an object statically, a parenthesized data object target_syntax can be specified that must contain the name of the database table or the view when the statement is executed. A character-like data object or a standard table with a character-like row type can be specified for the data object target_syntax. The syntax in target_syntax is not case-sensitive, as in ABAP Editor. Invalid syntax raises a handleable exception from the class CX_SY_DYNAMIC_OSQL_ERROR. See SQL Injections Using Dynamic Tokens.

Note

When specified dynamically, statements can contain the comment characters * and " as follows:

  • In a dynamic token specified as a character-like data object, all content is ignored from the first comment character ".
  • In a dynamic token specified as an internal table, all rows are ignored that start with the comment character *. In the row, all content is ignored from the first comment character ".

Addition 1

... USING CLIENT clnt

Effect

This addition modifies automatic client handling in so that the client ID from clnt is used instead of the current client ID. The ABAP runtime environment passes the ID of the client specified in clnt to the database system, and not the ID of the current client or the client specified in source.

clnt expects a data object of the type c with length 3 and containing a client ID. A literal or a host variable can be specified, prefixed by an escape character @. The addition can only be used when changing a client-specific table or a view and not together with the addition CLIENT SPECIFIED. If specified, the system field sy-mandt would be ignored and cannot be specified directly for clnt.

Notes

  • If the addition USING CLIENT is used, the statement functions as if the current user were logged on with the client ID specified in clnt.
  • If clnt contains a client ID for a nonexistent client, the SQL statement is executed with this ID and is hence ignored.
  • If the database table or view is specified statically, the addition USING CLIENT in SELECT can always be specified. If client-dependency does not apply, the addition is ignored.
  • The addition USING CLIENT is not allowed in the obsolete short forms.
  • When the addition USING CLIENT, the syntax check is performed in a strict mode, which handles the statement more strictly than the regular syntax check.
  • Since each client represents a complete unit, automatic client handling should never be switched in application programs.
  • If access to the data of a different client is required, USING CLIENT should be used instead of CLIENT SPECIFIED, since in this case all necessary conditions are set implicitly.
  • The addition USING CLIENT is not permitted when accessing global temporary tables.
  • See also the associated security note and the programming guideline.


Addition 2

... CLIENT SPECIFIED

Effect

This addition deactivates automatic client handling in . It can be specified only when accessing client-specific database tables or views and cannot be combined with USING CLIENT. If the addition CLIENT SPECIFIED is used, the client ID specified in source is respected. Without the addition CLIENT SPECIFIED, the ABAP runtime environment does not pass the client ID specified in source to the database system, but passes the ID of the current client instead.

Notes

  • Since each client represents a complete unit, automatic client handling should never be turned off in application programs.
  • If data has to be accessed in a different client, USING CLIENT should be used instead of the addition CLIENT SPECIFIED, since all necessary conditions are set implicitly and accessing client-specific CDS entities is more simple.
  • If the database table or view is specified dynamically, the addition CLIENT SPECIFIED can always be specified. If client-dependency does not apply, the addition is ignored.
  • See also the associated security note and the programming guideline.
  • The addition CLIENT SPECIFIED is not permitted when accessing global temporary tables.
  • If specified for client-specific database tables or views, the addition CLIENT SPECIFIED produces a syntax error in the strict modes of the syntax check from Release 7.40, SP05 or else a syntax warning.





ROGBILLS - Synchronize billing plans   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 9049 Date: 20230206 Time: 104210     sap01-206 ( 128 ms )