Skip to Content
0

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

Mar 13 at 09:08 AM

56

avatar image

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"?>

http://sapdemo2.com">

<Gender>Man</Gender>

fake@email.com

<Mobile>9999999999</Mobile>

<Name>Richard</Name>

<StudentID>1</StudentID>

</ns0:MT_Student>


How can I do that??
Thanks a lot!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Evgeniy Kolmakov Mar 13 at 09:43 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Balazs Barna
Mar 13 at 10:14 AM
0

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/83e2022f9c014bebab63cb933e625610.html?q=splitter

Regards,
Balazs Barna

Share
10 |10000 characters needed characters left characters exceeded
Dario Arrigo Mar 13 at 09:56 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
0