Enterprise Resource Planning PortalERPGenie.COMEnterprise Resource Planning Portal

   Advertise | BLOG

Web ERPGenie.COM

Home | Vote for us |

ERPGenie.COM -> NetWeaver -> Process Integration -> XI (Exchange Infrastructure) -> Global Container

GlobalContainer - in graphical mapping (XI)

Michal Krawczyk

 There are times when we want to create many tags from just one source tag - imagine situation, when we get serial numbers as a range (from, to) and we have to create one tag for each serial number.

Let's suppose we have such a source structure:
image

and we want to create a Dest_line for each number in a range from source XML structure:

image

If we want to create many tags we have to remember that producing only Number's will not be enough because we also have to create the same number of Dest_line's.
We could do it by creating the same function for tag Number and Dest_line but is it realy nessecary? No way.
SAP gives as a standard object GlobalContainer which can hold an array and from which we can get our array in another function.
So let's start with creating our advanced function and connect it with Dest_line tag.

image
The code below inserts numbers into our container under the name of "our_number" (setContainer):

GlobalContainer globalContainer = container.getGlobalContainer();

int from = Integer.parseInt(a[0]);

int to = Integer.parseInt(b[0]);

ArrayList list = new ArrayList();

 for (int i=from;i<=to;i++)

{

String s = String.valueOf(i);

list.add(s);

result.addValue(s);

}

 globalContainer.setParameter("our_number", list.toArray(new String[0]));

 Then we can use values from our container to fill the Number tag.

The code below inserts values from the container into the result of our function (getContainer):

GlobalContainer globalContainer1 = container.getGlobalContainer();

String[] b = (String[]) globalContainer1.getParameter("our_number");

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

{

result.addValue(b[i]);

}

Contact Us | Polls | Add URL | Contribute | About | Privacy | Terms | Feedback | Help!

Message Board | Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job