on 06-15-2011 10:41 AM
Hi,
In Message-Mapping I map item number to item no.
The source item number format are random, sometime in char, i.e., ABC123, ABC-23-A... sometime in digit, i.e. 123, 425...
The target system is sap and accepts just C(18) with captial characters.
I think, i need a UDF.
1. tell whether source field is digit or characters.
2. if digit then FormatNum into 0000000000000000
3. if characters then toUpperCase.
Is it correct? how to make it?
thanks
Rene
Better to ask bussiness system about max possibilities of number,based on that you can write logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
chk this:
Input is "var"
Execution type: Single value
int num = 0;
boolean flag = false;
for (int i = 0; i < var.length(); i++) {
char a = var.charAt(i);
if (Character.isDigit(a))
{
flag =true;
}
else {
var = var.toUpperCase();
flag=false;
break;
}
}
if(flag)
{
while(var.length() < 18) {
var= "0" + var;
}
return var;
}
else{
return var;
}
refer below link..for code.
http://www.coderanch.com/t/401142/java/java/check-if-String-value-numeric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
26 | |
9 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.