‎2006 Dec 19 7:33 PM
Experts,
I need the solution for the following issue as soon as file get created in application
server a program which is waiting for these file to process should get triggered
and execute in background . How i will be able to achieve these scenario
‎2006 Dec 19 7:37 PM
I assume that this file is coming form external system? If so, if the application putting the file there is a .net or java appication, you could have it call a RFC enabled funtion module which would create a background job which would process the file.
In my case, we had no control over the external program, so that wasn't an option. What we did was scheduled a background job which ran every 15 minutes to process the file if it existed. Still working this way to this day.
Regards,
Rich Heilman
‎2006 Dec 19 7:49 PM
yes file is coming from external system,but program should read it as soon
as file is created in application server , in your case if job got delayed due
to some reason then it will not read the file that need to be read, because
file will be created every 10sec or 20sec or may both ,hence there should a way
to inform the program that file has been created and it should start reading it
‎2006 Dec 19 7:53 PM
Right there should be a trigger on the external side, so if you have the ability to add some code to the application of the external system where you can do an RFC call to your R/3 box to trigger the process, then this is the way to go. Other than that, I'm not sure how you are going to trigger a program when a file is placed on the application server.
Regards,
Rich heilman
‎2006 Dec 19 8:38 PM
If your external system can call a shell script or command after writing the file, you can raise an event as described in the following sap docu link:
http://help.sap.com/saphelp_erp2004/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/frameset.htm
Define an user event in SM62
Defina a job with start condition after event set to event name created in SM62
Raise the event from ext system as described by sap docu.
Regards
Sridhar
‎2006 Dec 20 8:22 AM
Hi Sridhar,
That was nice ,but can you elborate it in more detail
‎2006 Dec 20 8:33 AM
Hi
As per Sridhar's idea, below are what you have to do...
1. Create a shell script which can trigger an event in SAP upon receiving a file.
2. Create a job in SAP via SM36 with event trigger.
Regards
Eswar
‎2006 Dec 20 9:10 AM
how we can create such a shell script,which wait for file to get arrived
in application server ,how can we create a shell script which is always active
‎2006 Dec 20 2:43 PM
If your external system can start a shell script on sap appserver after writing the file, then it's easy, the shell script need not wait for the file to execute, It's executed by the external system after writing the file.
If it's not possible for the ext. sys. to start the shell script, then ask your unix admin to add the shell script to Cron Daemon to execute the script at certain interval.
If Cron daemon used, then the shell script should check the directory for files, if file exist, then execute SAPEVT to raise event in sap.
Regards
Sridhar
‎2006 Dec 19 9:59 PM
HI Sanju,
Check with BASIS, if they use Autosys or any other tool for scheduling jobs.
I am sure they can develop a script which can trigger your ABAP program as soon as they receive a file.
Thanks,
Venkat.