-
Dynamic File Name/Directory Using Parameters and Camel Expressions in SAP Integration Suite (CPI)
In Integration Suite (CPI), you can use headers or exchange parameters to define the file name and other values that need to be set at runtime. Then, by using Camel Simple Expressions, you can assign the value of those parameters to file name, directory, etc.—at the receiver adapter during runtime.
Of course, for more complex file name determination logic, you can implement the logic using a Groovy Script of a User Defined Function (UDF).
Check my example – Define Dynamic Parameters at the Receiver Adapter in SAP Integration Suite CI (CPI)
-
Adapter Specific Message Attributes (ASMA).
This is most suitable for a file-to-file scenario where you want to set the file name according to the sender file name. Adapter-specific messages attribute from the sender can be set to the receiver by configuring the communication channels accordingly.
Check my example (includes variable substitution also) on this @ https://sapintegrationhub.com/pi-po/asma/adapter-specific-message-attributes-sap-pi/.
-
User Defined Function (UDF).
This method is suitable for complex file name generation where you want to generate the file name based on a complex logic using the incoming message content. For example if you want to set a substring of a certain variable to the file.
Check my example @ https://sapintegrationhub.com/pi-po/udf/dynamic-file-name-udf-sap-pi/
-
Variable Substitution in the communication channel.
This method can be used if you want to create the file name from certain attributes of the receiver payload.
Check my example @ https://sapintegrationhub.com/pi-po/file-adapter/variable-substitution-dynamic-filename-sap-pi-po/
Hello Isuru,
In the sFTP adapter there is no “File Schema” parameter, we only have Filename.
How would i use the ASMA parameter “FileName” from the source channel here?
please advise.
thank you
Hello Javier,
You can use a UDF to read the fileName partmer.
Regards,
Isuru