ABAP Keyword Documentation → ABAP − Reference → Processing External Data → ABAP Database Access → AMDP - ABAP Managed Database Procedures → AMDP - Methods → METHOD - BY DATABASE PROCEDURE, FUNCTION → AMDP - SQL Script for the SAP HANA Database
AMDP - Mapping of ABAP Types to SQLScript
As shown in the following tables, the elementary ABAP types are mapped to the appropriate types in SQL Script. These include:
- Interface parameters of a AMDP method
- References to ABAP types using the AMDP macro $ABAP.type
The tables distinguish parameters that reference a type defined in ABAP from those that reference a built-in type in ABAP Dictionary. No parameters or type references can be defined for SQL Script types that are not listed here.
Other versions:
7.31 | 7.40 | 7.54
Mapping with Reference to Types Defined in ABAP
Numeric Types
ABAP Type | HANA Type | Note |
---|---|---|
b |
SMALLINT | SMALLINT is a two byte integer with sign |
s |
SMALLINT | SMALLINT is a two byte integer with sign |
i |
INTEGER | - |
int8 |
BIGINT | - |
p , length leng with dec decimal places |
DECIMAL, length 2len-1 with dec decimal places |
- |
decfloat16 |
VARBINARY, length 8 | Cannot be interpreted as a number in the database and no calculations can be performed |
decfloat34 |
VARBINARY, length 16 | Cannot be interpreted as a number in the database and no calculations can be performed |
f |
DOUBLE | - |
Character-Like Types
ABAP Type | HANA Type | Note |
---|---|---|
c , length len |
NVARCHAR, length len |
- |
string |
NCLOB | Not permitted for input/output parameters |
n , length len |
NVARCHAR, length len |
A suitable casting to a numeric database type must be performed before calculations can be made in the database. Numeric results must be transformed back to the ABAP format. |
Byte-Like Types
ABAP Type | HANA Type | Note |
---|---|---|
x , length len |
VARBINARY, length len |
- |
xstring |
BLOB | Not permitted for input/output parameters |
Date Types, Time Types, and Time Stamp Types
ABAP Type | HANA Type | Note |
---|---|---|
d |
NVARCHAR, length 8 |
A casting to the DATE type of the database must be performed before date calculations can be made. SQL Script offers the built-in function to_dats . |
t |
NVARCHAR, length 6 |
A casting to the TIME type of the database must be performed before time calculations can be made. SQL Script offers the built-in function to_tims . |
utclong |
TIMESTAMP | - |
Mapping with Reference to Types Defined in ABAP Dictionary
The built-in types in ABAP Dictionary are mapped like the associated ABAP types, with the following exceptions.
Dictionary Type | HANA Type | Note |
---|---|---|
DECFLOAT16 | SMALLDECIMAL | Recommended mapping |
DECFLOAT34 | DECIMAL | Recommended mapping |
DF16_DEC, length leng with dec decimal places |
DECIMAL, length 2len-1 with dec decimal places |
Value range on the database is less than in ABAP |
DF34_DEC, length leng with dec decimal places |
DECIMAL, length 2len-1 with dec decimal places |
Value range on the database is less than in ABAP |
DF16_SCL | - | Obsolete, not supported |
DF34_SCL | - | Obsolete, not supported |
DATN | DATE | Recommended mapping |
TIMN | TIME | Recommended mapping |
GEOM_EWKB | ST_GEOMETRY | Recommended mapping |
SSTRING, length len |
NVARCHAR, length len |
- |
Note
In the recommended mappings, the ABAP type should be defined with reference to the built-in ABAP Dictionary type to define the more suitable HANA type.