Dynamic Attribute Administration
This function permits the definition of custom (dynamic) attributes for entity services that are visible to any client application or user interface (UI). This is necessary because once delivered to the customer, the service definition and implementation of the entity service cannot be changed. The entity service is designed in the Composite Application Services plug-in to SAP NetWeaver Developer Studio.

Go to http://<host>:<port>/caf → Administrative tools → Dynamic Attribute Administration to access the administration UI. Remember to replace <host> and <port> with the appropriate machine name.
The entity service is described by non-modifiable metadata in the metamodel repository (MMR). It consists of enterprise java beans (EJB), java classes, table definitions, and JDO metadata. The definition of the custom attributes is archived by metadata extensions at the customer site, whereas default relations are directed to a generic extension object.
Any extensible entity service has per default a one-to-many (1…n) relationship to the complex DynamicAttribute, which has a fixed structure. The custom attributes are stored in pairs (name and value) where value is converted to type “string”.
Dynamic attributes can only be created, updated, or deleted via the following generic methods:
set: void setProperty(String propertyName, object value)
get: object getProperty(String propertyName)

Only single-valued dynamic attributes are allowed.
A list of available custom attributes per entity and their type information is stored in the entity DynamicAttributeMetadata. Detailed type information is stored in the entity SimpleType. Both entities belong to the caf/tc application. An application service metadata provides the metadata information about all CAF services including the list of static and dynamic attributes to client applications.
Administration of entity service dynamic attributes involves examining the following aspects of the object model:
● Entity Services
See the chapter on Entity Services for more information.
● Queries
See the section on Queries for additional information.
● SAP Business Information Warehouse (SAP BW) Extraction
SAP BW extraction uses the findByMultipleParameter method of entity services for selection. As dynamic attributes (function DynamicAttributes) are supported by the findByMultipleParameters method, you can also use them as s selection parameter in SAP BW.
The SAP BW/CAF connector is to be extended so that it also provides the metadata of the dynamic attributes for building the extraction structure in SAP BW. During extraction, DynamicAttributes are to be handled similar to categories.
● Dynamic Attributes Metadata
See Dynamic Attribute Metadata for more information.
● Simple Types
See Simple Types for more information.
● Enumerations
The implementation of CustomEnumTypes is currently being revised.
When a client creates an entity instance, they have to know the available static and dynamic attributes in order to feed the entities with data. The client first has to retrieve a list of available attributes in order to configure a UI with the available input fields or to dynamically populate the entity attributes from any other data source.
The metadata application service first queries the MMR to read the metadata for an entity service. Then it queries the DynamicAttributeMetadata service for the dynamic attributes of that particular entity and creates the appropriate descriptor for data types. This information is then used, for example, in Web Dynpro UI configuration applications to configure CAF Core configurable user interfaces.
To create an entity instance, the client application provides the input data that consists of static and dynamic attribute values. The create method of the entity is then called to instantiate the value object. However, this method only accepts static attributes that are marked at design time as required and returns an instance of the data object of the entity.
This data object can be populated with non-mandatory static values via the typed or untyped setter method and with dynamic attributes via untyped setter methods. Conversion to type “string“ and population of the complex attribute is hidden inside the data object. The database is updated when the client commits the transaction.
A query for an entity returns a collection of instances of the entities data object. As dynamic attributes for that entity are stored as complex attributes, simple navigation to the assigned dynamic attributes is possible.
Inside the entity type conversion from type “string” to the real data type of the dynamic attribute is done based on the DynamicAttributeMetadata. The untyped getProperty(String attributeName) method returns an object instance of the correct type.
Deletion of entity instances should use the already implemented mechanism for cascading deletion of complex attributes.