cancel
Showing results for 
Search instead for 
Did you mean: 

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

n_rvsavinashvarma
Participant
0 Kudos

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

bhalchandraswcg
Contributor
0 Kudos

Hi Avinash,

What is your condition for combining the files in one XML?

Like, if the folder contains files File1.csv, File2.csv, and File3.csv, how do you know File1.csv and File2.csv will become one XML file and File3.csv will be a separate XML file?

Accepted Solutions (0)

Answers (2)

Answers (2)

n_rvsavinashvarma
Participant
0 Kudos

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.

Regards,

Avinash

former_member666312
Active Participant
0 Kudos

Hi,

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.

Thanks,

Vijay.

n_rvsavinashvarma
Participant
0 Kudos

Hi Vijay,

Thanks for the response. I have done the same and able to create files in respective directories,but files are not getting deleted as we have post processing mechanism in CPI.

Regards,

Avinash

former_member666312
Active Participant
0 Kudos

Hi ,

you mean even in success case or failure or both.

Thanks and Regards,

Vijay.

n_rvsavinashvarma
Participant
0 Kudos

Yes Vijay.I am able to create files in respective directories in both success(directly) and failure cases(reading from content modifier).But the files are not getting deleted from the source directory.