Show TOC Start of Content Area

Function documentation Function Overview and Function Properties  Locate the document in its SAP Library structure

Use

To access the function properties of existing functions on the right-hand side of the editor, or to create new functions, you work in a local function library with the function overview on the left-hand side of the editor.

Integration

The function overview does not display the functions of other Java packages or other function libraries.

Prerequisites

You have created a message mapping.

Features

Predefined Functions and Java Areas

The function overview displays all functions and Java areas of the library. Once you have created a function library the following entries are already in the list:

Attributes and Methods

This area corresponds to the class body of the Java class. You can define global variables and global methods of the library.

init

Initialization method that is called before message mapping.

cleanUp

Method that is called after message mapping, for example, to release data in the memory that is no longer needed.

If you use multiple function libraries in a message mapping, there are several Java area attributes and methods, and several init()and cleanUp() methods. The mapping runtime executes this source text at the beginning or end of the message mapping in the sequence in which you have entered the corresponding function libraries in the table for using the libraries.

Properties of User-Defined Functions

To add a new function, you add a new line in the function overview and assign a technical name for the function. You specify the remaining properties of the function on the right-hand side by using the source text editor:

Function Properties

Property

Use

Title

Title for the function display in the data-flow editor

Description

Description for the quick info text of the function in the data-flow editor

Execution Type

Single Values

A function with this execution type can process single values of fields in each call.

 

All Values of Context

A function with this execution type can process multiple input values of a field in each call. The mapping runtime assigns all field values of a context to the fields of the corresponding array before the function call.

More information: Advanced User-Defined Functions

 

All Values of Queue

A function with this execution type can process multiple input values of a field in each call. The mapping runtime assigns the values of the entire queue for the field to an array before the function call.

 

More information: Advanced User-Defined Functions

Note that when dealing with large messages, saving the entire queue in the cache requires a lot of memory at runtime.

Category

Function category under which the function is to be found in the data-flow editor.

To assign a function to an existing category, enter its name. To assign the function to a new category, assign a name that does not already exist. The mapping editor then automatically creates a category with this name.

Signature Variables

Signature Variables

Possible Java Types

Argument

Variable type for the input values of a function that are usually displayed as boxes on the left side of the data-flow editor.

String, int, float

Parameter

Variable type for function parameters that you use to control the behavior of the function, independently of the arguments.

To give the parameters values, double-click the function in the data-flow editor to call the function parameters.

You also have the option of connecting the function parameters to message mapping parameters.

More information: Parameterized Mapping Programs

String, int, Channel

Result

Variable type for all execution types other than single values.

You use the results variable declared with this type to return the results queue of the function.

More information: ResultList Object

ResultList

Data Type Conversions

The mapping runtime reads the values of fields from the message as a string. If you have entered int or float as the variable type for the arguments, the runtime executes a data type conversion when the values are assigned. If the string cannot be converted to the specified data type, the mapping runtime triggers an exception.

Activities

...

       1.      To create a new user-defined function, add a new line in the function overview and enter its function properties.

       2.      Enter your source text.

More information: Local Function Libraries

 

End of Content Area