SAP S/4HANA Cloud Key User Extensibility – Custom business object – Creating Code List Values – Part 2
|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|
Target Audience – Key Users of SAP S/4HANA Cloud, SAP S/4HANA On-Premise and Developers
In this part of the blog series, we will now see how to create a custom code list for a custom business object and will go through all the steps. 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 code list value –
Once logged in you will arrive at your home page (Fiori Launchpad). Look for the tile ‘Custom Business Objects’.
If you do not find it, then it would be under a custom group defined by your administrator. If you are still not able to find it, then use the search bar.
This should bring up the tile, as shown below
Click on the tile and you would arrive inside the application. Inside, you would notice tab – Custom Business Objects. Under this tab you will find a list of previously created Custom Business Objects, if any.
Let us now think of a custom business object which can be used to store supplier information. This custom business object will have a parent node to store the basic supplier information and a sub-node to store supplier role information. The structure would look like below –
|Root Node (Supplier)||Fields||Length / Data Type||Custom Code Lists|
|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|
As you can see in the last column, I am mentioning – Custom Code List. So, what is this?
Well, Custom Code Lists is simply a field type for a field in the CBO. It is like a reusable artifact that you can create and attach to the field. With this option, the user will get a fixed set of value help.
Let us first start with creating custom code list values for field Supplier Account Group and Supplier Role.
To do this, again in the search bar, type – Custom Reusable Elements. If you have already added it previously in the Launchpad, then it should be appearing like below
Click on the tile and go to the tab – Custom Code Lists and click on the ‘+’ icon
Start with the General Information tab, where you would provide a name to the code list and length. For this example, we are taking the length as ‘3’
Click on next tab Code Values and then click on the ‘+’ icon
Enter some code values for this code list. For example, like below, we have provided 3 code values
In the next tab, you can maintain the Translation for the for the code values. However, this is not mandatory.
Once this is done, click on button ‘Save and Publish’. This would publish the new code list and would be available for use later during custom business object creation.
The status will be published if all goes through successfully.
Let us go ahead and create new custom code list – Supplier Role. Follow the same steps as described above and new Code Lists Values should look like below.
Once done, Save and Publish to make the changes effective in the system.
This completes the steps required to create custom code list values that we will now use during creation of custom business object in the next blog.
Congratulations you have successfully understood the basics of creating custom code list values in SAP S/4HAHA.
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 3 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
Hello Rohit Khan ,
I understand Custom Code lists can be created by entering the values manually can i also use this to get the values of the standard values like WERKS or BUKRS ?
Hello Vijaya Simha Chintarlapalli Reddy
Not yet supported.
Hello Rohit Khan
I tried to create code list but “An Exception was raised” . Please give your suggestion.
Hello Deepa Manian ,
From this log, it is hard to guess. However, you can look at the suggested notes in this log.