Performing Complex Data Transformation with Functions 
You create a function to perform a complex data transformation. This function relates all of its inputs to exactly one output. The names and types of the input parameters and the value type, which the function returns are specified in the function's signature. You define how the function does the data transformation when you implement the function.
You can reuse functions from one project in another.
When you create functions, you do the following:
Define the function type.
You define one of the following function types:
Expression function
You define how the function does the data transformation with an expression.
Mapping function
You define how the function does the data transformation with a mapping.
EJB function
You define how the function does the data transformation with an Enterprise Java Beans (EJB) implementation. You specify the Java Naming Directory Interface (JNDI) name of the EJB. The EJB has a special method that executes the EJB function.
Ruleset function
You define how the function does the data transformation with a ruleset.
Define the function name.
Define the function return type.
The return type is the type of value that is produced after the data transformation.
Define the function input parameters.
You have opened the Process Composer perspective in the SAP NetWeaver Developer Studio and have expanded your project in Project Explorer view.
Expand Process Modeling.
In the context menu of the Rules and Functions folder, choose one of the following function types depending on your needs:
New Expression Function... type
New Mapping Function... type
New EJB Function... type
New Ruleset... type
In the dialog that appears, specify a function name in the Function name field.
Note
The function namespace is predefined and it is the namespace of the development component (DC) that contains your project and where you create your function. You can also use functions created in different DCs in your current project. To do that, you proceed as follows:
You declare dependencies to the DC containing the function you want to use. For more information about dependencies, see Defining Development Component Dependencies.
You define the namespace prefix of the DC containing the function you want to use, before using the function.
Select a function return type from the Return type dropdown menu.
Note
The return type of a ruleset should be either primitive XSD type or it should match the parameter type.
(Optional) Select the Multiple Occurrences checkbox if the function return type is a list of elements.
Choose the Add pushbutton to add function parameters.
Click the parameter's type in the Type field to activate the dropdown menu and select a type.
Note
You can click the parameter's name in the Name filed if you want to rename the parameter.
(Optional) Select the checkbox in the Multiple Occurrences field if the parameter type is a list of elements.
Choose the Finish pushbutton.
You have created a function and have defined its signature. You can change the function name and signature and you can define the function implementation when you edit the function. For more information about editing functions, see Editing Functions.