Skip to Content

Move original files to another folder on SFTP server in case of exception : SAP CPI

Hi All,

Good Evening!

Requirement : To pick multiple CSV files together and send to S4 as combined xml and archive the source CSV files once it is successful and move to error folder if iflow is failed.

Solution approached : Have done using the datastores in a single artifact (calling multiple integration flows) and able to send to S4 using RFC adapter and archive successfully.

Issue : My problem is with error case.Whenever my scenario is getting failed, the SFTP server keep-on polling the iflow as files are still exist in the input folder and not getting deleted.

Tried below approaches,but no luck.

1.Tried to process the files to different folders based on RFC response,but stuck in middle as we have multiples files to send to respective directories and single final RFC connection.

2.Set post-processing option in SFTP sender adapter to delete,but files are not getting deleted, when iflow is failed.

Request everyone to suggest if there is any other procedure to do in CPI to delete the files if iflow is failed.

Thanks in advance!

Regards, Avinash

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jul 11, 2020 at 12:16 PM


    Create a header in the content modifier to store the payload,${in.body}. select the Delete option in the sftp adapter file from the source with the sender sftp adapter itself. if your tests are successful pull the header in the content modifier using. ${header. <headername>} and send it to sftp in the main iflow itself. else if it is failed use exception subprocess again pull the same header using the header and then post to failed queue.



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 13, 2020 at 09:32 AM

    Hi Bala,

    Thanks for the reply.

    I have creates separate iflows for different filetype and calling all individuals files to datastores and joining one after other by following a sequence in calling and creating a single XML file without maintaining any condition.



    Add a comment
    10|10000 characters needed characters exceeded