on 07-16-2010 10:16 AM
Hi,
I have a requirement to dynamically count the total number of segments and subsegments generated in the target structure(flat file) and map that count to the last field of the same structure.
This count should also consider the segment to which this field belongs.
Any suggestions on how this can be achived
Thanks in advance
Minisha
Hi,
You can achive this by seting the globle container in the root node and then incrementing it at the node which you want to count. You can write UDF to set the globle container variable. and when you want to increment it then write a UDF to first get the globle container variable and then increment it and set this value by calling the set globle container variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shweta,
Thanks for your response.
I am aware that global container variable can be used to get the count but am unable to implement it correctly in a UDF.
it would be really helpful if you could tell me how exactly the getParameter() and setParameter() functions should be used.
Regards,
Minisha
UDF for set globle container:
public String setGlobalContainer(String globalContainerName,String globalContainerValue,Container container){
GlobalContainer gc = container.getGlobalContainer();
gc.setParameter(globalContainerName,globalContainerValue);
return globalContainerValue;
Use: Send Variable name and value to initialise the count.
UDF to get the goble Container.
public String getGlobalContainer(String globalContainer,Container container){ //write your code here
String gctmp;
GlobalContainer gc = container.getGlobalContainer();
gctmp = (String) gc.getParameter(globalContainer);
return gctmp;
Use: when you want to increment: First call this udf with the veriable name you set in the first UDF. then increment the value by one and call set goble container UDF to set the new value of this variable.
had a chance to look thru some of the options mentioned here? - http://wiki.sdn.sap.com/wiki/display/XI/CountofRecords-%27Countontheeasiestway+through%27
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.