Ansicht
Dokumentation
ABENAMDP_FUNCTIONS_ABEXA - AMDP FUNCTIONS ABEXA
rdisp/max_wprun_time - Maximum work process run time CL_GUI_FRONTEND_SERVICES - Frontend ServicesThis documentation is copyright by SAP AG.
- AMDP Functions
This example demonstrates AMDP functions and how they are used.
Source Code
Description
This example accesses AMDP functions that are declared and implemented in the AMDP class CL_DEMO_AMDP_FUNCTIONS_INPCL.
- The method GET_SCARR_SPFLI is an AMDP function implementation for an AMDP table function that can only be called in other AMDP methods. It has an explicitly declared interface.
- This method cannot be called in ABAP.
- The method SELECT_GET_SCARR_SPFLI is an AMDP procedure implementation that uses SELECT to access the AMDP table function implemented in the method GET_SCARR_SPFLI.
- This method is called in the example program.
- The method GET_SCARR_SPFLI_FOR_CDS is an AMDP function implementation for the CDS table function DEMO_CDS_GET_SCARR_SPFLI_INPCL, which is also shown as an example of the DDL statement DEFINE TABLE FUNCTION:
- This method is declared using the addition FOR TABLE FUNCTION and its interface is determined using the CDS table function.
- The example program uses SELECT to access the CDS table function. The input parameter is filled here. Access to both AMDP table functions produces the same result, which is ensured by the ASSERT statement.
- The method GET_MAX_FLTIME_SPFLI is an AMDP function implementation for an AMDP scalar function. It has an explicitly declared interface and can be called in ABAP.
- In the example program, a WHERE condition of a SELECT statement contains a host expression with a functional method call of this ADMP function implementation.
- The method SELECT_SPFLI_BY_MAX_FLTIME is an AMDP procedure implementation where the AMDP scalar function that is implemented in the method GET_MAX_FLTIME_SPFLI is called in its SELECT statement in the WHERE condition.
- This method is called in the example program. The preceding statement and the method call have the same result, which is ensured by the ASSERT statement.
Note
The CDS table function DEMO_CDS_GET_SCARR_SPFLI_INPCL used here has an input parameter for the client, annotated using the annotation @Environment.systemField and the predefined value #CLIENT. This input parameter is filled explicitly with the ID of the current client by the statement SELECT and used in the implementation of the associated AMDP method for selecting the data. The nearly identical program DEMO_AMDP_FUNCTIONS uses the following CDS table function DEMO_CDS_GET_SCARR_SPFLI in which the current client is selected from the result set of the table function.
BAL Application Log Documentation Vendor Master (General Section)
This documentation is copyright by SAP AG.
Length: 4958 Date: 20240423 Time: 191300 sap01-206 ( 65 ms )