cancel
Showing results for 
Search instead for 
Did you mean: 

Question on node function in XI

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Karthik-

Use field-> collapse context -> splitbyvalue (value change) -> collapse context-> IDOC (0... unbounded)

Former Member
0 Kudos

Hi

In this mapping - we need first six records from source to be part of the first idoc ( line items ) and the last three to be part of the second idoc. How do we map the E1EDP05 for this ?

Former Member
0 Kudos

Sorry, I meant E1EDP01 . ( Item segment )

Former Member
0 Kudos

Ravi - I have a question - how do I make sure that first six items ( item level info )come under idoc 1 and rest under idoc 2 ?

How do I map the item segment E1EDP01 ( unbounded ) in this scenario ? Appreciate your input .

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.