on 2007 Aug 17 2:00 PM
I have a scenario where the target field of one idoc segment should get populated ie. field should count how many other different segments are generated in the target.for example
segment A comes to 2 times then say field of segment C should be 2 in the target
Hi Guys thanks for the answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can 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(" "))
{
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 " ";
<b>Intialise the Counter</b>
Object o = container.getGlobalContainer().getParameter("CNTR");
Integer ii = new Integer(0);;
container.getGlobalContainer().setParameter("CNTR", ii);
return "1";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Arijit,
You can use the function "Count" here....assign "A" as input to function count..it will return you number of "A" segments in payload.
Nilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guha,
Could you give the sample input/output payload? It could be easy for us to suggest.
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.