cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie trouble with message mapping context / SplitByValue

Former Member
0 Kudos

I seem to be missing a trick here because from what I've read this should work...

My source looks like:

MT

+HEADER

+DETAIL

++SHIPMENT:1

++LINE:1

+DETAIL

++SHIPMENT:1

++LINE:2

+DETAIL

++SHIPMENT:2

++LINE:1

+FOOTER

My source file is very flat so thats why each line of detail includes header type information like Shipment Number.

I'd like to post a new IDOC for each changing value in Shipment number. So in this case I would want 2 IDOCS. I try mapping like this but I only get 1 IDOC:

SHIPMENT => SPLITBYVALUE: VALUECHANGED => IDOC

I see 3 IDOCS if I map DETAIL => IDOC (not what I want but shows I can post multiple idocs)

I've tried adding a <RemoveContext> to the equation with no joy.

Is there a trick to using SplitByValue in this way to pick up on a data value change in a detail row of flat file source and use to trigger a new IDOC segment to the message?

Many thanks for your suggestions...

Aaron

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Well, it turns out this function is more complex than the simple examples in normal documentation. Stefan Grube's blog post really explained how to do what I was wanting.

[/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13|/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13]

The mapping goes something like:

Shipment => removeContext => SplitByValue (Value) => collapseContext => IDOC root

Then a similar mapping for sub-segments in the IDOC heirarchy keep related records under the correct IDOC branch:

Shipment => RemoveContext => SplitByValue (Value) => FormatByExample (upper input is Shipment) => E1 IDOC segment

If you need a resetting counter underneath one of the segments use:

Shipment => RemoveContext => SplitByValue (Value) => Index => SplitByValue (Each) => ITEM_NUMBER

Former Member
0 Kudos

Hi Rajesh,

I'm not aware of the ContextChange option, where would I find this? I don't see it as a node function or option on the Split function. By the way, we are on version XI 3 service pack 23 so I'm not sure if this changes the game.

Regards,

Aaron

Former Member
0 Kudos

this option will be available for SplitByValue node function and provide the option there as ContextChange

not sure chk the options for splitByValue function have..

Rajesh

Former Member
0 Kudos

The function properties say

"Insert context change after:"

Each Value

Value Changed

Empty Space

I'm having trouble getting the Value Changed option to work.

Thanks,

Aaron

Edited by: Aaron Myers on Apr 7, 2009 7:44 PM

Former Member
0 Kudos

Check the queues how it is generated at run time by right click on function

also during mapping right click source and change the context to immediate level and chk or to the top level and check

may be you have not changed the context of the source

Rajesh

Former Member
0 Kudos

Hi, after checking the queue I see the Shipment numbers 5 times, presumably 1 for header iteration and one for footer, pluse 3 for my detail rows. I'm hoping to only show 2 times because my test data has 3 rows and two unique shipments.

Forcing the context to a higher level didn't correct the results.

Thank you for the ideas!

-Aaron

Former Member
0 Kudos

This example on page 70 of XI Mapping PDF on SDN seems to be close to what I'm doing. However I cannot get it to work, I wonder if it is a typo to have two things mapping to the new context?

[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638]

Does anyone have another example of this SplitByValue working with a ValueChange condition?

Failing this, maybe I could go through a two level mapping if necessary. Any advice is really appreciated.

Regards,

Aaron

Former Member
0 Kudos

Hi,

/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

Regards.

Sunil.

Former Member
0 Kudos

did you tried splitByValue contextChange option

for generating idocsbased on shipment context

Rajesh