views:

263

answers:

2

Greetings!

I've spent some time researching how to communicate with SAP from a PHP web application, but the documentation is more than spare. The ways I found are:

  • Creating IDoc files, some sort of proprietary plain-text format. But how do I stick them in SAP when they are created on the webserver?
  • Coding a Windows Application using the SAP BAPI. This way, you have full control and access - but also a lot of pain.
  • Accessing the RFC (Remote Function Calls), preferrably via SOAP. This would be the best way to connect to a web app.

What I could not find out is: what is the easiest way to connect? Which versions of SAP support SOAP? Anything I've missed?

Thanks for your help!

+2  A: 

How you connect to SAP is dependent on what version of SAP, your SAP license and what you're connecting with and what you are trying to do.

If you are trying to access SAP standard functionality - i.e. Read or Update a SAP Service Order, the standard BAPI should allow you to do what you need. (Note that a BAPI is just an RFC with a standard API, which is released for customer use by SAP).

There are various connectors to SAP, but for newer releases of SAP (2004s and later) many RFC function modules are exposed as webservices, which should be ideal for your purposes.

You may have to ask an ABAP developer (or even a non-developer with SAP experience) to help you find which RFC's are available and whether they are exposed as webservices. (If not an ABAP developer should be able to wrap BAPI as a webservice with a simplified interface).

If you are trying to do something that SAP have not provided prior functionality for, or perhaps access custom developed objects you will definitely need the assistance of an ABAP developer to exposes an RFC to you.

Depending on your system setup there may be some system administration tasks to be done in order to allow you to access the SAP system. Whether by RFC or otherwise. (Useful transactions to search for are SICF and SOAMANAGER). The SAP Basis administrator may also need to set up some RFC connections for you.

If your company uses SAP PI/XI or a non-SAP integration engine, it may be easier to connect but that would be in very limited cases.

I've used IDOCs before for single message transfer, but I'm not sure that it would have any advantage over BAPI's or webservices for any Business Type transactions. Although IDOCs have been around for a while and may be quite stable if standard ones exist.

I have to admit that I've only scratched the surface around connecting to SAP, but I hope this is useful.

Esti
A: 

The third option is the easiest.

Accessing the RFC (Remote Function Calls), preferrably via SOAP.

Igal Serban