Show TOC Start of Content Area

Procedure documentation Managing Data Types  Locate the document in its SAP Library structure

Use

You can create and use new simple types, complex types, and fault messages in your composite application. All primitive data types are stored in the caf.core development component. You can create your own custom types to suit the specific needs of your composite application. You can add restrictions to simple types. For example if you create a custom type age and you can restrict it to be between 0 and 120.

Prerequisites

You have created an application. More information: Creating Composite Application Development Components

Procedure

Creating Data Types

...

       1.      Choose the node of the package in which you want to create a new data type.

       2.      Click the Data Types node with the secondary mouse button.

       3.      Choose one of the following:

       New Simple Type - to create a simple type from a primitive type

       New Structure - to create a complex data structure

       New Fault - to create a new exception type

       4.      Enter a data type name.

For simple types, choose from the dropdown box the base type of your new data type.

       5.      Choose Finish.

Modeling Structures of Complex Data Types

...

       1.      In the Composite Application Explorer, expand the node of your application and the package under which the complex type is situated.

       2.      Navigate to Data Types Complex Types.

       3.      With the secondary mouse button, choose the complex data type you want to edit.

       4.      Choose Edit.

The structure editor opens in the right pane.

       5.      Open the Edit tab page.

       6.      To add a new attribute to the structure:

                            a.      Select the attribute type by navigating to the Existing Types structure.

                            b.      Choose This graphic is explained in the accompanying text  with the quick info text Add Dependency.

The new attribute appears under the Structure Fields list.

Note

You can also use the Properties page to change some of the attribute properties.

For example, if you want to change the cardinality of the attribute, change the MinOccurs and MaxOccurs properties.

Customizing Your Simple Data Type

...

       1.      In the Composite Application Explorer, navigate to your data type and double-click it.

       2.      Open the Aspects tab page.

       3.      To add XSD facets to your data types, configure the following options:

       From the Available Facets dropdown box, choose a facet.

       Choose Add XSD Facet and enter a value for it.

Note

To remove a particular facet, select it in the Current facets table and choose Remove XSD Facet.

You can set the length restrictions for you custom data type and use that type later when you model business object node attributes.

Deleting data types that are not referenced by any external service

This action deletes any currently empty packages in your application.

To delete all data types that are not referenced by any external service, click the package with the secondary mouse button and choose Delete not referenced types.

Deleting a single data type

To delete only particular types, choose Deselect All and select only the types you want to delete. Warnings may appear on some of the types. To select all types with warnings, choose Select Required.

Result

The new data type node is added to the Composite Application Explorer. You can use it to model your structures. For simple types, you can see detailed information. To do this, select the simple type node with the secondary mouse button and choose Edit

Note

To delete the data type, select its node with the secondary mouse button and choose Delete.

To rename the data type, select its node with the secondary mouse button and choose Rename.

End of Content Area