SAP CDS CUSTOM QUERY ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS_DDL - DEFINE CUSTOM ENTITY, Implementing a CustomQuery
This example demonstrates how an ABAP method can be used for data provisioning in a CDS custom entity.

ABAP_SOURCE_CODE
DEMO CL_DEMO_CONSUME_BS_CSTM_QUERY

ABAP_DESCRIPTION
The CDS custom entity DEMO_CDS_CUSTOM_ENTITY is bound to the ABAP class CL_DEMO_CUSTOM_ENTITY_QUERY. This class implements the interface IF_RAP_QUERY_PROVIDER and generates an internal table with newly created UUID values. The number of UUID values can be passed as parameter.
The example accesses the CDS custom entity DEMO_CDS_CUSTOM_ENTITY and fills it with data using the service binding DEMO_SB_CUSTOM_QUERY, which binds the service definition DEMO_SD_CUSTOM_ENTITY to an OData node in ICF. This is done using the demonstration class CL_DEMO_BS_CONSUMPTION, which accesses the OData service of the service binding by using an ICF client.
Class CL_DEMO_BS_CUSTOM_QUERY_URL displays a URL that can be copied and pasted to a web browser in order to display the OData data in XML or JSON format.
It should be noted that no data is queried from the database in this example and that the data is generated from ABAP only.