Skip to content
Advertisement

Job exporting tables to file every 15 minutes and calling PHP script once done

I’ve been doing a lot of researching for a potential job where I will need to periodically (every 15 minutes) export some specific data from SAP and then import that data into a mySQL database on a separate server.

So far I have gathered that this could be the workflow:

1) Create ABAP program on SAP server that selects required data and outputs to file (sql, csv, tab delimited etc) on external server

2) Once step 1 is complete, call a php file on external server that imports data into mySQL database.

I have a few questions:

a) Can the ABAP program be scheduled to run every 15 minutes? From the screenshots I have seen of the scheduling tool, the increment seems to be in hours

b) Is there a notification/event dispatched once the data has been exported and uploaded to an external server? This way I will know when to call the import .php script.

c) I will only be wanting to import new data added to SAP since the last scheduled run of the ABAP program, will this be easy to implement?

Also, if anyone can suggest improvements on my workflow then I would love to hear them!

Thanks so much

Advertisement

Answer

A ) sure, there are jobs with steps in them, which are supposed to run programs, which for themselves can be parametrized with variants. The flexibility is very good. check SM36 and SM37 for that.

B ) Do not know. check C ).

You should change the approach. The SQL Server can offer a module, which is called from the SAP-System in an RFC Destination ( SM59, TCP/IP connection, Registered Serverprogramm ).
If set up via job, the SAP will make a call to the sql server, which could offer a php module to be accessed via rfc call ( tcp/ip ) . The data is transferred by sap with the help of calling a module inside the sql server. Data is translated as tables, if You like so.
You would not need to save a file in between the process. If Your sap calls the other module, and it returns with error, then and only then You could create a file ( or buffer in db table to transfer the data the next time).
C) If You directly pass the data to Your sql server, then there You can decide via php, if the data is to drop or to insert.

You should read here for further details:

http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/5d9fb155-0b01-0010-8e8a-d8703df8bb9e

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement