cancel
Showing results for 
Search instead for 
Did you mean: 

SAP XI -> Combine Two files as one in File Adapter

Former Member
0 Kudos

Experts,

I want to combine two files as one in File adapter itself. I am using a simple scenario of File-to-File where i am just sending the file from sender to receiver as it is , EXCEPT, i want to add one line at the end of the file .

I was thinking of doing this in File adapter , avoiding any mapping program in Integration Repository ..

ANY INDEA's ??

Regards,

Ashutosh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can achive this with using any Repository object.

What you have to do is just use any dummy interface name and namespace and configure Sender and Receiver File adapter.

In the Receiver File Adapter set the "File Construction Mode" parameter to "Append".

Gaurav Jain

Reward Points if answer is useful

Former Member
0 Kudos

Gaurav,

What does File construction mode 'Append' rally do ??? Does it append the incoming file to the previous one that is in the target folder ??? no matter what the filename is ??

Would appreciate your reply .

Thanks,

Ashutosh

Former Member
0 Kudos

If the file does not exist then it will create it and if it is already exist then append to the same file at the end.

and I guess this is what your requirement is.

Gaurav Jain

Points if answer is useful

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks all for your expert comments and suggestions.

Ashutosh

Former Member
0 Kudos

Hi,

Try this blog to transfer files without repository objects....Worked for me great!

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/4383] [original link is broken] [original link is broken] [original link is broken];

Former Member
0 Kudos

Hey

You have 3 options,first one can be to execute a OS command before message processing or use adapter modules to append the new line in the sender adapter.

the second option(and better one) is to do this via message mapping.

third option is to write a OS script and execute it after message processing on receiver file adapter.

one thing you need to make sure is that since OS scripts run on XI server itself(not on FTP server) so in case you are picking file from FTP server and delivering to FTP ,then you can't use option 1 or 3,you can only use option 2

Thanx

Aamir