The OData Service model delivered in SAP Multichannel Foundation for Utilities is built via the Gateway Service Builder (SEGW) tool. Depending on the business needs, the Gateway service model can be extended on different levels:
In this blog post, we will illustrate the last point, in other words, how to extend the logic of an existing entity.
In a nutshell
Behind each OData Service in the back end, SAP Gateway runtime generates a Model Provider and a Data Provider.
It can be enhanced via the Gateway Service Builder (SEGW) transaction.
Please take a look at the diagram to get familiar with a standard processing for HTTP requests in the Data Provider.
To overwrite standard OData entity behavior and introduce custom logic, create a new BAdI implementation with the required filter value. This implementation is then called instead of the standard one. The BAdI definition is based on the interface IF_CRM_IU_UMC_ODATA_BADI. However, there are other interfaces that your implementation needs to support, so you should inherit from the MFU standard class. After that, your implementation can be initiated and invoked successfully by the standard Data Provider class (CL_CRM_UTILITIES_UMC_DPC_EXT).
Example with a step by step explanation
SAP Multichannel Foundation for Utilities delivers an OData Service model which returns all the service contracts for an online user. Since an online user may have many contracts, including cancelled and expired ones, the standard logic removes all those and only returns the currently active contracts. As an example, let’s say that you want to change this logic so all the service contracts will be returned for the online users, and then you can do the following:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.