cancel
Showing results for 
Search instead for 
Did you mean: 

How to create User-Defined Functions?

Former Member
0 Kudos

Hi,

I just would like to know how to create user-defined functions. I tried to read some articles in the help.sap.com about this but I got confused with the features of the different functions available:

Simple Functions (Cache = Value)

Enhanced Functions (Cache = Context or Cache = Queue)

How is cache associated with the functions?

I've also tried to read the Advanced User-Defined Functions but it is more complicated there.

Is there a step on creating UDF? Also, what is the difference between Value, Context and Queue function options?

Thank you so much in advance for your help.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

>>Simple Functions (Cache = Value)

-> process individual field input values for each function call.

-> Function is called once per occurrence of the source element.

>>Enhanced Functions (Cache = Context or Cache = Queue)

-> pass either all field values of a context or the whole queue.

-> Input field is passed as string array.

-> returned values are stored in a string array, ResultList.

-> Function is called once per context or queue. Values of context /queue are stored in input string arrays.

>>what is the difference between Value, Context and Queue function options?

<b>Context</b> - Do not have identifiable context change.

<b>Queue</b> - Contains context change indicator. Much more

memory intensive.

Regards

Yuga

Former Member
0 Kudos

Hi

Simple click on the button to create the User Defined Function.

Choose Simple.

It will open an editor where you should type your code.

Click on save and close and use it into your mapping.

These are the simplest steps.

Thanks

Former Member
0 Kudos

In addition

When you choose (Cache = Value)

It is a Simple Function

When you choose (Cache = Context or Cache = Queue)

It is an Enhanced Function

Get back if you have any more doubts.

Thanks

Former Member
0 Kudos

Hi Mary,

in graphical mapping you see a button on the lower left side. By< clicking this button you create a UDF.

Simple Functions (Cache = Value)

--> You just want to modify a simple value. For example a calculation.

Enhanced Functions (Cache = Context or Cache = Queue)

--> e.g. You want to modify all entries of a element, e.g. sort. For this you need the whole queue (=all antries of a node)

Regards Mario

nisarkhan_n
Active Contributor
0 Kudos
prateek
Active Contributor
0 Kudos