on 11-11-2013 11:03 AM
Hi,
I have a proxy to jdbc scenario. I have declared both of them as string.
When i get Qty field from SAP i am getting it as 250.00-.
This is giving an error in jdbc since the original database expects to have sign in the front.
Can anyone let me know how to resolve this. If udf is the only way, please give me the udf as i am pretty new to java as well.
Regards
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
250.00- this number is not negative number, minus symbol precent in last digit so PI taking this as a string digit. If it is minus number ask the source team to send value like this -250.00. then you can use neg function to convert as positive number.
another way to achive this is use replaceString method to replace the minus symbol. once you remove this it will act as a integer.
Regards,
Manigandan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If the requirement is such that you will need a - before the number i.e -222 if a - exists i.e -222 or 222- and if there is no -, such as 222 then populate as it is, then have below UDF with single values:
String Str = "";
if(var1.indexOf("-")!=-1)
{
var1 = var1.replaceAll("-", "");
Str = "-"+var1;
}
else
Str = var1;
}
return Str;
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.