What are the different ways of communicating with SAP through Java? Which is preferable?
There are many different ways to connect to SAP R/3. Your choice depends largely on the type of application you are building. If you are looking to support transparent system to non-SAP system commication, then using the XML document standards of Business Connector (BC) is the tool for you. BC allows you to chain together multiple RFC/BAPI calls in what is termed a pipeline into which you map inbound XML fields using the BC browser.
If you need to provide realtime, client based communication (from a Web page), then JCo is the right connector for you. JCo is a highly optimized Java Native Interface (JNI) that provides quick connectivity into the RFC/BAPI layer.
If you are looking for a more Microsoft-centric solution, check out SAP's COM/DCOM bridge. As you can tell, there are many approachs for connecting to R/3. The right one depends largely on your requirements and internal platform landscape (UNIX, Windows, etc.)
Dig Deeper on SAP Java and J2EE
Related Q&A from Austin Sincock
Explaining the difference between BAPIs and RFCs, how to find BAPIs in SAP and how to determine errors made from BAPI/RFC calls Continue Reading
Is there a way to view a list of SAP interfaces such as RFC, BAPI and ALE? Continue Reading
Retrieving a list of parameters for a specific remote function module using JCo connector. Continue Reading