on 2024 Aug 05 6:35 PM
Hi Experts,
In SAP CPI we have a requirement to pick the files from SFTP location in particular sequence.
For example, source systems places three files daily in SFTP location
Newfile_050824.csv
Testfile_050824.csv
Changefile_050824.csv
CPI has to pick the files in below sequence
first file :Testfile_050824.csv
second file :Changefile_050824.csv
third file Newfile_050824.csv
and route the files to a process call where it has steps to change the structure.
Please let me know how to pick the files in the above order from cpi. Thanks in advance.
To pick up files in a particular sequence, you can design the iflow in below manner.
By employing sequential multicast, we establish three branches that execute in sequence. Each branch contains a Content Modifier that generates a property called "filename" with a unique value. This property is utilized by the SFTP Poll Enrich adapter, enabling the filenames to be passed and polled sequentially.
iFlow Design -
Content Modifier - "Filename 1"
Content Modifier - "Filename 2"
Content Modifier - "Filename 3"
SFTP Poll Enrich Adapter -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If your filenames are dynamic, so say current date is appended to the filename and your requirement is to pick up only current dated files then the content modifier where filename is being set must be updated as below.
Example for first file : "Testfile_050824.csv" it must be updated to "Testfile_${date:now:ddMMyy}.csv"
Aggregation algorithm in Poll Enrich depends on what you want to do after polling all these three files individually. Here in above design it would create three branches and you would have each branch with its own file's payload. "Replace" should be the used.
Combine XML: Combines the message polled from the external component with the original message without any conditions. The messages are combined in multimapping format.
Concatenate: The message polled from the external component is added to the existing message.
You can read more about aggregation algorithm here - https://help.sap.com/docs/integration-suite/sap-integration-suite/define-poll-enrich
User | Count |
---|---|
82 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.