且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去

更新时间:2022-09-05 23:17:56

My series of Cloud Application Studio Blogs

How to detect EditMode in an Embedded Component

Step by step to enable your custom BO with attachment upload functionality

Step by step to create an Adobe Print form in Cloud application Studio

How to render PDF which displays picture from the image attachment of your custom BO

How to get current logged on business user’s employee information and assigned organization unit via ABSL

How to implement dynamic access control based on custom BO using OWL

How to make Code List Restriction work when control field and restricted field are not on the same BO

How to implement custom number range using custom business object

Two approaches to create Code List in Cloud Studio

Create Dynamic Code List via Custom Business Object Association

Step by step to develop Thing Type based navigation and BO Object based navigation

Put Extension field into embedded component and make it visible in Standard UI

One possible cause that embedded component fails to display in UI

Step by step to create HTML Mashup and make it visible in UI

Step by step to enable Text Collection for your custom BO

Automatically send an Email notification to line manager via Workflow in Account application

Step by step to create Object Value Selector in Cloud Application Studio

Two approaches to fill an UI field with dedicated logic implemented in Cloud Application Studio

How to execute BO action on multiple selected BO instances in AdvancedListPane

How to add custom validation logic on mobile phone field in Contact TI

An example about how I analyze why some OBN button does not work

Step by step to create OBN button which navigates from standard UI to custom UI

Service Request ticket split – how to bring the selected service request item to new custom UI

Step by step to create two drop down list with dependency

Expose Custom BO logic implemented by ABSL via Custom OData service

Step by step to create web service in Cloud Application studio and bind it to a custom action in standard BO

Suppose you have implemented some logic in a given action of your custom BO via ABSL, it is possible to expose the logic via Custom OData service so that it could be consumed by external applications.

Custom BO:

将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去

And the logic of Calculate action is very simple, just make comparison between current date and the close date. If the current instance is over due, also store the duration to field “Duration”.

将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去

Then go to work center Administrator->OData Service Explorer, create a new Custom OData Service:

将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去

Create a new function import for this OData service, choose Action as import type, specify “DueCheck” as import name, and bind the BO action Calculate to this function import.


将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去

Now test the function import via this BO instance below:

将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去

first get its object id by Agreement ID via OData filter operation:

将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去

https:///sap/c4c/odata/cust/v1/zjerrytestodataservice/TestBORootCollection?$filter=AgreementID eq ‘JERRY2’

Then execute the url appended with the object id found in previous step plus the function import name: https:///sap/c4c/odata/cust/v1/zjerrytestodataservice/DueCheck?ObjectID=’00163E20C98D1EE7A6BD2FF6E7D3F03F’, and the BO action is successfully executed: you could observe the flag isOverDue and field Duration are correctly calculated and returned by this OData service.

将SAP C4C Custom BO使用ABSL编写的逻辑通过OData服务暴露出去