Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to split big XML files with Header and Trailer node using shell script/Java in SAP PI


Hi,


Currently I am working on File (XML file) to Proxy scenario. We are sending big XML files with Header node and Trailer node (which contains Trailer count) to the R3 system. Due to large no. of records tables are getting locked in the R3 system while updating. I need to split the XML file with correct Trailer count, so that I can send small files with say 100 records to the R3 system that too at an interval of few seconds. Please let me know whether it's possible or not. If yes, how to proceed further to do this.

For example:

Original File

<Header></Header>

<Record></Record>

<Record></Record>

<Record></Record>

<Record></Record>

<Record></Record>

<Trailer>

<RecordCount>5</RecordCount>

</Trailer>

Output File

File 1

<Header></Header>

<Record></Record>

<Record></Record>

<Trailer>

<RecordCount>2</RecordCount>

</Trailer>

After few seconds second files should be created.

File 2

<Header></Header>

<Record></Record>

<Record></Record>

<Trailer>

<RecordCount>2</RecordCount>

</Trailer>

After few seconds third files should be created and so on.

File 3

<Header></Header>

<Record></Record>

<Trailer>

<RecordCount>1</RecordCount>

</Trailer>

Thanks in advance.

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question