Start of Content Area

Function documentation Function Libraries  Locate the document in its SAP Library structure

Use

Mapping developers can use their own user-defined functions in message mappings in addition to the standard functions. The ES Builder saves these functions in a local function library of the message mapping. They are only visible in this message mapping (in the data-flow editor for defining target-field mappings). You generally use user-defined functions to add your own simple or complex Java functions to the functions of the message mapping.

A function library is a separate object type in the Enterprise Services Repository (ES Repository) and enables mapping developers to use user-defined functions across message mappings. You can use user-defined functions from a function library in message mappings and in mapping templates.

Note

If not expressly stated otherwise, the following statements apply equally to message mappings and mapping templates, even if reference is only made to message mappings to keep the description simple.

Integration

The editor on the Functions tab page for defining user-defined functions in message mappings is the same as that for defining function libraries. In message mappings the package name and the class name are locked against changes.

Caution

Be sure to read the implementation considerations in Java Mapping as these are also valid for functions of (local) function libraries. (The term “(local) function library” is used to describe both the local and the independent function library.)

Prerequisites

A message mapping can only use function libraries that are defined in the same software component version as the message mapping, or in an underlying version.

Features

The editor for a function library is structured as follows:

This graphic is explained in the accompanying text

General

Class and Package Name

Each function library corresponds to a Java class, which is identified by a class name and a package name. Once a function library has been created, the ES Builder assigns the name of the function library to the class name automatically and uses the repository namespace to create the package name automatically.

All package and class names of (local) function libraries and imported archives must be unique within a software component version. If there is already a package with the same name in an imported archive and a class with the same name in this package, this results in a naming conflict. To resolve such conflicts, you change the predefined class name and package name of your function library.

Editing Source Text

The ES Builder has an integrated editor for creating Java source text for the functions contained in a function library. You can also use an external tool to edit the source text of a function library. To do this, you export the source text and reimport it once you have edited it using the external tool.

The exported source text contains markers for the beginning and end of the individual functions and areas. When the source text is reimported, the ES Builder only imports the source text between these markers. The methods must already be contained in the function library into which you are importing the source text. New methods are not created automatically.

Activities

...

       1.      Create a function library (see: Creating a New Object). You change local function libraries on the Functions tab page of a message mapping.

       2.      Implement your Java functions (see: Implementing Java Functions).

You can also copy functions of a local function library to an independent function library (see also: Copying Functions of a Local Function Library ).

 

 

 

 

 

 

End of Content Area