on 10-01-2009 5:24 PM
Hi all,
I have the logic like this
If the incoming Location code value is totally Alpha means i have to concatenate Location code and the last three digits of Delivery No. else pass the location code as it is
Regards
closing thread to open new one
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vamsi,
use this UDF it will work fine ,i tested in eclipse
Fist pass the two arguments as input to UDF one is LocationCode and Delivery No
(String LCode,String DevNo,Container.)
if (LCode.matches("[a-zA-z]")) {*
Sring Out = LCode+Dev.substring(0,3);
return Out;
}
else
{
return LCode;
}
let me know the length of Delivery Number,if it is constant value then you need to chnage the substing function index.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi raj,
I wrote the code like this and getting this error
cannot resolve symbol
symbol : class Sring
Sring Out = LCode+DevNo.substring(8,10); ^ 1 error
Code is
public String LCode(String LCode,String DevNo,Container container){
if (LCode.matches("a-zA-Z"))
{
Sring Out = LCode+DevNo.substring(8,10);
return Out;
}
else
{
return LCode;
}
Hi Raj,
I wrote the code as you instructed bellow and i am getting the Suppressed values when i check the Display Queue in message mapping.
public String LCode(String LCode,String DevNo,Container container){
//write your code here
if (LCode.matches("a-zA-z*"))
{
String Out = LCode+DevNo.substring(8,10);
return Out;
}
else
{
return LCode;
}
}
Here is my Mapping screen
http://img260.imageshack.us/img260/7000/mapp1.jpg
Please help me
Regards
Hi,
pass Delivery No,Location code as argument to UDF,suppose you gine the argument name LCode
if (!Character.isDigit(str.charAt(LCode))&&!LCode.matches("[
p[
-]]*"))
//this logic for to check numberic value and Alphanumberic
{
int OutPut= LCode+use substing function for 3 didgits.
}
then return OutPut else
OutPut = LCode.
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use regular expresion to validate the filed. this is the logic to check the filed to numberic or not.
if (!Character.isDigit(str.charAt(field)))
add this code to UDF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.