cancel
Showing results for 
Search instead for 
Did you mean: 

PI File Adapter - Duplicate File Content Check

former_member185846
Active Participant
0 Kudos

Dear Experts,

It's good to see that SAP is providing the standard option to check or avoid duplicate file processing based on just file name. But, it would've been better if there's some option provided like duplicate file check based on 1. File Name Only 2. File Name and Content 3. File Content Only. 

Any suggestions?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member185846
Active Participant
0 Kudos

Thanks for all the suggestions. But, I'm saying PI should provide such option to make it more robust.

Baskar, Do you mean archive the source files and compare the input files with the archive files using Unix script? In that case, how can you stop the further processing of the adapter if there's a duplicate file content??

Thanks

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>>In that case, how can you stop the further processing of the adapter if there's a duplicate file content?

Using unix script check whether file content same for the files that exist in a directory. Run the script using some cron job for a specified interval of time. If so, remove the duplicates and move those files to an another directory where you configured file adapter to pull files.

former_member185846
Active Participant
0 Kudos

Got it, thx.. do you've the script the handy? ..pls share it if you've it..

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Experts,Baskar,

Kindly share the unix script if you have it in handy.

Thnx,Nithin.

anand_shankar10
Active Participant
0 Kudos

Hi Joe,

As mentioned by Baskar, the file adapter processing tab gives you flexibility to enable the duplicate check based on the file name. But incase you need to check the content go with the option of maintining the data in some Z-table in ECC and make a RFC lookup everytime to check if it has been processed earlier. But heck with business,,, what he wants...

he should maintin this duplication check at their end.

Regards

Anand

Former Member
0 Kudos

Hi Joe,

The first option to ignore based on the file name is simply clear. If the file with the same alreay exisit in the target folder, the file channel will obviosuly throw duplicate error.

Second point to compare the file based on the file content  - This can be achieved by maintaining z table in PI ABAP stack with key field or combination of key filed values that is present in the file.

Each new file that is processed , its corresponding key value should be stored in the ztable.

Each time when new file comes for processing, its key field should be compared alreay maintained key value in the table. If the key field alreay exist in the column of the ztabe, this means it is duplicate file.

Also you can add the column of size in the table. So the dulicacy can be checked based on key fields values & size of the file. Size of the file can be captured by ASMA property.

This way you can achieve preventing dulicate files being processed in PI.

Regards,

Ashiosh

baskar_gopalakrishnan2
Active Contributor
0 Kudos

IMO, the file name option for duplicate check is fair enough.  As you know file name is the identifier for the check. I would not expect more than this. If you have the content requirement check you can do script on the file system level to check  and remove those duplicate files. That is one feasible option. You can use diff or wdiff command at the unix level for the content comparison.