cancel
Showing results for 
Search instead for 
Did you mean: 

Input file should delete only after output file is processed

Former Member
0 Kudos

Hi All,

Let me know if we have any approach for the following scenario in SAP XI

In a file to file scenario, the input file will be picked from a directory location and after processing output file will be placed in the output directory location specified in the receiver communication channel.

In the sender communication channel for the scenario mentioned above, if the processing mode is given as delete, the input file will be delete as soon as the file was successfully read by the adapter, but this will not ensure that the file processing is complete and the output file is being created.

If we have a scenario in such as way that the input file should be deleted from the input folder only if the complete process is successful and the output is generated. how can we achieve this functionality?.

Accepted Solutions (0)

Answers (5)

Answers (5)

hemant_chahal
Contributor
0 Kudos

For the File Adapter transport protocol "FTP", the operating system command is NOT executed on the FTP server, but on the server hosting the Adapter Engine.

Former Member
0 Kudos

Hi,

This cannot be achieved with the processing mode of the file.

Once We use delete, as soon as the adapter sends the file to Integration Server, it is erased from the Sender Source Directory.

If you want to delete the Input File, once a target is generated, put the processing mode as TEST and construct a module in the receiver adapter, wherein you can code to delete the I/P as soon as O/P is generated, but i'm not sure whether a file can be deleted once it is in test mode.

Former Member
0 Kudos

Hi,

As you know the input file gets deleted once the file is read by the adapter.

In this case, it is better to use Test or Archive processing mode.

1. Use Test processing mode such that the file would remain in the same folder.

2. Use Archive processing mode such that the files are placed in a particular path once its been read. So, if the output file has not been created, you can use the input file again.

Regards,

Geetha J.

Former Member
0 Kudos

Hi,

You can use the Run Operating system Command After Message Processing. You can write a batch file which checks whether the processing is successful and deletes the file accordingly.

Regards,

Merrilly

Former Member
0 Kudos

I think for FTP we cant use Run Operating system Command After Message Processing.

Former Member
0 Kudos

Hi,

I think you can use it for FTP also.. Please refer this link.

http://help.sap.com/saphelp_nw70/helpdata/EN/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm

Former Member
0 Kudos

Hey Merrilly

No,you can't use OS command to run on FTP,all OS commands run only on NFS(XI server).a way around is to have a script on XI server which will internally call another script on FTP server.but even in this case,only the script residing on XI server is invoked by the adapter(not the one on FTP)

@Leelaratnam

why not use 2 async scenarios?you can get the status of message processing from the receiver system(it can be a flag and name of file),then check if the flag is correct,then overwrite the file with a blank file.one drawback of this will be that the original file won't be deleted,it will just be overwritten with a blank file.

Thanx

Aamir

Edited by: Aamir Suhail on Jul 7, 2008 7:57 AM

Former Member
0 Kudos

Hi,

The input file will be deleted only once the adapter places the file to IS.if you need to delete the input file only after delivering to the receiver, it is not possible....in this case you can go for Archieve mode rather than delete mode.

once the file is delivered to the receiver you can delete it from the archieve location.....

OR

you can use Command line option after message processing .....

Thanks,

Madhu