Skip to Content
Technical Articles

Impede Duplicate Files

There are always questions in the forum about How to stop or do not allow the duplicate files to be processed. In this Blog I would exemplify a way to handle the duplicate files with the RFC functionality.

Approach to the Solution:

1. Create an transparent table in XI to store the filename, date and time of the file processing. This table help us to keep track of the file names, date and time it got processed for our reference.

2. Create an RFC enable function module. This function can either query a filename into the table or insert a filename to the table. It has a import parameter for accepting the filename and an export parameter to respond the called program if the file is a duplicate one.

Function of RFC.

RFC imports the filename and checks if the file name already exist in the transparent table.

i. If there is no entry for the filename which is passed then the filename is added to the table and the export parameter Z_Duplicate is set to N and returned. In the othere case i.e.

ii. If there is a entry in the table for the given filename then the parameter Z_Duplicate is set to Y and returned.


1. Create a transparent table from SE11.

Transparent Table

2. Create a RFC enabled function module with the import parameter Z_FILENAME and the export parameter Z_DUPLICATE.

Import Parameter


Export Parameter

3. Add the following code to the function module.

4. Import the RFC in to XI.

RFC FunctionModule

5. Map the filename to the RFC parameter Z_FILENAME.


Note: Retrieve the Filename by enabling the Adapter-Specific Message Attributes in the sender File CC and using the Dynamic Configuration Parameter in the UDF.

6. Send synchronous message to the RFC in the IP.


7. In the switch statement check if the Z_DUPLICATE is Y.
a. If yes transform the file name to the mail content and send a rejection mail.
b. If no then send the IDoc to the R3 system.

You must be Logged on to comment or reply to a post.
    • Farooq Thanks for the comments.
      Yes! Adapter module will stop the file in the AE itself. However how reliable and secure is to store the file name in a text file?

      Most importantly requirement in our project was to find the missing file names. The inbound files were odd numbered like *01.*, *03.*, *05.*….
      We had a report to generate the missing file names sensing the processed file names from the transparent table.


  • Also if during the processing time(when IP try to do RFC lookup), if RFC calls fails, then it will affect the whole interface/interfaces.
  • Good n simple blog…but design issues…

    Why do we need a FORK after the receive?
    If the file is duplicate why do we need to execute the mapping for IDoc?


  • BTW: some Adapters for PI (especially the EDI Adapters) do duplicate checking themself, or have modules for this. That way you dont need to involve the Process engine and you are transactionally safe.


  • Well, there is always one legacy system that can send only files with static names. Though static file names are not the best design, they do exist. The only way we can be sure of duplicate processing in case of static files would be to have controls at the application logic level.
    Anyway, BPM seems to be a overkill for this. I would go with Adapter module as suggested by some of our folks. If you still think, we go to do RFC look up, I would do it in the mapping, throw a mapping error and send emails using CCMS instead of using a BPM.