cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to check the amount value

Former Member
0 Kudos

Hi

I have a scenario where i have to check the amount value sholuld be greater than Zero or not, if it is not greater than zero i have to raise an exception and skip that record ..

i wanna do that using UDF..How we do that

venkat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

oops,

int AmountValue =Integer.parseInt( Amount);

try{

if(AmountValue>0)

{

create record;

}

else throw new Throwable("Records not greater than 0...");

}catch(Throwable t){}

In the if condition, use the variable AmountValue.

Answers (3)

Answers (3)

Former Member
0 Kudos

You might want to look at this thread for specific Exceptions that you can use in XI.

Former Member
0 Kudos

Create a UDF with through this psudocode

int i = Integer.parseInt(a);

try{

if(amount>0)

{

create record;

}

else throw new Throwable("Records not greater than 0...");

}catch(Throwable t){}

Former Member
0 Kudos

Hi paul

I need to Import Any Java packages .

It s giving Error :

Source code has syntax error: /usr/sap/D06/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map08e7dc10452d11dcb4a1e210bc394725/source/com/sap/xi/tf/_MM_ACEAwardInformation_to_TaxBalances_.java:113: operator > cannot be applied to java.lang.String,int if(Amount>0)

My code

public String AmountValue(String Amount,Container container){

int AmountValue =Integer.parseInt( Amount);

try{

if(Amount>0)

{

create record;

}

else throw new Throwable("Records not greater than 0...");

}catch(Throwable t){}

venkat

ravi_raman2
Active Contributor
0 Kudos

venkat,

R u referring to Universal disk format....

Regards

Ravi Raman

Former Member
0 Kudos

I wanna check the Amount value > 0 or not

venkat