on 11-26-2008 11:21 AM
Hi Experts,
How to count the IDOC segment if particular field value is "IN".?
Regards
Sara
use small UDF.
compare the field value with IN if its IN then increment the count. use for loop and if condition.
output result will be counter value.
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sara,
Try to use the following UDF's for increment and initialisation of the counter
Increment the Global Variable Counter
public String incrementCounter(String a,Container container){
//write your code here
if(a.equals("IN"))
{
Object o = container.getGlobalContainer().getParameter("CNTR");
Integer ii;
if( o == null ) ii = new Integer(0);
else ii = (Integer)o;
ii = new Integer( ii.intValue() + 1);
container.getGlobalContainer().setParameter("CNTR", ii);
String temp = ii.toString();
return temp;
}
else return " ";
Intialise the Counter
Object o = container.getGlobalContainer().getParameter("CNTR");
Integer ii = new Integer(0);;
container.getGlobalContainer().setParameter("CNTR", ii);
return "1";
Regards,
Vinod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi sara,
Try this its possible through standard functions
field----->
EqualsS----IfWithoutElse------Segment------>then--->COUNT(statistics)---->Target Node
Constant(IN)
Just set the proper context to one level up in parent hierarchy
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.