cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI, How to split one XML File into multiple Files? (Beginner Approch)

0 Kudos

Hi,
I'm new in SAP PI and I can't perform this exercise:
Assume that you are in a class room and there are 10 students in it. The instructor then asks each student to prepare his/her the following personal details and save them in an XML file. The instructor then asks you all to prepare one single file with the personal details of each student in separate segments.
Write a scenario which will read this file and produces 10 target files where each file should correspond to the personal data of each employee. The target files should be named as cv_<emp_ID>_<timestamp>.

The structure of one XML Student File:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_Studentxmlns:ns0="http://sapdemo2.com">

<Gender>Man</Gender>

<Email>fake@email.com</Email>

<Mobile>9999999999</Mobile>

<Name>Richard</Name>

<StudentID>1</StudentID>

</ns0:MT_Student>


How can I do that??
Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor
0 Kudos

Hi Dario!

I guess, Multimapping and Variable substitution for file name along with "Add Time Stamp" construction mode in receiver file channel will fulfill your requirement.

Regards, Evgeniy.

Answers (2)

Answers (2)

0 Kudos

Hi Dario,

In HCI there is a step called splitter that can split your message depending on how you configure the scenario. Please check the an other community question with the similar question of yours and the official documentation of the splitter step: https://answers.sap.com/questions/451390/split-message-based-on-attribute-in-hci.html

https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/83e2022f9c014bebab63cb933e6...

Regards,
Balazs Barna

0 Kudos

Hi Evgeniy and thanks for your response,
Could are you more specific about MultiMapping? I'm totally new on this area!

former_member190293
Active Contributor