Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  AMDP - ABAP Managed Database Procedures →  AMDP Macros 

AMDP - Macro for Logical Schemas

Other versions: 7.31 | 7.40 | 7.54

Syntax


... "$ABAP.schema( [name =] schema_name 
                   [quote = SINGLE|DOUBLE] )" ...

Effect

Specifies the predefined AMDP macro $ABAP.schema for a logical schema.

In an AMDP method implemented in SQLScript, a full qualified name can be specified to access objects in a different database schema. Here, the AMDP framework supports the logical schemas for the SAP HANA database. The AMDP macro $ABAP.schema can be used to specify a logical schema to which a physical name is mapped instead of the physical name of a database schema.

  • If an explicit name of a physical database schema is mapped to the logical schema specified using schema_name, the ABAP runtime environment replaces this expression (including the quotation marks) with the physical database schema in the implementation on the database. The specified logical schema is not case-sensitive, but the mapped physical database schema is. When replaced, the physical database schema is set in double quotation marks by default if required. This can be overwritten by the optional addition quote. If SINGLE is specified, the physical database schema is always set in single quotation marks. DOUBLE is the default behavior.
  • If the predefined name :abap_db_schema is used to map the current ABAP database schema to a logical database schema specified using schema_name, the ABAP runtime environment removes the full database schema and the current ABAP database schema is accessed implicitly. In this case, the optional addition quote cannot be specified using SINGLE, since this would enclose the empty content in single quotation marks.

The specified logical schema must exist as a logical database schema or as a logical HDI container. If a physical database schema is mapped to the logical schema, the physical schema must exist on the current database. If no physical database schema is mapped to the logical schema, a syntax check warning occurs. When the AMDP method is executed, an exception of the class CX_AMDP_DBPROC_GENERATE_FAILED is raised.

If the mapping of the ABAP database schema is allowed for a logical database schema, the addition USING SCHEMA must be specified for the logical database schema in the implementation of the AMDP method.


Notes

  • When database objects in the current database schema are accessed, the name of this schema cannot be specified explicitly (either directly or using logical schemas) More specifically, the logical schema with the predefined name SAP_ABAP cannot be used. A logical database schema to which the ABAP database schema is mapped using the predefined name :abap_db_schema can, however, be used.

  • If a logical database schema is deleted or the mapping of a physical database schema is modified, the ABAP runtime environment checks all consumer AMDP classes.

Executable Example

Access to Database Schemas