cancel
Showing results for 
Search instead for 
Did you mean: 

Message split

Former Member
0 Kudos

Hi,

I am configuring File - TO - File Integration Scenario.

The order consist of header and lines (items).

I want to split the messages - every message will consist the same header and one different line (item).

We upgraded to SP14 and I still can't split the messages..

1. In Message Mapping -> Messages I changed the occurrence of the target to 0..n.

2. In Data Type I set the occurrence of every line elements to 1..unbounded, and the rest (the header elements and the name of the recordset) to 1 .

3. In Interface Mapping I set the target occurrence to 0..unbounded.

4. I changed The Interface Determination type to enhanced.

After these changes, only one file is created which consist the header and all of the lines.

Thanks,

Ofir

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ofir,

I guess you have to create multiple receiver files for a Single Sender file. I have done such a scenario. The steps that you did in Message Mapping are correct. This was my scenario:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/splitMappingusing+UDF

In Integration Process you can go for Transfornation step in which you can collect output in multi-line container and jsut after that you can use Send step inside Block(Having Mode:Foreach).

No need for enhanced Interface determination.

I hope this solves you query.

Regards

VijayKonam
Active Contributor
0 Kudos

Create your data type with one header and one line item. Assign it the message type. In the mapping make the target message type as 0..n occurrences. No map the header the header. Map the repeating line item to the message header ( this will create as many messages as your line items). Then map the line item to the line item. Check the mapping by executing a sample.. you should fine multiple messages with one header and one line item.

Just do the normal configuration in ID. You are done.

VJ

Former Member
0 Kudos

Hi,

I think that Carlos and Arpil Solutions can help me..

I will describe in detail my current Message Mapping and the required output.

The message mapping (key 01 for header and key 02 for lines):

Message

Message1

MT_SendOrder (Occurrence in the source 1..1 , Occurrence in the target 0..unbounded)

input (1..1 , 1..1)

header (1..1 , 1..1)

key (1..1 , 1..1)

DocNum (1..1 , 1..1)

DocTotal (1..1 , 1..1)

......

line

key (1..1 , 0..unbounded)

DocNum (1..1 , 0..unbounded)

ItemCode (1..1 , 0..unbounded)

Quantity (1..1 , 0..unbounded)

Price (1..1 , 0..unbounded)

......

For example, I have the following source file (comma delimiter) :

01,123456,370$.....

02,123456,012,2,80$....

02,123456,013,3,70$....

01,111111,750$....

02,111111,015,1,350$...

02,111111,016,2,200$...

.....

The Output should be 4 XML files which consist one header with one line:

The first file:

<input>

<header>

<key>01</key>

<DocNum>123456</DocNum>

<DocTotal>370</DocTotal>

</header>

<line>

<key>02</key>

<DocNum>123456</DocNum>

<ItemCode>012</ItemCode>

<Quantity>2</Quantity>

<Price>80</Price>

</line>

The second file:

<input>

<header>

<key>01</key>

<DocNum>123456</DocNum>

<DocTotal>370</DocTotal>

</header>

<line>

<key>02</key>

<DocNum>123456</DocNum>

<ItemCode>013</ItemCode>

<Quantity>3</Quantity>

<Price>70</Price>

</line>

The third file.....

Regards,

Ofir

Former Member
0 Kudos

Hi Ofir,

Is it your source xsd right?

If your MT_Sender_order, input and header nodes have the cardinality set to 1..1, How do you get different headers from your source file?

01,123456,370$..... (One header)

02,123456,012,2,80$....

02,123456,013,3,70$....

01,111111,750$.... (Second header)

02,111111,015,1,350$...

02,111111,016,2,200$...

How do you do The File Content Conveersion? 1 File = 1 Message?

Please, type your xsd source in detail...

Carlos

Former Member
0 Kudos

Hi Carlos,

Its example to my xsd source.

You're right, In my example the occurrence of the header can't be (1..1), my real test file consist of one header so his occurrence is (1..1)..

The file content conversion is 1 file = 1 message.

Regards,

Ofir

Former Member
0 Kudos

Hi,

So, your source file consist of one header and several lines.

And you want to create a targer file per each line of the source file. And all the target files must contain the header of the source file, is it correct?

Well,

You have to map your line source node with your root target node.

And header source node (and subnodes) with header target node but in the middle of theese two nodes you have to include an advance user defined function commonly called CopyPerValue and then a SplitByValue function.

Try whit this,

Carlos

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Ofir,

Could you explain or paint in detail your message mapping?

Basically you need to replicate the header by using an advanced user defined function: copyPerValue().

Furtheremore, you need create context changes by using SplitByValue from your line node of your source to your root target node.

Check the queues when you test your message mapping, this will help you.

Regards,

Carlos