cancel
Showing results for 
Search instead for 
Did you mean: 

Display error message while reading the same file again and again

Former Member
0 Kudos

Hi

I have done file to file scenario. I have file with file name ex: file20070129.txt. First time i will pick this file and i will send it to destination by mistake if i read the same file on the next day or the same day i have to send an error message to destination. How to achive this scenario.

Thanks & Regards

Ravi Shankar B

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Ravi,

To avoid these mistakes please use the mode "Delete" in your sender file adapter.

Also if you cannot delete those files you can run a unix job which will move the file in some archive folder

Thanks

Amitanshu

Former Member
0 Kudos

Hi

I know if i use delete we can avoid such mistakes. But by mistake if any one places the same file in the same directory manually or if some one created the another file to file scenario with same file name(content may be different) in these situations xi will read the duplicate file or same file which manually placed by some one. So when ever these situation arises i would like to send an error message to reciever.

How to do this

Thanks & Regards

Ravi Shankar B

Former Member
0 Kudos

Hey

i m not sure how are u gonna implement this scenario but its gonna be a tedious job if u want to store all the file names.just suppose ur gettin 1000 files everyday,then u need to strore these 1000 files so within a month u will have 30,000 files:)

do u want to waste resources to compare ur file name with these 30,000 files.

better option would be to dedicate ur directory to only ur scenario, and make sure no one access that.in that way no one can post file in ur dir. so no question of duplicate entries

thanx

ahmad

Former Member
0 Kudos

HI

My scenario is simply like if i have any duplicate file in the same directory i have to send an error message. How to do this scenario. Please this is urgent

Thanks & Regards

Ravi Shankar B

Former Member
0 Kudos

Hi-

I think expect selecting the mode as delete the file.

There is no way to meet your requirement.

Hope comes up with some solution.

former_member335553
Active Contributor
0 Kudos

Hi

Possible way would be to use delete option after picking up the file ,since no 2 files can exist with the same name in the same directory

Former Member
0 Kudos

Hi

Ok if two XI servers are accessing the same file if one deletes the file how come the other one will access. In this situation i cant delete the file right. Then how can i avoid the duplication..

Thanks & Regards

Ravi shakar B

Former Member
0 Kudos

Hi Ravi,

Okay If two XI Servers are accessing the same file you can try some thing like this

1) Configure 2 File Sender Adapters in both XI Servers.

2) Assume File_Sender_1 Picks up the file first(Takes the file to Server1)

3) Set the "FileName" as "Pickable.*"

3) Use the Command line function to rename the picked file say from (Pickable to Picked )

4) Now go to the second server and configure it's file sender adapter

5) Set the "FileName" as "Picked.*"

6) Set Processing Mode as"Delete" in this adapter.

Try this setting in both of your adapters.

For Command Line funtions see::-

/people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions

1)Windows batch Commands::

http://labmice.techtarget.com/articles/batchcmds.htm

2)Linux

: /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching

Hope this will help you, try it.

Regards

Piyush

Pl:reward points if it is help full.

prabhu_s2
Active Contributor
0 Kudos

ravi

a quick thought on this, havent tried it but can check this out:

1. when a file is read, take the file name and store it ins a DB/FILE using lookup.

2. When the interface is scheduled to run for the second time, check if the same file is found in the DB/FILE again using lookups.

3. If yes throw an exception.

above 3 points needs to be programed in one udf.

Shabarish_Nair
Active Contributor
0 Kudos

you can try archiving the file once read thats one simple solution !!!

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

- processing mode as archive !!!

Else i think you will have to go in to implement a module to do the checks.

Former Member
0 Kudos

Hey

once u read the file,u can delete it or send it to archives folder.

this will make sure u dont have that file in sender directory,so there is no question of readin it again

thanx

ahmad