cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in generating output from UDF

Former Member
0 Kudos

Hi,

I am writing very basic UDF in java - The code is

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

{

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

{

if(b[j] == a<i>)

result.addValue(c<i>);

}

}

But when i look at the queue of this function the output is suppressed and no element is created. The values for array a,b, and c are as follows -

a = 000010,000020 b = 000020, 000010,000010,000010,000010,000010,000010,000010

c = 2100,2100

When i try and execute same program in standalone java application with above constant array values i get the desired output. The same code dosent work in XI.

Anything wrong that you see here?

Thank you.

Pavan

Message was edited by:

pavan sodani

Message was edited by:

pavan sodani

Message was edited by:

pavan sodani

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sorry i missed out on some part while posting

Hi,

I am writing very basic UDF in java - The code is

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

{

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

{

if(b[j] == a<i>)

result.addValue(c<i>);

}

}

But when i look at the queue of this function the output is suppressed and no element is created. The values for array a,b, and c are as follows -

a = 000010,000020 b = 000020, 000010,000010,000010,000010,000010,000010,000010

c = 2100,2100

When i try and execute same program in standalone java application with above constant array values i get the desired output. The same code dosent work in XI.

Anything wrong that you see here?

Former Member
0 Kudos

use C(i) in the result.addvalue.

thnx

Chirag

Former Member
0 Kudos

b[j] == a<i> or try .equals function

use addcontextchange method if required

Former Member
0 Kudos

It gives error

cannot resolve symbol symbol : method c (int) location: class com.sap.xi.tf._MM_TEST_ result.addValue(c(i)); ^ 1 error

Former Member
0 Kudos

hope while creating the UDF you selected Context or Queue option and Not Value option

Former Member
0 Kudos

I have found two problem one is B[j] is compared with only a it should be the array of a value and also in the result.addvalue the calue of c which is taken in array should be passed.

there is som problem with the square bracket hence i have used the ( bracket use that one.

thnx

chirag.

Former Member
0 Kudos

Hi Guys,

It works with ".equals". Strangely i tried everything except this.

The only reason that i dint try was that it wudnt compare the array elements.

Strangely the code works in a standalone application but not XI... !

Anyways its working. Thanks for ur input.

Points rewarded.

Answers (0)