cancel
Showing results for 
Search instead for 
Did you mean: 

duplicate File name check

Former Member
0 Kudos

Hi,

I need to check whether the incoming file is already processed or not. The files are been placed on XI server. If the file with same file name comes then i dont want to process it. I am polling for files on xi server using file adapter.

regards,

Miten

Accepted Solutions (0)

Answers (2)

Answers (2)

prateek
Active Contributor
0 Kudos

There is no direct configuration to achieve this functionality.

The possible options could be:

1. Writing and adapter module for handling this functionality

2. Use the file adapter functionality "Run Operating System Command Before Message Processing" for doing some process on the already received file. U may then archive that file using the OS commands.

3. Create an empty table in SAP or any databse for storing only filenames. Filename will be primary key. This table will be filled only when a new file is received. Otherwise u may check for the existing filename using RFC/JDBC lookup.

Regards,

Prateek

aashish_sinha
Active Contributor
0 Kudos

Hi,

I am agreed with prateek. You can use the "Run Operating System Command Before Message Processing" and "Run Operating System Command After Message Processing". This is a correct solution to check using the shell script if it is in the same server or you may need to write some masssagin in you shell script.

Also it is possible to maintain a file listing somehwhere in database and before posting it to the target location just do a lookup for the same file name using JDBC/RFC lookup. and if it returns true then don't pu otw dump it in target location.

Hope this will help you.

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

Hi,

You can check the file name using the lookup. Maintain the table at R3 end, Send the file name at the R3 end and for the first time u update the entry of file name in R3 table.

Now when second time ur scenario runs then send the file name to R3, in the FM check the file name with the file name which is maintained in the table if its not the same then update the table with the new file name and if it is same then pass the false value to XI and it will suppress the root node in message mapping.

If file name is different then pass true value to XI and generate the Root node.

Lookup:

Lookup method from GUI mapping can be called using any of the following ways.

• RFC lookup using JCO (without communication channel)

/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups

• RFC lookup with communication channel.

/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

The steps are as follows:

• Develop and test ABAP function module.

• Develop and test Java method within Integration Repository/message mapping tool.

Thnx

Chirag

Former Member
0 Kudos

Good Solution by Chirag.

Also have a look on the Archive Option provided by the File Adapter. It will simply archive the processed file to other folder.

Thanks

Farooq