SAP Knowledge Base Article - Public

2653052 - Unable to Restrict Fields in a Custom Business Object by a Code List Restriction


You have created a custom Business Object (BO) with more than one field and would like to restrict the values in these fields using a code list restriction. You could restrict one field, however you are unable to restrict the other fields because they are not available on the creation of the code list restriction.


SAP Hybris Cloud for Customer

Reproducing the Issue

For example:

You have a custom BO ABC (where ABC is the BO created) with two fields, XXX and YYY (where XXX and YYY are the custom fields created in BO ABC).
You have created a code list restriction XYZ (where XYZ is a code list restriction created for you) to the field XXX.
However, you are not able to create a new code list restriction for the field YYY.


In case of a custom BO, any restriction created on one field gets applied on every other field of the BO as long as the fields share the same data type. Coming to the ABC BO, both fields XXX and YYY share the same data type. Hence the current behavior is to default the code to restrict field to a common field - in this case, XXX. This means that whatever restrictions are seen applied to XXX also apply to YYY.


If restrictions need to be applied to the two fields differently, the below steps will delink the two fields from each other:

- Create another data type similar to XYZ with code list values.

- Assign separate data types to the two fields in the BO, like:

Field Name   |  Data type

           XXX |   data type 1

           YYY  |   data type 2

 - Maintain Code List Restrictions if needed.


code list restriction ; extension fields ; custom business object , KBA , LOD-LE-RC-CLR , Code List Restriction , Problem


SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions