on 11-29-2006 7:03 AM
Hi,
I am a novice in java and need to write a UDF which has to calculate the length of field (material description) as input. It contains '/' symbol. The function should return the string from 0th position to '/' symbol. Thanks a lot And if possible, please send me some links which help me to learn write sample UDF for various conversions.
Michael
Hi,
Please refer this link to learn much about user defined functions.
http://help.sap.com/saphelp_nw2004s/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm
Regards,
Sudheer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for all ur replies. I am using the below structure in message mapping
material description and constant '/' -> lastindexOf (2 parameters)->UDF
UDF ( 3 parameters) material description, start index ie 0, and last indexOf
Should Return the string till '/'.
Any help is appreciated to develop this UDF.
-Michael
Use this code
Public String replace (String a, Container container)
{
int i = a.indexOf("/");
if a>0
{
return (a.substring(0,i));
}
else
return "";
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
take a look at this weblog...
/people/dennys.hsieh/blog/2006/11/20/how-to-parse-xxyyzzaabbcc112233-in-message-mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use this logic;
String a = "abc/123"; //say this is your input string
int i = a.indexOf("/");
a = a.substring(0,i);
System.out.println(a);
the result will be abc.
in UDF it will be in case you make a simple function;
int i = a.indexOf("/");
a = a.substring(0,i);
return(a);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.