Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Application Server Issue

Former Member
0 Likes
861

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

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
836

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

Read only

0 Likes
836

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

Read only

0 Likes
836

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

Read only

0 Likes
836

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

Read only

0 Likes
836

Hi Sridhar,

That was nice ,but can you elborate it in more detail

Read only

0 Likes
836

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

Read only

0 Likes
836

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

Read only

0 Likes
836

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

Read only

Former Member
0 Likes
836

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.