cancel
Showing results for 
Search instead for 
Did you mean: 

PI/PO file routing depending on content

former_member99246
Discoverer
0 Kudos

Hello,

I have quite complex scenario where I need to pop files from given file share and, depending on content, push data to different places. Content is different, some files are XML, some are plain text like CSV. The problem is the files have the same name pattern and it's not possible to know what's inside before looking. The question: is it possible to use PI/PO to get all files and depending on the content push it to different receivers?

Best regards,
Pawel

Accepted Solutions (0)

Answers (3)

Answers (3)

sugata_bagchi2
Active Contributor
0 Kudos

use extended receiver determination.

former_member190293
Active Contributor
0 Kudos

Hi Pawel!

You could use Extended Receiver Determination functionality provided in SAP PI to build the list of receivers using separate OM (and MM). Using java mapping, for example, you determine content type of the given file and append respective receiver in result list accordingly.

Regards, Evgeniy.

vicky20691
Active Contributor
0 Kudos

Hi Pavel,

Without wasting any time no out of the box functionality, if it not pdf or excel something which can not be read as string or stream bytes by Java mapping then you can do it in java mapping

1. read the file in java mapping.

2. Match the exact string in the content on which you want to route.
3. write dynamic configuration code in the map to set different directory or filename.

https://blogs.sap.com/2015/01/12/dynamic-and-yet-perfectly-static-benefits/

java mapping for dynamic config

https://wiki.scn.sap.com/wiki/display/XI/Sample+Code+-+Dynamic+Configuration+in+Java+and+ABAP+Mappin...

https://blogs.sap.com/2017/11/02/sap-pi-java-map-to-read-file-and-return-it-to-target-message/

Regards,

Vikas