cancel
Showing results for 
Search instead for 
Did you mean: 

creating multiple files from a single file

Former Member
0 Kudos

Hello Friends,

I have a requirement like we need to create multiple files at the target side from a single file at the source side.

The files will be splitted on the basis of Invoice number.

we have a single file which will have all the Invoice details (line item) in a single file

for eg. sample file

invoice number* inv item item description

1234 10 test1

1234 20 test2

1234 30 test3

1235 10 test13

1235 20 test14

1236 10 test15

1236 20 test234

we have details of 3 invoices 1234,1235 and 1236.

we want 3 files to be generated at the target side for this

1st file is like:

1234 10 test1

1234 20 test2

1234 30 test3

2nd file is like:

1235 10 test13

1235 20 test14

3rd file is like

1236 10 test15

1236 20 test234

Please guide me with the development approach for this.

Please let me know if the requirement is not clear and you need more information on this.

Thanks

Kannu reen.

Accepted Solutions (0)

Answers (4)

Answers (4)

rajasekhar_reddy14
Active Contributor
0 Kudos

1)Create structure like below, both sender and target structire going to be same, and do file content converion in seder channle.

<invoice>------>1 to unbounded

<invoicenumber> 1..1

<invoiceitem> 1..1

<invoicedescription>1..1

</invoice>

2) implement multi mapping, change occurace of structure in message mapping signature tab to 0 to Unbounded, same chnage required in operation mapping also for inbound service interface

3)use node functions in mapping

suppose if your target message type name MT_INVOICE_TARGET

then create mapping like below

invoicenumber-->removecontexts-->sort-->splitbyvalue(valuechange)-->collapsecontect-->MT_INVOICE_Target

invoicenumber-->removecontexts-->sort-->splitbyvalue(valuechange)-->invoice

invoicenumber-->invoice
invoiceitem-->invoice
invoicedescription-->invoicedescription

this will work perfectly, i have tested.

Regards,

RAJ

Former Member
0 Kudos

Thanks you all for your great help and support!

we have tried this with multimapping and it is working for us.

nabendu_sen
Active Contributor
0 Kudos
Former Member
0 Kudos
rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

create xml structure like below

<invoice>------>1 to unbounded
   <invoicenumber> 1..1
   <invoiceitem> 1..1
   <invoicedescription>1..1
</invoice>

target strcure source structure going to be same, use node functions split by value,formatby example to split the record when value get changed(invoice number).

regards,

raj