Skip to Content

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 numer.

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):

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

image

This is a basic example but I hope it can be usefull for someone starting his advanture with XI 🙂

Special thanks to

Maciej Klimkowski

for his valuable help with Java. 

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. James Legg
    Hi Michal,

    As I understand it this only accesses a container from within the mapping instance.  If I’m mapping from within the BPE, is there a way to go up a level and access the variables defined in the BPE container?

    btw seems to be a minor formatting error with your blog 🙂

    Thanks
    James

    (0) 
    1. Adam Caggiano
      I’m also trying to do the same to access GlobalContainer to simplify a UDF that’s really complex. Does anybody have this answer?
      (0) 
      1. Michal Krawczyk Post author
        Hi,

        >>>I’m also trying to do the same to access GlobalContainer to simplify a UDF that’s really complex.

        we don’t use globalcontainer anymore as we have
        global variables which are much easier to use

        Regards,
        michal

        (0) 
    2. Michal Krawczyk Post author
      Hi,

      >>>If I’m mapping from within the BPE, is there a way to go up a level and access the variables defined in the BPE container?

      no you cannot access it from a BPM

      Regards,
      michal

      (0) 

Leave a Reply