Skip to Content
avatar image
Former Member

SAP PI 7.3.1 File Adapter - Select file based on content

Hi all,

I have a scenario where I need to process a file differently based on the content within the payload.

For example a file called File_IS,xml is sent to a folder that PI is polling. Within this file is a field <TYPE> which I want to use to determine whether the file should be used  . I have two mapping scenarios that each have a file sender communication channel polling for the same file name "File_IS.xml" .  This is because a message will come from a 3rd party with the same file name but the content can be different meaning different mapping scenarios are required.  IF Com_Channel_1 sees the File I only want it to be picked up if say <TYPE> = 'A' - if not then Com_Channel_1 should do nothing with this file.  Similarly Com_Channel_2 should only use the file if <Type> = 'B'. 

Scenario:

File_IS.xml       -> File sender 1  -> <TYPE> = 'A'  - Pick up file - do mapping - archive.  <TYPE> <> 'A' - do nothing and leave file in folder

                      ->  File sender 2  -> <TYPE> = 'B'  - Pick up file - do mapping - archive.  <TYPE> <> 'B' - do nothing and leave file in folder

Is the above possible at all ?

Thanks for your time.

Best Regards.

Gary

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 26, 2014 at 10:58 AM

    Hello,

    Since u are polling files from same folder for both the scenarios so instead of using 2 different channels use only one file sender channel and detremine routing conditions at interface determination level?

    Hope the input structure for both the scenarios is same?

    Thanks

    Amit Srivastava

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 26, 2014 at 11:06 AM

    Hello,

    In case content of input files are different (for both the scenarios) even then also u can use one file sender channel. Check below approach:

    Thanks

    Amit Srivastava

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Amit,

      Thanks alot for your help. Of course that makes sense. I was over complicating it 😊

      Thanks very much for your time and help.

      Best Regards

      Gary