cancel
Showing results for 
Search instead for 
Did you mean: 

how to check if all expected files were processed?

peter_wallner2
Active Contributor
0 Kudos

Dear experts,

We have a sender partner who sends a certain amount of files within a certain timeframe.

The files have certain codes in their names, e.g. *1301*.zip, *1302*.zip and *1303*.zip.

So those 3 would be the set of files we get each day.

Now sometimes it happens that the sender "forgets" to send one of the files, e.g. *1302*.zip

Now on PI I need to check if one file was not sent and a notification email must be sent.

I am trying to avoid BPM and ABAP. I think the only option left would be an adapter module. Is that correct?

I had a look at Sandeep's blog who checks for duplicates:

http://scn.sap.com/people/sandeep.jaiswal/blog/2008/05/13/adapter-module-to-stop-processing-of-dupli...

I think it must also be possible to check if certain files were processed or not. I would also use a text-file

on the PI server to save the filenames already processed and compare to incoming filenames to that list.

Would you have other suggestions?

Thank you and best regards,

Peter

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Peter,

You can also think of "divide and conquer" approach to your scenario. Whenever the source file is processed, it could write the source file name to a target "control" flat file for that day, in append mode - in addition to the "normal" processing. Then, a separate interface could read the control file and check if each expected file was processed, and send the notification in case of any discrepancies.

Regards,

Greg

peter_wallner2
Active Contributor
0 Kudos

Hello Greg, Hello experts,

I was overwhelmed by all the answers I received from you - thank you!

The scenario I described will involve also non SAP receivers in the future. So doing an ABAP solution on R/3 side will not work unfortunately. I saw from Michal's, Raj's and Michael's answer that this would be the way to go.

I will try Greg's suggestion to write filenames into a list which will then be processed by a different interface. I could schedule the sender file adapter to run certain times and so also consider files that might be late 10 or even 30 minutes (which has also happened already).

Once I am done I will update this thread again and report on the solution I did.

Thank you again to all of you for your ideas!

Best regards,

Peter

Answers (5)

Answers (5)

Former Member
0 Kudos

Peter,

I agree with the comments Michal Krawczyk has made. There is nothing wrong with an ABAP and in most cases the maintenance of an ABAP designed to compliment or even monitor the PI Interfaces is more efficient and easier than trying to do it through PI. At my place of work we don't do any interface alerts or even first level monitoring through PI itself, it is all done via abap and HTML emails. I can also guarantee that an abaper would also be cheaper than a PI or Java guru. Keep PI simple and leave it to do what it was originally designed to do.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Peter,

               Instead of adapter module you can write a simple UDF. In the sender file adapter tick on option filename in Adapter-Specific Message Attributes.  Within the UDF you read the filename of the file currently being processed using dynamic configuration as shown in this link http://help.sap.com/javadocs/NW04S/SPS09/pi/com/sap/aii/mapping/api/DynamicConfiguration.html

Then the UDF can write to a text file in PI server the filename you just obtained. You can check this link for sample code http://scn.sap.com/thread/316570 . Instead of FTP server in the thread you can use local directory of PI server itself to write to text files.

Regards

Anupam

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Peter,

I had done similar kind of requirement , created RFC Funtion module in SAP to store file names, suppose if file was not processed then my ECC team uysiung report they have sent email to end user.

You can use RFC look up to insert file in SAP Table.

this is right approach.

Regards,

Raj

baskar_gopalakrishnan2
Active Contributor
0 Kudos

If you don't want to write abap program then another approach is to write the simple java program to read the file names in the folder and if the file name sequence is not in the order then stop PI polling. You can even write script to call the java program and use control starting/stopping the channel via script.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

why an ABAP program is better ?

1. an ABAP program which would check a folder to find filenames (maintained in a nice SAP table)

would take around 30mins to 1 hour to write and would be a pretty nice solution then:

a) you could schedule it to run just before PI is scheduled to pick up files

b) if the files are not there you can deactivate the channels (via HTTP call) so if all files are not available PI will not pick up any

c) you can send a notification (proxy, file etc.) that the file is missing and PI can pick it up and process

this way you will work or all of nothing principle and not import some files if you cannot get the rest

Regards,

Michal Krawczyk