cancel
Showing results for 
Search instead for 
Did you mean: 

Validation of xml files in SAP PI

Former Member
0 Kudos

Hi Gurus,

This is a file to proxy scenario.

I am picking the file in XML format using file adapter and sent to SAP for processing the message.

Suppose I placed the new.xml file in the FTP server, this is picked by the fle adapter and sent to SAP.

But when I placed teh same file in FTP server, the file is also getting picked for the second time.

How can SAP PI validate the data in the files , identify the duplicate files and stop the processing of the messages.

Any help appreciated.

Thanks,

Jay.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can have a custom module for file adapter which piks all files and writes file name and hashcode (http://www.java2s.com/Tutorial/CSharp/0600__Security/Generatethehashcodeofthefilescontents.htm) of the file content into a table in PI.

To check files which are already piked with same name simply check for the file name using RFC lookup in mapping.

To check for files which are already processed with same content check for hashcode of the file using RFC lookup in mapping.

Not sure using module is appropriate here, but this may be one of the solution for ur requirement.

Thanks,

Anand

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>How can SAP PI validate the data in the files , identify the duplicate files and stop the processing of the messages.

If you want to really validate data then you might have to check the key fields of the payload using RFC lookup or some kind of RFC call against backend and see whether such data exists or not. If exists dont call the receiver system in the reciever determination. Some kind of logic related to lookup required in mapping to avoid duplicate information. Hope that helps.