on 10-02-2009 9:51 PM
Hi
Question on message mapping - wrt to split by value node function
I have the following source structure : which is the result of a sql select ( SQLsender adapter )
mt1
row
f1
f2
f3
row
mt1
In the target, we have a idoc with an unbounded structure
ZORDERS5
IDOC ( 1 to unbounded )
BEGIN
EDIDC40
.......
IDOC
Now, for every change of value of field f1 , I want to create a new idoc.
I did the following :
1. Changed context of field f1 to point to message type mt1
2. Use split by value ( change of value option ) against field f1 and pointed to target - idoc unbounded node.
In my test sample, I have total of 9 records, sorted by field1. First six records have value 'A' for field1 and last three records have value 'B'. I expect two idocs to be created.
But I see six idocs being created ( for the first six records ) . Where am I going wrong ? Is SplitByValue the right node function to use here.
Karthik-
Use field-> collapse context -> splitbyvalue (value change) -> collapse context-> IDOC (0... unbounded)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
use the below mapping for Header node ...
Use field -> splitbyvalue (value change) -> collapse context-> IDOC (0... unbounded)
use the below mapping for E1EDP01 . ( Item segment ) node ...
Use field -> splitbyvalue (value change) -> E1EDP01 (0... unbounded)
use the below mapping for fields in the item node E1EDP01...
Use field -> splitbyvalue (each value) -> in the item node E1EDP01
hope this will be useful for u...any other queries pls post ..
Regards,
Ramana
Hi Karthik,
Do the mapping as said by Ramana but for fields in the Item nodeE1EDP01
I think splitByValue is not required just do direct assaigment
f1---->in the item node E1EDP01
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
So you can have multiple idocs created by every change on field f1. You need to first change the occurene of idoc from 1..1 to 0..unbounded.
Then for idoc you need to map like this:
field1 --> splitbyvalue (right click and put on value change) --> idoc. So this would take care of creating multiple idocs for any cahnge on field1.
Please see this blog for how to change the occurence:
/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
> In my test sample, I have total of 9 records, sorted by field1. First six records have value 'A' for field1 and last three records have value 'B'. I expect two idocs to be created.
The best thing to be is to change the query so that it picks up in sorted manner and you dont have pain doing this in mapping. Just tweak the query accorindly.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I have already set the idoc node to unbounded ( thats why the mapping creates 6 idocs instead of one ). I also have already sorted the sql result by field1. What I am not getting is - two idocs ( one for all records as items in the idoc 1 to 6 ) and second idoc ( with items 7 to 9 ) for the second distinct value of field1.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.