TDV SQL Support for SAP ABAP Queries
The following sections describes how SAP ABAP queries work within TDV:
Introspection and ABAP Queries
Introspection examines SAP for its list of ABAP queries and InfoSets, allows the user to select them, and translates their metadata to relational tables that TDV understands. The resource hierarchy and metadata mapping of ABAP queries is explained here.
Resource Hierarchy
The SAP Adapter provides ABAP Queries and InfoSets as resources in TDV. In general, any ABAP query that can be executed via transaction SQ01 and output using the SAP List Viewer can be accessed through TDV.
ABAP queries are introspected by expanding the ABAP Queries folder within an SAP data source. The first level of folders separates ABAP queries into Global (cross-client) or Standard (client-specific). The second level of folders separates ABAP queries by their functional areas.
Infosets are introspected by expanding the InfoSets folder within an SAP data source. In general, any InfoSet in transaction SQ01 that can be used in an InfoSet query can be accessed through TDV.
Infosets are introspected by expanding the InfoSets folder within an SAP data source. The first level of folders separates InfoSets into Global (cross-client) or Standard (client-specific).
Metadata Mapping
Translating metadata from ABAP queries to TDV ABAP query resources is straightforward. Each output field of the ABAP query becomes a column in TDV with the same name. Selection fields in the ABAP query also become columns in TDV, but their name is prefaced with an underscore character to indicate their role as specifiers of filter constraints to SAP.
Each data type in SAP is mapped to a TDV SQL-based type. The following table lists the SAP data types found in ABAP queries, whether they are supported in TDV, and their corresponding TDV type.
SQL Data Type Name | ABAP Type | Supported in TDV? | TDV Data Type |
CHAR, UNIT, CUKY, CLNT, LANG, LCHR, VARC | C | Yes | VARCHAR |
DATS | D | Yes | DATE |
FLTP | F | Yes | DOUBLE |
STRING, XSTRING | g, y | No – not supported by ABAP queries | |
INT4, INT2, INT1 | I | Yes | BIGINT |
NUMC | N | Yes | VARCHAR |
CURR, QUAN, DEC, PREC | P | Yes | DECIMAL, NUMERIC |
TIMS | T | Yes | TIME |
LRAW, RAW | X | No – not supported by ABAP queries | |
Capabilities and ABAP Queries
Capabilities determine how a SQL statement will be divided between SAP, TDV, and other data sources that may be referenced in the query.
The following table lists commonly used capabilities and how they apply to SAP ABAP queries. Supported indicates whether or not the SQL capability is supported in queries against ABAP queries. Pushed indicates whether the capability is supported directly on SAP. For efficient queries, minimize use of non-push capabilities.
Capability | Supported? | Pushed? | Notes |
CASE | Yes | No | |
DELETE | No | No | ABAP queries and InfoSets are read-only. |
DISTINCT | Yes | No | |
Filter | Yes | Yes | |
Filter–BETWEEN | Yes | Yes | |
Filter–IN | Yes | Yes | |
Filter–LIKE | Yes | No | |
Functions–aggregate | Yes | No | |
Functions–CAST | Yes | Yes | |
Functions–others | Yes | No | |
GROUP BY | Yes | No | |
INSERT | No | No | ABAP queries and InfoSets are read-only. |
Join | Yes | No | |
ORDER BY | Yes | No | |
Subquery | Yes | No | |
Transactions | No | No | ABAP queries and InfoSets are read-only. |
UNION | Yes | No | |
UPDATE | No | No | ABAP queries and InfoSets are read-only. |