cancel
Showing results for 
Search instead for 
Did you mean: 

User define function explanation.

Former Member
0 Kudos

Hi ,

Can any one explain what these user define function will do , since this is mapped in message mapping.

I am writing the code which is written in it.I dont understand what it means and how it will give result.

Please explain..

1:

public void ValidateQualifiers(String[] a,String[] b,String[] c,ResultList result,Container container){

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

{

if (a<i>.equals(c[0])){

result.addValue(b[ i] );

}

}

}

2: User-Defined function..

public String getCounter(String a,Container container){

GlobalContainer gc = container.getGlobalContainer();

if (gc.getParameter(a) != null) {

return String.valueOf(gc.getParameter(a));

} else {

return "1";

}

}

Edited by: mayank verdia on Jun 10, 2009 3:52 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

To Add more to Ravi's Message While defining the UDF the Cache option chose is Context for the first UDF.

Thanks,

Kiran

Former Member
0 Kudos

Hi,

First func makes some actions which are semantically hardly described just by code. Provide with xml sample and use case.

Regarding 2nd func: basically it gets from memory value that is named as a value of first parameter. try to find another func like "setCounter" and post its code here. for more info refer http://help.sap.com/saphelp_nw70/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/frameset.htm - GlobalContainer Object.

Regards,

Dmitriy.

former_member181962
Active Contributor
0 Kudos

1) The first function is taking three arrays as inputs.

It is checking if the first queue has any matches with the first element of the third queue.

If there are any matches, then it is appending the corresponding second queue's value to the output queue.

2) The second UDF is basically getting the value of a counter from the memory.

There might be another UDF, called prior to the execution of this UDF which would basically count and store the counter in th memory.

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

Thanks..