Show TOC

Enhancing Data Types (CCTS/Freely-Modeled)Locate this document in the navigation structure

Prerequisites

Customers or partners have to create data type enhancements in a separate software component version and a separate namespace. This software component version must be based on the SAP software component version in which the data type to be enhanced is defined.

More information: Defining Additional Software Dependencies.

Note

The ES Builder does not recognize changes to software component versions that have already been imported. Therefore, if you want to define dependencies between imported software component versions at a later date, you have to import the superordinate software component versions into the ES Builder again. You will not lose objects that have already been created.

Context

If necessary, SAP applications can allow customers to enhance application source code without making modifications and thus meet customer-specific requirements that are not provided for in the standard shipment. The applications can use Business Add-Ins (BAdIs)for this purpose. Furthermore, customers can define data type enhancementsfor data types for the classification freely-modeled data typeor aggregated data typein the ES Repository. If the service interfaces developed there are to be used for exchanging messages, customers can use these enhancements to transfer additional data with a message, which they can then access by using a BAdI, for example.

Procedure

  1. Create a data type enhancement.
  2. Assign the data type enhancement a data type of classification freely-modeled data typeor aggregated data typefrom an underlying software component version. These data types are shown in the navigation tree of your software component version, in the Basis Objectsbranch.
  3. The ES Builder automatically enters the namespace of your data type enhancement in the XML Namespacefield. You can enter a different XML namespace in this field if you want. The XML namespace avoids naming conflicts between customer fields and fields that are added later by SAP.
  4. Enter the fields and attributes that you want to add at the top level on the Enhancement Definitiontab page. The functions that are available in the XSD editor are also available here, but with the following restrictions:
    • You can add elements and structures at the top hierarchy level as subelements of the root element.

    • You can define attributes for the root element or its inserted elements.

    • You can create elements and attributes at the top hierarchy level as optional fields only. You can create all other elements and attributes as often as you like.

    • You can define your own facets for newly inserted elements or attributes in the Detailscolumn. This is not possible for SAP data type fields.

      Note

      The same restrictions apply for data type enhancements of aggregated data types as for aggregated data types themselves; therefore, you can only reference core data types and other aggregated data types.

    You can look at the XSD representation on the XSD Definitiontab page.

Results

The enhanced data type is displayed on the Enhanced Data Typetab page.

Next Steps

Using Data Type Enhancements in ABAP

To use a data type enhancement, you must use ABAP proxy generation to create proxy objects for the data type enhancement in the application system. (Make sure you use the customer-specific software component version.) ABAP proxy generation maps data type enhancements to APPEND structuresin the ABAP Dictionary.

Note

ABAP proxy generation does not create any generic BAdIs in the application system for accessing the APPEND structures.

Using Data Type Enhancements in Java

There is no enhancement concept in Java. Nevertheless, you can regenerate proxies for service interfaces that reference data type enhancements.

The generation function recognizes the elements and attributes of the enhancement, but does not handle them separately. The generated objects do not contain any information about which classes or attributes originate from the data type enhancement. There are, therefore, no separate Java objects for enhancements.

Java proxy generation can only generate proxy objects from service interfaces. If more than one data type enhancement exists for a data type, the generation function simply creates proxy objects for all data type enhancements.

Java proxy generation is part of the SAP NetWeaver Developer Studio.