SAP CONSUME BS ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS - Consuming Business Services with Demo Class
This example demonstrates how the OData data of business services can be consumed in ABAP with a demonstration class.

ABAP_SOURCE_CODE
DEMO CL_DEMO_CONSUME_BS_SIMPLE

ABAP_DESCRIPTION
Business services are designed mainly for accessing AS ABAP from outside, however for demonstration purposes here, an ICF client implemented in ABAP is used to read the ICF nodes of business services. The ICF client is implemented in the class CL_DEMO_BS_CONSUMPTION that offers some methods for examining the OData data of service bindings whose names are passed by parameter:
Several methods are available for reading URLs for use in browsers.
One method reads the non-handled OData data in XML or JSON format.
One method extracts important metadata to internal tables.
One method extracts the actual data to internal tables.
The class CL_DEMO_CONSUME_BS_SIMPLE shown above uses the class to extract the data of individual CDS entities exposed in service definitions to internal tables and display it. The class CL_DEMO_BS_SIMPLE_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.
Further example classes are:
CL_DEMO_BS_URLS gets the URLs of service bindings.
CL_DEMO_BS_ODATA gets the unhandled OData data of service bindings.
CL_DEMO_BS_META_DATA gets important metadata as the content of internal tables.
CL_DEMO_CONSUME_BS_WITH_PARAMS demonstrates parameter passing to exposed CDS entities with input parameters.
CL_DEMO_CONSUME_BS_WITH_ASSOCS demonstrates how paths are specified for exposed CDS entities joined using associations.
The defaults for the input parameters of the class access service definitions and service bindings that were created for these demonstrations. These service bindings use the OData protocol (version 2) for Web APIs.



Latest notes:

NON_V5_HINTS
See also Consuming Business Services with Client Proxy
ABAP_HINT_END