cancel
Showing results for 
Search instead for 
Did you mean: 

what are the user defind functions

Former Member
0 Kudos

hi all,

what are the user defind functions.

Regards,

priya

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member238007
Contributor
0 Kudos

Hi Priya,

User defined functions are developed by the users in graphical mapping,

Actually in Graphical Mapping i.e Message mapping we have some standard functions, if we complete with the existing then there will be no need to go for user defined functions, so when you dont get or realize the solution with the existing standard functions then you will be going to create a User defined function where the java code can be defined by passing the arguments as string.

at an maximum you can able to pass 15 strings for the user defined functions.

For more information of UDF's see below links..

UDF -- Links

http://java.sun.com/j2se/1.5.0/docs/api/

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

UDF -

http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm

UDF -- Help

http://help.sap.com/saphelp_nw04/helpdata/en/d9/718e40496f6f1de10000000a1550b0/content.htm

Former Member
0 Kudos

Hi,

Refer this link.

Regards,

Sharanya.

Former Member
0 Kudos

UDF's are used if standard functions do not fulfill requirements. They are only visible in the message mapping in which you created it.They are nothing but the Integration of Java programs from imported archives of the same software component version. They are used like standard functions.

Check the link for User Defined Functions,

http://help.sap.com/saphelp_nw04/helpdata/en/d9/718e40496f6f1de10000000a1550b0/content.htm

Edited by: malini balasubramaniam on Aug 12, 2008 6:46 AM

Former Member
0 Kudos

Hi Priya,

Generally we will complete our mapping things with the help of Standard Functions itself those are available in Graphical Mapping.

UDF are used when the mappings are unable to complete with these standard functions then we need to write small piece of Java code and can achieve that functionality.

Steps to UDF

Activities

1. To create a new user-defined function, in the data-flow editor, choose Create New Function (This

graphic is explained in the accompanying text), which is located on the lower left-hand side of the

screen. In the menu, choose Simple Function or Advanced Function.

2. In the window that appears, specify the attributes of the new function:

Name

Technical name of the function. The name is displayed in the function chooser and on the data-flow

object.

Description

Description of how the function is used.

Cache

Function type (see above)

Argument Count

In this table, you specify the number of input values the function can process, and name them. All

functions are of type String.

3. In the window that appears, you can create Java source code:

...

a. You can import Java packages to your methods from the Imports input field, by specifying them

separated by a comma or semi-colon:

You do not need to import the packages java.lang., java.util., java.io., and java.lang.reflect. since

all message mappings require these packages and therefore import them. You should be able to

access standard JDK and J2EE packages of the SAP Web Application Server by simply specifying the

package under Import. In other words, you do not have to import it as an archive into the Integration

Repository. You can also access classes of the SAP XML Toolkit, the SAP Java Connector, and the

SAP Logging Service (see also: Runtime Environment (Java-Mappings)).

In addition to the standard packages, you can also specify Java packages that you have imported as

archives and that are located in the same, or in an underlying software component version as the

message mapping.

b. Create your Java source text in the editor window or copy source text from another editor.

4. Confirm with Save and Close.

5. User-defined functions are limited to the message mapping in which you created the function. To

save the new function, save the message mapping.

6. To test the function, use the test environment.

The new function is now visible in the User-Defined function category. When you select this category,

a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the

function to the data-flow editor, choose the arrow next to the button and select from the list box

displayed.

REgards

Seshagiri

Former Member
0 Kudos

Hi Priya,

When you can't fulful your mapping requirement with functions available in graphical mapping, then you use userdefined functions.

User defined functions are two types:

1. Simple

2. Advanced.

Simple UDF exports a String and expects a String as output.

Advanced UDF it exports A String Array and expects a String Arrary too.

Be ware when you use Advanced UDF to check the cache refresh in function definition window. This invokes for a sinlge time when function gets a input parameter, and returns Context Changes as well in the output String array. else it will invoke every time it gets input parameter.

For better Understanding:

Please go through Presentation given by XI guru Jochim Orb in ELearning section of SDN.

Best Regards

Praveen

Former Member
0 Kudos

In graphical Message Mapping there are standard functions provided by SAP.

If you want to implement some new functionality for your mapping requirements, we can write our own Java Code in User Defined Functions.

If the standard functions for a target-field mapping do not fulfill your requirements, or if the graphical representation becomes unclear due to the complexity of the mapping, you have the option of creating your own user-defined functions. You can create Java source text in this function. The function is included in the Java coding that is generated for the message mapping as a Java method

Check this :

http://help.sap.com/saphelp_nw70/helpdata/EN/22/e127f28b572243b4324879c6bf05a0/content.htm

Regards

Ganga