Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
I044433
Product and Topic Expert
Product and Topic Expert
15,560























Last revisions
25-Jan-2022 Updated content as per latest updates
10-Aug-2021 Updated latest screenshots and content
03-Jun-2020 Updated latest screenshots and content
17-Jan-2019 Updated latest content


Extensibility Framework


 

Target Audience – Key Users of SAP S/4HANA Cloud, On-Premise and Developers

In this part of the blog series, we will now see how to create a simple custom business object step-by-step. We will start from where we left on Part 2 of this blog series. If you have directly landed on this blog, please look at the Part 1 and Part 2 of this series. Please note that you should have the pre-requisites already in place as discussed in the part 1 of this blog series.

Let’s go through the steps and see how to create a custom business object –

Log on to you SAP S/4HANA system. Once logged in you will arrive at your home page (Fiori Launchpad). Look for the tile ‘Custom Business Objects’. Normally, it should be under the group ‘Extensibility’. If no, then you can search for the app as explained in the previous part of this blog series.


Custom Business Objects tile


Click on the tile. If you recollect in part 2 of this blog series, we have started with an example of the following custom business object. Since we have already created custom code list in the Part 2 of this blog series, let us start with creation of custom business object based on the following table -































































Root Node (Supplier) Fields Length / Data Type  Custom Code List
Supplier ID 20 / Char No
Supplier First Name 30 / Char No
Supplier Last Name 30 / Char No
Supplier Account Group 4 / Char Yes
Supplier Country 20 /Char No
Sub-Node (Role) Supplier Role 10 / Char Yes
Role Valid From Date No
Role Valid To Date No

Once you are inside the custom business object editor, click on - New


Create a new Custom Business Object


Next provide the name of the custom business object.

Note – Other fields like Identifier and Name in Plural will be filled automatically.

If you want to change them, you can still do that. Provide the name and click on ‘Create’.


Name of the Custom Business Object


Under General Information, you fill find different checkboxes. By default, all of them will be ‘Unchecked’. You can decide which ones to select based on your business scenario and requirement. Remember we have already discussed about these in Part 1 of this blog series. For this blog, we will select all the options.


General Information tab


Note - In SAP S/4HANA On-Premise system, you will find less options under Features. As of SAP S/4HANA 2021, it is something like below. Of course, this is subject to change with new releases. Therefore, always refer to the latest documentation.


Selection of Features for a Custom Business Object


Next, click on the tab – Nodes. By default, system would have created the parent node based on the name of the CBO


Creating Nodes for a Custom Business Object


You can also see, by default system has selected three options – Create, Update, Delete. This is mainly to control the access right to the node.

Let’s create the fields for parent node – Supplier as mentioned in the table above. Click on – New. Let’s add first field – Supplier ID, with field type – Text and length equal to 20. Remember to make this a key field


Creating fields for a Node


In the similar fashion add other fields.

Let’s focus on the field – Supplier Account Group. If you remember, for this field, we created a Custom Code List. Now, we will bind it to this field.

After you have entered the details for this field, choose the type as – Code List from the list.


Assigning a Custom Code List as Field Type to the field


Under the properties pane, now you can choose the previously created code list.


Assigning previously created Code List


Search for the code list you created previously and select.


Custom Code List


It should be added now.


Code List assigned to the field of the CBO Node


In the similar fashion continue to add other fields. Click on Save Draft before you can add further nodes to the CBO.

Next, we can add the sub-node – Role.

Next, Click on Nodes tab again and click on New to add a new sub-node – Role


Create Sub-Node for a Custom Business Object


Add the name as – Role and click back on the Fields tab to add new fields.


Adding a new Node as Sub-Node


Choose the tab – Fields. Here we will create the fields for the sub-node. In the Fields tab, select the node – Role and create the fields in the similar fashion as we created above. Remember to attach the code list for the field – Supplier Role. Also, for two other field, Valid From and Valid To, you need to pick the field type as – Date


Adding fields to the Sub-Node


At this point, click on Save and then Publish.

You can now click on the tab – Log and see all the backend artifacts like CDS View, OData etc., is generated automatically by the system.

Once published, the text Published in green will appear. As you notice from log, the system created the CDS views, OData, and other artifacts automatically in the backend.


Log of the automatically generated artifacts by the system


This completes the steps on how to create a new custom business object in SAP S/4HANA. In the next blog, we will see how to maintain the entries for this custom business object by using the generated UI. We will also create a new tile for this application and host it in the users Fiori Launchpad.

 

Congratulations you have successfully created a new custom business object in SAP S/4HAHA Cloud!

Rohit Khan, S/4HANA Regional Implementation Group

Let’s stay connected - Rohit on LinkedIn


To keep yourself updated with latest on extensibility, follow this SAP Community Page – ABAP Extensibility

Click below for the Part 4 this blog series.

Part 1: Introduction to Custom Business Objects

Part 2: Create a Custom Code List for a Custom Business Object

Part 3: Create a new Custom Business Object

Part 4: Create a custom UI and maintain data in Custom Business Object
34 Comments