Hi Abhinaya,
Please check the following for more details on UDF
User-Defined Functions and Function Libraries - SAP NetWeaver Process Integration - SAP Library
http://wiki.scn.sap.com/wiki/display/XI/User+Defined+Function
If you are on Single stack / 7.31+, you can also try creating UDF with NWDS tool
How to Create User-Defined Function for Message Mapping Using NWDS
Regards,
Azhar