on 08-07-2008 1:29 PM
hi,
i need to map every 3 items from source interface to 1 in target interface.
i have on target interface parent node which is called 'item' and occurs 0..unbounded (and other sub-nodes).
this node have a sub-node which is called 'item_data' and occurs 0..3.
i created a mapping:
source_item ->counter->checking mod 3--->if
"""""""""""""""""""""""""""""" source_item -
> then -
>item.
when i test mapping with 1-3 source_item the sub-nodes 'item_data' are created,
but when i try 4-5 and more , 'item' node is created twice but the second instance has no sub-nodes of
'item_data' (it has other sub-nodes).
can someone tell me how to solve my problem?
thanks in advance.
Tomer
sub-node in target is in the same structure of a source item.
each parent target node needs to contain 3 items from source items
(or less if the number of source items is not divded by 3)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would like to be clear about the requirement first,
Source Target
item -
> item
item_data -
> Item_data
item -
>
item_data -
> irem_data
item -
>
item_data -
> item_data
item -
> item
item_data -
> item_data
item -
>
item_data -
> item_data
item -
>
item_data -
> item_data
for the mapping of item node the queue should look like:
[]
-
contextchange
-
[]
Then for the mapping of item_data the queue should look like:
item_data
item_data
item_data
-
context change
-
item_data
item_data
item_data
I guess you have used some udf for the target parent node (item) mapping. I am trying myself to generate the queue for item_data using standard functions, but yet to come up with the desired result. If achieved will let you know..................for now it seems that writing a UDF (queue) would be the best approach.
iterate through the input queue array (source item_data values all in same context using RemoveContext) and insert a ResultList.CC after every third element in the array.
Hope you can come out easily with the java for this logic. Let me know if it's helpful.
Regards,
Suddha
The mapping for the Item target node can be done using the following logic with Standard function,
Item (Source) -> removeContext-> index(0,1,entire)
-> div (by 3) -> floor -> SplitByValue(value change)
-> collapseContext -> Item (target)
The queue should look like
0
1
2
Child Field (item_data) mapping
generate the queue as above mapping but upto SplitByValue and use this queue as an input to FormatByExample function.
queue looks like:
0
0
0
---
---
1
1
1
---
---
2
2
item_data(source) -> FormatByExample
queue (gentd above) ->
Hope this will give you the desired result.
You may have a look at this veru useful blog:
https://www.sdn.sap.com/irj/sdn/profile?editmode=true&userid=3670343
Regards,
Suddha
Edited by: Suddhasatta Guha on Aug 11, 2008 3:21 PM
i will try to explain my probelm better and hope that you will tell me how to map it.
source interface: source_item 0..unbounded.
target interface: item(parent) 0..unbounded
item_data (child) 0..3
i need to group every 3 items from source items to 1 item in target
(many items in target, each contain 3 from source).
how do i have to map parent and child?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tomer,
Can you please share the mapping for the item_data field as well. That would help us to tell you if there is a context/queue problem in the child field mapping. From the initial symptomps it seems that the target queue context doesn't match (shorter) with that of the parent node item.
Regards,
Suddha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tomer,
Check the context of the source field as it creates new nodes with blank data if the condition is not satisfied.
Right click on the source field to access Context.
I hope this helps..
Thx
PSR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Go through this blog . It will serve your purpose.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.