cancel
Showing results for 
Search instead for 
Did you mean: 

File adapter validate file checking directory for files

Former Member
0 Kudos

Hi Gurus,

We have requirement. There are 3 directories (Processing, Error and Archive)in the Source side.SAP PI need to pick up a file called "abc.txt" from the processing tab.

But there is a condition.

1. If "abc.txt" file exists in the "Error" directory then Not process the interface.

2. If there is no "abc.txt" file in the "Error" directory then validate the file "abc.txt" in the "Processing" directory. If the file is not according to the validation rule then move the "abc.txt" file to the "Error" directory and then stop the processing.

3. if the above two conditions are ok then move the "abc.txt" file to "archive" directory and send the file to PI.

Please help me to achive this requirement.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Kevin,

The best solution is to use shell script for performing the mentioned validations before processing.

Develop a script to check the abc.txt is present in "Error" folder and do the needul.

Invoke this script in the sender Comm Channel in OS system command. Use Run Operating System Command before Message Processing

Cheers,

Souvik

Former Member
0 Kudos

Hi Kevin,

You need to use the option of "advanced selection for source file" in the source tab of sender comm. channel.

chk this link :-

http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm

/people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter

hope its of some help

Regards,

Rohit

Former Member
0 Kudos

Hi,

2. If there is no "abc.txt" file in the "Error" directory then validate the file "abc.txt" in the "Processing" directory. If the file is not according to the validation rule then move the "abc.txt" file to the "Error" directory and then stop the processing.

What is this validation rule?

-Supriya.

Former Member
Former Member
0 Kudos

I think you should consider using OS command feature of sender file adapter:

http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature