Skip to Content

Business Partner OData API  is available on the SAP API Business Hub. This API can be used to maintain master data related to Business Partner, Customer and Supplier entities.

There are standard fields available in the delivered service, but sometimes these fields do not suffice the business requirements and there may be a need to extend it.

This blog explains the addition of custom fields to the standard OData API for Business Partner (API_BUSINESS_PARTNER).

The extensibility feature is supported from SAP S/4HANA Cloud 1708 Edition.

Currently, custom fields can be added to the following list of entities in the OData Service API_BUSINESS_PARTNER.

Entity Business Context Description
A_BusinessPartner Business Partner Core View
A_CustomerCompany Customer company code core
A_CustomerSalesArea Customer Sales Core
A_Customer Customer Core View
A_SupplierCompany Supplier Company Code Core
A_SupplierPurchasingOrg Supplier Purchasing Org Core
A_Supplier Supplier Core View

(An entity in the OData service corresponds to a Business Context which has to be used when a field has to be extended. This Business Context is also associated with a database include, added to the respective master data tables.)

Custom Fields and Logic” app available on SAP Fiori Launchpad is used to extend the OData entities.

Using this app, it is possible to:

  • Create,Edit and Delete the custom fields (extend the SAP table, application, CDS views and OData services)
  • Manage the usage of a custom field on UIs, reports, forms, service interfaces, processes (data flows), search etc.

 

Procedure:

1. Log on to the SAP Fiori Launchpad with a user assigned with Business Catalog SAP_CORE_BC_EXT.

2. Select the app “Custom Fields and Logic”.

 

3. Click the ‘+’ (plus sign) button to add a new field. When the popup opens, select the appropriate Business Context from the above table, depending on the entity to be extended (here I want to extend the entity A_BusinessPartner). Fill other necessary details like label, type etc.

4. Click “Create and Edit” button.

 

4. In the tab “UIs and Reports” select the OData model (API_BUSINESS_PARTNER  0001 in this case) for which the field has to be extended and click on “Enable Usage” button.Click “Save” and “Publish” buttons.

 

5. Once the extended field “YY1_TEST_EXT_DEMO_bus” is successfully published, it will be part of the metadata of the OData service and the corresponding database include.

 

6. There is no explicit coding required for implementing CRUD operations on these extended fields.

It is possible to maintain the values of these extended fields using appropriate HTTP methods, just like other standard fields.

For Example,

1)  Creation of a new Business Partner with the extended field.

  • Use ‘POST’ method to create a Business Partner
  • URI: https://{system_path}/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner
  • Json: {
    “BusinessPartnerCategory” : “2”,
    “OrganizationBPName1” : “SAP”,
    YY1_TEST_EXT_DEMO_bus” : “demo_value”}

2) Update an existing Business Partner with the extended field.

  • Use ‘PATCH’ method to update the Business Partner.
  • URI: https://{system_path}/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner({‘BusinessPartner’})
  • Json: {“YY1_TEST_EXT_DEMO_bus” : “demo_value”}

 

For more information please refer to these resources :

 

 

In case of any queries, please feel free to contact me or Pavan Kumar K S.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. parimi suryasairam

    Hi Mansi,

    Thanks for the blog.

    I followed the same steps which is available in the document and created new field successfully using Custom fields and logic App.

    After completion of the above steps, I am trying to see the output in browser but I am getting the error as ‘No authorization to access Service ‘API_BUSINESS_PARTNER_0001’.

     

    Can you please suggest what authorization required to check in browser or if any other settings need to perform before execution.

     

    Thanks in Advance.

     

     

    (0) 

Leave a Reply