tags:

views:

408

answers:

3

So, I've just been dumped into the middle of a project involving SAP. Specifically, I need to use SAPs BAPI APIs to pull a bunch of information out of "The Client's" SAP system. Given that SAP is a closed platform, I've been having trouble finding a high level overview of the who/what/where/when/how of SAP and BAPI. Specifically

  1. Is BAPI just a wrapper for SOAP and/or XML-RPC, or is it a completely proprietary communication format?

  2. Is there a PHP extension or library for working with these APIs?

  3. I've seen the acronym ABAP thrown around. What does it mean, and where does it fit into things?

At this point I'm looking for good resources that can give me the 10,000 foot view. I realize you could spend a lifetime working with these ERP system and still not understand the whole thing. I just want a basic overview so I can talk to "The Client's" SAP folks and not sound like a complete newb.

+5  A: 

Okay, I'll give it a shot ...

  1. ABAP is the programming language most of the SAP system is written in. It's basically a 4/GL version of COBOL with some SQL added in.

  2. BAPI ("Business API") is SAP's interface specification and a way of getting information out of the system. I'd say the simplest way to look at it is as a remote procedure call into the SAP system, giving you access to the data and functionality (writtten in ABAP) that is in the SAP. It gives you some API to pull data out of the system (e.g. an order), change it in you application (e.g. add positions to the order) and then post it back and also call business functions (e.g. post this order so it is further processed in the SAP system).

  3. There are wrappers for calling BAPIs from a number of languages. Just google or search within SAP's help system or the online sap developer network at sdn.sap.com

Good luck in not sounding like a newb .. or just admit to it ... Best of luck!

IronGoofy
Thanks for the help! I'm still not 100% clear on what the difference between BAPIs and RFCs are. I get your point that BAPIs are meant to be a more stable API, but is the protocol different? Are BAPIs just a stable set of RFCs, or are they also called differently from the protocol level? (the later maters to me because there's a PHP extension that lets you call RFCs, but it's not clear to me if it will let you call BAPIs as well)
Alan Storm
From that viewpoint, RFCs and BAPIs are the same .. a BAPI is a "stable" function that can be remotely called. So if the PHP extension allows you to call RFCs, you should also be able to call BAPIs.If you're working on calling BAPIs, have a close look at the data structures that are needed: These are typically quite extensive and a bit tricky to build by hand. Usually, there should be other BAPIs that make life a bit easier. In my example, if you want to post an order, you'd typically search for that order (through a BAPI) and have the system return that order "object" (through another BAPI).
IronGoofy
+4  A: 
  1. Forget about bapi for a second. SAP has a proprietary communication protocol called RFC( remote function call). SAP provide a dll ( or shared library for *nix) that you can use to call functions in SAP from c. SAP also provide wrappers of this dll for java and .net. And there are open source wrappers of this dll for php, python, perl and ruby. So the process is. a) somebody develop a (remote enabled) function in abap. b) you can use the rfc dll, with the wrapper for your language of choice, and call this sap function. c) everybody is happy.

    Lets return to BAPI. Based on the technology described in the previous section. SAP decided to create a set of functions that do business stuff. And they decided to call them BAPI. Because the name "Functions that do business stuff" isn't cool.

  2. Here is the php extention for calling sap. You can also find a lot of information about php and sap in the sap sdn.

  3. ABAP is the language of the sap platform.

Igal Serban
From a "coding viewpoint" BAPIs and RFCs are very similar. But BAPIs offer a more cohesive set of functionality and are the "official" interface from SAP to the outside world. This also includes some guarantees to stability etc. There are (usually) enough BAPIs available to do most standard stuff in SAP, and there is usually not a need for anyone to develop any code in SAP.
IronGoofy
+2  A: 

BAPI stands for Business Application Programming Interface.

SAP's goal when introducing BAPI's was to provide ...

  • well-defined
  • stable
  • implementation-independent
  • well-documented

business API's that provide standardized access to SAP solutions on a semantic level.

Still, BAPI's are proprietary SAP interfaces.

The BAPI interfaces provide a unified access to the application level functionality, independent of the type of call: Both synchronous and asynchronous processing can be triggered by using these interfaces.

Synchronous processing of a BAPI will result in the execution of a RFC (Remote Function Call, SAP's proprietary RPC protocol).

Asynchronous processing makes transparently use of ALE (Application Link Enabling, SAP's proprietary EDI format).

Products like the webMethods SAP Adapter (aka SAP Business Connector) provide bidirectional service level access to BAPI's as well as the lower level RFC and ALE protocols from/to a remote destination.

Using these tools there is no need to bother about ABAP, the 4GL programming language all the SAP business logic is implemented in.

There are also several XML mappings defined for BAPI's (as well as RFC's and IDocs) that allow to transmit business documents within an XML envelope. These are most noticeable

  • bXML (Content-Type: application/x-sap.busdoc)
  • RFC-XML (Content-Type: application/x-sap.rfc)
  • IDoc-XML (Content-Type: application/x-sap.idoc)

as well as SOAP.

Tom