cancel
Showing results for 
Search instead for 
Did you mean: 

steps for creating UDF in Mapping

Former Member
0 Kudos

Can any one help me by giving steps that should be followed in creating UDF.the UDF should be used for mapping.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

UDF are normal java functions.Just type UDF and you shall get all the examples in SDN Search.

Please have a look at the UDF's I have written in these threads

These are good ones

Thanks

Former Member
0 Kudos

Rupesh,

Refer to url http://help.sap.com/saphelp_nw70/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm

Also here is some sample code for different scenarios

<b>Example 1</b>

This example copies the value of the Dynamic Configuration variable DCJMSCorrelationID into the message field CORRELID

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get

(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create

("http://sap.com/xi/XI/System/JMS","DCJMSCorreleationID");

String Corrid = conf.get(key);

return Corrid;

<b>Example 2</b>

This example prefills the input with zeros (if required)

NumberFormat f = new DecimalFormat("0000000000");

if(a.equals("") || a.equals(null))

return a;

else

return f.format(Integer.parseInt(a));

<b>Example 3</b>

This example checks and if the input string is null returns a message

if(a.equals("") || a.equals(null))

a = "No query data returned";

return a;

Regards,

Mike

Former Member
0 Kudos

hi rupesh,

Just refer this discussion, you will get all the details regarding UDF's with screen shots.

https://forums.sdn.sap.com/click.jspa?searchID=7025851&messageID=4236140

regards

Ramesh P

Former Member
0 Kudos

Hi Rupesh,

There are 2 types of UDF - Simple and Advanced

- Simple UDFs uses Value, wherein we can manipulate only one value (input is one String). Therefore a single string is expected, as input and the output would also be a single string.

- Advanced UDFs uses Context or Queue, where you manipulate many values (input is an array of Strings).

Give me ur mail-id ...so that i can send you some examples using UDF's...

Note : when standard functions are not met your requirements then you can use UDF's

Regards,

Ramana Kumar. A

Former Member
0 Kudos

Hi Ramana,

p.rupeshp@gmail.com is my email id. Please forward some examples on that. Thanks for your support.

Thanks,

Rupesh