cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduling a job which is triggered by an event- availability of a file in SAP application server

Former Member
0 Kudos

Hi all,

I need to schedule an event triggered background job. I need the job to be triggered whenever a file reaches the sap application server from SSP5. For now, the job is scheduled daily and it fails whenever it doesn't find the file, this again requires re-processing. The requirement is from the ABAP team and I am from Basis. I see a possibility where they come up with a program to check the file availability and this triggers the job but again not sure how feasible this is for them.

Please let me know if this would be at all possible. Thank-you all.

Ross

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rosun,

I have an idea! Without help of ABAPers this can be achieved.

Create a SAP event with SM64 with suitable name.

If your system is on Windows then use batch job and windows job scheduler, if Unix use script file and cron.

Goto this link and check out the way how an event can be generated, and create a script/batch file and check the file at OS level if found then generate the event else do nothing. Schedule this file hourly or after every 30 minutes whatever suits you. In this way, when file will be found at OS level the SAP event which you have created already will be triggered and SAP Job will start.

http://help.sap.com/saphelp_nw70/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/content.htm

So only thing left is to write the batch file or Unix script to check the presence of file at OS level and use of if-else ....  Our friend Google can be handy here

Former Member
0 Kudos

Hello Ishtiyaque,

Thank-you for the precise instructions. I want to inform you that I am using OS400. Bummer! I found SAPEVT luckily. I am checking further.

Regards,

Ross

Former Member
0 Kudos

Hi Ahmad,

First of all sorry for opening the old thread,

But same issue i ma also facing can you please help me how can we reate a script/batch file and check the file at OS level if found then generate the event else do nothing. Schedule this file hourly or after every 30 minutes whatever suits you. In this way, when file will be found at OS level the SAP event which you have created already will be triggered and SAP Job will start.

I am using windows server 2008

Please suggest

Former Member
0 Kudos

Hi,

to trigger any sap event at OS level execute this on your sap application server

sapevt <The name of event defined in SM64> pf=<Profile Name with full path>

As you have Windows, make a batch file, the batch file will contain this sapevt line inside a if condition.

The if condition will check with help of dir commad about the presence of file and execute the sapevt.

I'm giving you hints for your homework......

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Srikishan,

Thank-you for the prompt reply however I have already checked this one. While this describes the general procedure to event controlled background job scheduling, I don't get the answer to my query- can we trigger a job when a file reaches the server?

Regards,

Ross

ashish_vikas
Active Contributor
0 Kudos

you may like to trigger Event from OS level.. may be with a script(scheduled in crontab to run periodically) which will check if nw files have came in mentioned directory and if yes.. trigger Event to start SAP Job.

How to trigger Event from OS level :

http://help.sap.com/saphelp_nw04/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/frameset.htm

http://scn.sap.com/thread/1400042

Regards

ashish vikas

Former Member
0 Kudos

Hello Ashish,

This link was really helpful. I am able to use SM64 if not SM62. Checking further...

Regards,

Ross