Skip to Content

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.

Steps:

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.

Mapping

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.

IP BPM

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.

To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

    1. Santhosh Kumar Vellingiri Post author
      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.

      Thanks
      SaNv…

      (0) 
  1. Sumit Khetawat
    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?

    Regards,
    Sumit

    (0) 
  2. Bernd Eckenfels
    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.

    Bernd

    (0) 
  3. Krishnakumar Ramamoorthy
    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.
    (0) 

Leave a Reply