Synchronous? Transactional? Why Not Indeed!
Normal client applications will use sRFC
(synchronous Remote Function Call) to invoke BAPIs in SAP. In order to
be part of an ALE-based distribution scenario, you also need tRFC (transactional
RFC). tRFC guarantees the one-time-only delivery of a message, which is
very important for an asynchronous messaging mechanism like ALE! JCo lets
you use sRFC and tRFC both inbound and outbound. All the tedious details
of tRFC are hidden by JCo so that you only have to write a few extra lines
of code.6
Difficult to Deploy? Not at All!
All you need is to copy a few DLLs and
one JAR file. It does not get any easier than that.
Linux Anybody?
The first shipment of JCo (in December
of 2000) only supported Windows 32 platforms, but by the time you are
reading this, support for Linux and other Unix variations should be either
imminent or already available. Check SAP's Web site for the latest information.
Need More Info?
First of all, the JCo download contains
the Javadoc for all its classes and interfaces. In addition, there are
two tutorials and several sample programs to get you started.
If you need more in-depth information,
I suggest that you attend the new, improved version of SAP's CA926 training
class, which uses JCo exclusively. In this class you will learn the basics
of BAPI programming, how to build desktop and browser-based client applications,
as well as how to build server components that can be called from SAP.
The only prerequisite for CA926 is that you are an experienced Java programmer.
Please contact your SAP country organization for details about scheduling
and registration.
If you cannot wait for the next training
class, contact me directly, and we might be able to arrange an on-site
workshop for your Java developers.
Thomas G. Schuessler is the founder of ARAsoft (www.arasoft.de),
a company offering products, consulting, custom development, and training
to a worldwide base of customers. The company specializes in integration
between SAP and non-SAP components and applications. ARAsoft offers various
products for BAPI-enabled programs on the Windows and Java platforms.
These products facilitate the development of desktop and Internet applications
that communicate with R/3. Thomas is the author of SAP's CA925 "Developing
BAPI-enabled Web Applications with Visual Basic" and CA926 "Developing
BAPI-enabled Web Applications with Java" classes, which he teaches in
Germany and in English-speaking countries. Thomas is a regularly featured
speaker at SAP TechEd and SAPPHIRE conferences. Prior to founding ARAsoft
in 1993, he worked with SAP AG and SAP America for seven years. Thomas
can be contacted at thomas.schuessler@sap.com
or at tgs@arasoft.de.
1 Take a look at Eiffel (www.eiffel.com)
if you want to find out what is still missing in Java. And Eiffel's inventor,
Bertrand Meyer, wrote the best book on object-oriented programming ever
written: Object-Oriented Software Construction (Prentice Hall,
ISBN: 0-13-629155-4).
2 The conversion will be easy if you did
not use proxy classes in your application, but coded to the so-called
"Common FRC Interface for Java" directly. There is currently no proxy
generator for JCo, but you should not be too surprised if, by the time
you are reading this, someone has released one.
3 I know that SAP Business Connector supports
this king of scenario very well, but you can develop your own ALE receiver
with JCo if, for whatever reason , you prefer not to use Business Connector
in your project. (By the way: Business Connector itself uses JCo to access
SAP.)
4 But not too early. If, for example, you call
a BAPI that requires an external COMMIT WORK, you have to call both the
application BAPI and BapiService. TransactionCommit before releasing the
connection again.
5 The complete code for this Servlet, can be
seen above.
6 You will still need to understand how to
handle the TIDs (the GUIDs used to prevent duplicate processing) in your
application!
|