The OData Service model delivered in SAP Multichannel Foundation for Utilities and Public Sector is built via the SAP Gateway Service Builder (SEGW) tool. Depending on the business needs, the SAP Gateway service model can be extended on different levels:
1. OData entity structure extension (adding append structure with custom fields)Extending the Interface of an OData Entity Using Custom Fields
2. Addition of new OData entities
3. OData entity logic extension (for example, adding additional validations)SAP Multichannel Foundation for Utilities: Implement Custom Logic for an Existing Entity
The common situation a customer faces is that the customer would like to add new entity to existing service model.
In this blog, we will illustrate how to add new entity “ExternalAccountIdentification” to show Account identification. You can also refer to other two blogs mentioned above.
1. Start SEGW in the SAP CRM system and create a new service model project Z_CRM_UTILITIES_UMC_NEW.
2. Right click on Data Model, select Redefine OData service (GW).
3. Select CRM_UTILITIES_UMC as a service to be redefined.
4. Select all entities to be included in the new service
5.Create new entity (ExternalAccountIdentification) and entity set (ExternalAccountIdentifications).
6. Add association and navigation property from Account entity so that ExternalAccountIdentifications can be accessed via navigation from Account Entity.
Navigation Property: Identifications
Association: Account_ExternalAccountIdentifications
7. Save and activate the model service.
8.Create implementation class for newly created entity. You have to inherit the abstract class CL_CRM_IU_UMC_ODATA_ABSTRACT
9. Create new BAdI implementation using the implementation class created in the previous step and give the filter value “ExternalAccountIdentification”(Entity Name).
10. In SAP Gateway system, add and activate backend service.
11. You can use the advanced REST client to test your newly created entity. You can add your username and password in the Authorization header.