cancel
Showing results for 
Search instead for 
Did you mean: 

Needed UDF in Shabarish Vijayakumar's weblog

Former Member
0 Kudos

Hi,

In the Shabarish Vijayakumar's weblog

/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

1. I need code for the following UDFs

“ChkSum” and “AnyError”

and

2. how Constant (RDFILE) can be created ?

Thanks,

ss

Message was edited by:

s s

View Entire Topic
Shabarish_Nair
Active Contributor
0 Kudos

<b>For chkSum - </b>

Create a UDF [Enhanced Functions (Cache = Context)]

int totAmount=0;

for(int j=0;j<a.length;j++)

{

totAmount=totAmount+Integer.parseInt(a[j]);

}

if(totAmount==Integer.parseInt(b[0]))

result.addValue("0");

else

result.addValue("1");

<b>For AnyError - </b>

Create a simple function

if(a.equals("true") && b.equals("0"))

return "0";

else

return "1";

<i>2. how Constant (RDFILE) can be created ?</i>

>>>

in the Filename give the value as RDFILE

else if u r askin how to create a constant in the mapping logic use the constant function from the standard functions available (http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm)

Former Member
0 Kudos

Thank you very much Shabarish for your help.