on 01-08-2010 6:19 AM
How to create a UDF if I have to check after comparing two values and then checking if MATNR is greater 90000000000 and less than 9999999999 and only then I can pass the value of the field MATNR.
Hi,
Below code works perfect for me. I hope this will help you.
Declare Imports under Inport section: java.util.*; java.math.BigInteger;
BigInteger bi1 = new BigInteger(MATNR);
BigInteger bi2 = new BigInteger("90000000000");
BigInteger bi3 = new BigInteger("99999999999");
if (bi1.compareTo(bi2 )== 1 && bi1.compareTo(bi3 )== -1)
{
return MATNR;
}
return "";
Try this and let me know.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
imports= java.maths.BigDecimal;
function myudf(String a, Container container)
{
BigDecimal big = new BigDecimal(a);
if (big < 9999999999 and big > greater 90000000000)
return big.toString;
else
return "";
}
/people/thorsten.nordholmsbirk/blog/2006/04/03/never-ever-use-xis-built-in-arithmetic-functions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
> How to create a UDF if I have to check after comparing two values and then checking if MATNR is greater 90000000000 and >less than 9999999999 and only then I can pass the value of the field MATNR
Create simple UDF and use the long data type instead of int.
if (matnr < 90000000000 && matnr > 9999999999)
return matnr;
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Pass the two values to be compared and also MATNR no also...
in udf
MATNR1 = Integer.parseInt(MATNR);
if(value1.equals(value2))
{
if(MATNR1 > 9000 ... &if MATNR <9999//)
return MATNR
by using like above u can start proceeding...
note : i have just given the idea of start need to modify according to your requirement...
HTH
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.