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

Automatic program execution when file is written to application server

Former Member
0 Likes
1,085

Hi experts, I have a requirement wherein when a file is written into application server by third party application, based on the name of the file an ABAP program should get executed that reads the file and uploads data into SAP. Can you please let me know of the different possibilities for achieving this?

5 REPLIES 5
Read only

Former Member
0 Likes
897

Hi,

Something has to trigger SAP to start the program. Possible solutions are a job who checks every hour (or other time frequence) if the file is there and starts the program. Or let the third party call a RFC to start the program after placing the file on the server.

Read only

MarcinPciak
Active Contributor
0 Likes
897

Run periodically a job (i.e once an hour) which will scan Application Server directories (actually there can be only directory which the file will be written to) and looks for any new file (creation date and name will matter here). If new file found, then run your program that reads that file and imports it to SAP (check SUBMIT statement for running program). If no file found, the run program will finish without any action.

Regards

Marcin

Read only

former_member209217
Active Contributor
0 Likes
897

Hi,

Schedule a Batch job Program in sm36 which runs for regular periods of time that checks whether file is available in app.server or not.

If it is available the program will be executed otherwise exit.

Alternatively create one more program(as per ur requirement) which does the process once the file is available

Use SUBMIT Statement in Batch program.Put a condition check before submit for chking file availability

Regards,

Lakshman.

Edited by: Lakshman N on Aug 24, 2009 4:10 PM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
897

Hello,

A possible solution can be something like this:

Soln#1. Schedule a Z-Report (which runs every 15mins, scheduling can be done based on the frequency in which the 3rd Party writes the file) to read the files from the application server folder.

If the corres. file names are found process the files & upload the data to SAP Table.

Soln#2. When the file is written to the application server, then an SAP event is raised (event needs to be defined in SM62) which in turn will call the processing program.

Please refer to this [blog|http://www.sapfans.com/sapfans/sapfaq/robert.htm] for further details.

BR,

Suhas

Read only

former_member194669
Active Contributor
0 Likes
897

Please check my reply in the following thread

a®