Ansicht
Dokumentation

ABENCDS_SERVICE_BINDINGS - CDS SERVICE BINDINGS

ABENCDS_SERVICE_BINDINGS - CDS SERVICE BINDINGS

Fill RESBD Structure from EBP Component Structure   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- Service Bindings

A service binding is a repository object defined in a form-based ABAP Development Tool (ADT) that binds a service definition in ABAP CDS with a RESTful protocol and provides it as a business service to be used outside of AS ABAP.

Different variants of OData can be used as the RESTful protocol:

  • OData in versions 2 and 4
  • OData for UIs or Web APIs
  • OData for UIs is designed for access to business services using UI technologies like SAPUI5. The data provided by a business service contains control elements for user interfaces. These elements are themselves defined by framework-specific annotations in the CDS entities in question.

  • OData for Web APIs is limited to the data-only content of the business services and does not contain any control elements for user interfaces.

The Information Access (InA) protocol can be used for analytical queries.

When a service binding is activated, it makes the business service accessible in accordance with the protocol used. This involves using internal frameworks such as SAP Gateway and the RAP query engine to generate the objects in question. ICF services visible in transaction SICF are created to provide access to the OData-based data outside AS ABAP:

  • The ICF node of a service binding is /sap/opu/odata/sap/SB_NAME, where SB_NAME is the name of the service binding in uppercase letters.
  • A client can access the ICF node and use it for reads in accordance with the OData protocol, for example as follows:
  • Access to the metadata of the OData service

.../sap/opu/odata/sap/SB_NAME/$metadata
  • Access to the data of a CDS entity cds_entity exposed in the service definition:

.../sap/opu/odata/sap/SB_NAME/cds_entity
  • Passing formal parameters to CDS entities with input parameters

.../sap/opu/odata/sap/SB_NAME/cds_entity(p1=...,p2=...,...)
  • Path specified for CDS entities with CDS associations whose association targets are exposed in the service definition

.../sap/opu/odata/sap/SB_NAME/cds_entity?$expand=to.../to...
  • If the service binding for the root entity of a RAP business object is defined by the CDS behavior definition and behavior pools, transactional HTTP POST requests can be used to access the ICF node. The internal frameworks are responsible for calling the methods of the handler classes in the behavior pools in the correct order.

When a service binding is activated, the service definition used is checked to verify whether it meets the requirements of the internal underlying framework. The following restrictions currently apply:

  • The CDS entities of the service definition must have at least one key field.
  • The cardinality of CDS associations must be defined correctly.
  • No service binding can be defined for service definitions that expose CDS abstract entities.
  • The input parameters of the CDS entities must be typed with reference to data elements. A direct typing with built-in dictionary types is not allowed.
  • Depending on the OData version, not all data types are supported for the elements of the CDS entities.
  • The names of actions defined in CDS BDL cannot produce naming conflicts and cannot exceed a certain length, as specified by the OData version.
  • The parameter structure of actions defined in CDS BDL cannot overlap with the key fields of the CDS entity.

Notes

  • Once a service binding is activated, the form-based ABAP Development Tool (ADT) shows the associated URL and enables comprehensive testing of the service.
  • SAP Gateway offers OData client proxies in order to access OData data of an AS ABAP. These are of special use for OData data of business services.

See Consuming Business Services.






PERFORM Short Reference   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 8127 Date: 20240420 Time: 084217     sap01-206 ( 79 ms )