Skip to Content
Technical Articles
Author's profile photo Rohit Khan

SAP S/4HANA Cloud Key User Extensibility – Custom business object – Creating Code List Values – Part 2

Latest 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%20Framework

Extensibility Framework

 

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’.

Custom%20Business%20Objects%20tile

Custom Business Objects tile

 

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

Custom%20Business%20Object%20app

Custom Business Object app

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

Custom%20Reusable%20Elements%20app

Custom Reusable Elements app

Click on the tile and go to the tab – Custom Code Lists and click on the ‘+’ icon

Custom%20Code%20List%20tab

Custom Code List tab

 

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’

Defining%20a%20Custom%20Code%20List

Defining a Custom Code List

Click on next tab Code Values and then click on the ‘+’ icon

Code%20Values

Code Values

Enter some code values for this code list. For example, like below, we have provided 3 code values

 

Code%20Lists%20with%20Description

Code Lists with Description

 

In the next tab, you can maintain the Translation for the for the code values. However, this is not mandatory.

Maintain%20Translations

Maintain Translations

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.

Publish%20the%20changes

Publish the changes

 

The status will be published if all goes through successfully.

CBO%20published%20successfully

CBO published 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.

Supplier%20Role%20Node

Supplier%20Role%20Node

Supplier Role Node

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

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vijaya Simha Chintarlapalli Reddy
      Vijaya Simha Chintarlapalli Reddy

      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 ?

      Thanks,

      Vijay

      Author's profile photo Rohit Khan
      Rohit Khan
      Blog Post Author

      Hello Vijaya Simha Chintarlapalli Reddy

       

      Not yet supported.

       

      Regards

      Rohit

      Author's profile photo Deepa Manian
      Deepa Manian

      Hello Rohit Khan

      I tried to create code list but “An Exception was raised” . Please give your suggestion.

      Thanks

      Deepa

      Author's profile photo Rohit Khan
      Rohit Khan
      Blog Post Author

      Hello Deepa Manian ,

      From this log, it is hard to guess. However, you can look at the suggested notes in this log.

      Best Regards

      Rohit