Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 06, 2015 at 06:00 AM

    Dear Vaibhav,

    Please check the below link.

    Multi-Mapping using Java Mapping - Process Integration - SCN Wiki

    But instead of java mapping , I will suggest to use 1:N mapping with out ccBPM . It will be easy to understand .

    Regards,

    Add comment
    10|10000 characters needed characters exceeded