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:
and we want to create a Dest_line for each number in a range from source XML structure:
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.
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.
The code below inserts values from the container into the result of our function (getContainer):
Let's suppose we have such a source structure:
and we want to create a Dest_line for each number in a range from source XML structure:
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.
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.
The code below inserts values from the container into the result of our function (getContainer):
No comments:
Post a Comment