cancel
Showing results for 
Search instead for 
Did you mean: 

Sender file adapter- Process multiple files in a sequence

0 Kudos

Hi

We have two source files (abc.pdf & 123.xml) in the same source directory and need to follow sequence in processing the files.

abc.pdf should be picked first and processed (file to file) and then (123.xml) should be picked (file to idoc) else this will result in conflict due to some dependency.

Please let me know if the below approach would work.

1) We can set External control mode for sender file channel (123.xml) and start the channel once 1st scenario is competed and stop it after 2nd scenario is done

or

2) Specify a condition in sender file channel (123.xml) "to pick the file only if (abc.pdf) is not available in the folder" or "to not to pick the file as long as (abc.pdf) is available in the folder"

Kindly provide your valuable suggestions on how to maintain the sequence in processing of those files.

Regards

Sudarvizhi P

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member190293
Active Contributor
0 Kudos

Hi Sudarvizhi!

If you have only two files to be taken and its names are constant, you could try to use approach described in this blog:

https://blogs.sap.com/2017/03/13/taking-additional-file-from-another-folder-using-file-sender-adapte...

Regards, Evgeniy.

JayChan
Active Participant
0 Kudos

Hi, Sudarvizhi

How about using bridge technique to link 2 interfaces?

Firstly grasp 123.xml to its destination, then bridge to 2nd integration configuration to grasp abc.pdf to its IDoc destination.

I used following demo to illustrate my idea (since I don't have suitable IDoc target system, I represented it with another file system instead)

Step1. Create 1st sender channel, grab abc.pdf

Step2. Create 1st receiver channel. In the tab of "Module" in 1st receiver channel, config bridge configurations

Step3. Configure 1st integration configuration to make it effective sending abc.pdf to 1st file destination system.

Step4. Create 2nd sender channel, grab 123.xml

Step5. Create 2nd receiver channel, in your case I think it will be a IDoc destination(since I don't have suitable IDoc target system, I represented it with another file system instead)

Step6. Create 2nd integration configuration, be aware to check "Sender Uses Virtual Receiver"

0 Kudos

Hi

There is no flexibility with the file names. kindly suggest is it possible to pick both files (abc.pdf & 123.xml) with same sender channel using "Advanced selection for source file" with 123.xml as payload and abc.pdf as attachment. Does "Payloadswapbean" allows this option?

In other words, my requirement is to process 123.xml alone in PI and just move abc.pdf to archive folder.

Regards

Sudarvizhi P

former_member190293
Active Contributor
0 Kudos

Hi Sudarvizhi!

If there is any possibility to name the source files as abc.pdf, abc.xml - you could use "Additional files" option of file communication channel.

You create two receiver interfaces to process main payload and attachment separately and use "Maintain sequence at runtime" for those interfaces to use EOIO processing mode.

Regards, Evgeniy.

0 Kudos

This is not scheduled for particular time. We are not sure when the file will be placed in source folder.

former_member607993
Contributor
0 Kudos

Hi Sudarvizhi,

You can create 2 different sender communication channels (with appropriate file name scheme) and set the 'Availability Planning' sequentially may be in a frequency of once in a day.