cancel
Showing results for 
Search instead for 
Did you mean: 

Alerts when file not found at Source directory

Former Member
0 Kudos

Hello,

We have a file to file interface which is running in PROD from long time. But now the problem is customer is asking us to create Alerts if the sender file channel is not finding the input file in between the availability time. If folder is empty...then we need to raise alert.

So my sender channel will be active every day 6.00 PM - 6.15 PM EST. if file not generated to the source folder in that 15min. of time then PI should trigger alert.

I searched SDN and find that the suggested solutions are BPM, Scripts, UDF, Timeout parameter (not works)......

So can any one help on suggesting best solution and provide the code sample for SCRIPTS or UDF.

Best regards, SARAN

Accepted Solutions (0)

Answers (2)

Answers (2)

xinjiang_li
Active Participant
0 Kudos

Hi SARAN,

I think you can create a simple new ABAP program to check whether the directory has any fills and then raise alert by calling the relevant function.

Former Member
0 Kudos

Hi,

There is no normal method by which you can achieve this.

Some have previously suggested scripts but issue with a pre or post processing script is that it will only be triggered when a file is found in the directory.

One solution can be to put a dummy file in the directory to trigger the interface. Then from java mapping, using file i\o operation of java, search the directory for the actual file. If found, retrive it and pass it as the output of the java map. Else, throw an exception, which will trigger an alert.

Regards

Former Member
0 Kudos

Hi Shiladitya Sarkar ,

Thanks for your quick reply.

could you please provide indetail steps on "Then from java mapping, using file i\o operation of java, search the directory for the actual file."As i am not having much idea on Java codes, it would be great if you can provide some code samples...

Best Regards....SARAN

former_member181962
Active Contributor
0 Kudos

Hi Saran,

For that approach you need help from the source system. They should agree to put a dummy file.

If not, you should go for a ccBPM only.

design for ccBPM.

Have a receive step inside a Block step.

Create a deadline branch for the block step.

Best Regards,

Ravikanth Talagana

Former Member
0 Kudos

Hi RaviKanth,

As this interface was in PROD and runs successfully, we did not have idea of chaning the design. So could you please let me know if any other options like UDF, Scripts with code samples....

Best Regards....SARAN

former_member181962
Active Contributor
0 Kudos

Hi Saran,

I am not sure what other meant by the options UDF, scripts etc.

AFAIK, UDF will be triggered only after the file is picked up. So, i do not think it is an option that you can consider.

Also, using UDFs is essentially a change to your design, which you are not ready.

The scripting option is completely a NON PI option. You have to search for a FILE WATCHER Utility which runs on the OS layer.

Best Regards,

Ravikanth Talagana

Former Member
0 Kudos

Hi,

Refer these links for Java i\o operations.

http://www.java2s.com/Code/Java/File-Input-Output/CatalogFile-Input-Output.htm

http://download.oracle.com/javase/tutorial/essential/io/check.html

http://www.roseindia.net/java/example/java/io/

For java mapping help, pls search in sdn, you will find lots of helpful blogs

Regards

Former Member
0 Kudos

I agree with Shiladitya's solution.

1- You can use a dummy file to start Integration Scenario.

2- At mapping step, with Java mapping, search for file in sorce directory.

3a- If Files are found, read file and continue with scenario

3b- If Files aren't found, raise alert

For Java Mapping, you can do something like this example:

http://wiki.sdn.sap.com/wiki/display/NWTech/JavaMappingtoReadComplexCSVFile