‎2021 Apr 13 2:44 PM
Hi,
The situation is following:
File .csv comes from external system into SAP. It is put into AL11 directory path.
I want to create background job which is triggered "After event" to read this file.
So I need to create event in SM62. But I don't understand what is event in this case. Is that a program which put file into AL11? If yes than what is program name? And how can I define that it should be triggered only in case when file came into specific directory path?
Thanks,
‎2021 Apr 13 3:18 PM
When I've done this, I've created a batch job watcher that looks for files written to the folder. If it spots one, it immediately moves it to another folder from where it is processed.
The batch job runs, say, every ten minutes.
The way you might use events is that the batch job above triggers the event that causes the process to happen. But simply writing the file into the folder won't trigger and SM62 event.
‎2021 Apr 13 3:49 PM
A job event is triggered by Linux script sapevt (or Windows sapevt.exe), or ABAP CL_BATCH_EVENT=>RAISE, etc.
If you use a Linux script, you will first put the file and then trigger sapevt.
‎2021 Apr 13 3:56 PM
Yes.
I can set up periodic job, for instance each 10 minutes. It also works.
But request is to run job only in case file came to SAP.
‎2021 Apr 13 4:15 PM
I understand that, but at some point there will be monitoring and resources being used. If you opt for Sandra's sapevt, you'll need to set something up to check if a file has arrived. Maybe there's an easy way of doing this in linux/windows, but in the past I've had to use a regularly running daemon.
‎2021 Apr 13 4:19 PM