Develop, Debug, and Manage Java Services in SAP Business Connector 4.8

  • by Ulrich Schmidt, Senior Developer, SAP AG
  • January 12, 2010
Find out how to develop SAP Business Connector (SAP BC) Java services using a state-of-the-art Integrated Development Environment (IDE) such as Eclipse, how to set up source code versioning for developing Java services in a larger team using a third-party code revision control system, and how to debug Java services on the fly in a live system.
Key Concept
The smallest executable unit in an SAP Business Connector (SAP BC) is called an SAP BC service. There are several different types of services. The most important ones are:
  • Flow service: a graphical data mapping with basic control elements such as loops and conditional branches
  • Java service: a data mapping (or other type of operation) written in the Java programming language. Used when you need better performance than a graphical mapping provides or when you need more advanced features.
  • C/C++ service: a data mapping (or other type of operation) written in the C or C++ programming language. Used when you need absolute top performance or low-level access to hardware or operating system resources.

The execution of an SAP BC service can be triggered in several different ways, for example, when:

  • SAP BC receives an HTTP request from a Web client
  • SAP BC receives an Remote Function Call (RFC) or an IDoc from an SAP system
  • An email arrives at SAP BC’s email listener
  • A job in the SAP BC job scheduler is due for execution

In the past, developers working with SAP Business Connector (SAP BC) would create SAP BC services using the SAP BC Developer tool. While this is a great tool for developing record definitions and graphical data mappings (flow services), it offers only rudimentary editing capabilities for Java services and no Java debugging capabilities at all. Therefore, one of the most important new features of SAP BC 4.8 is the ability to switch the running SAP BC into debug mode on the fly, attach a convenient Java Integrated Development Environment (IDE) such as Eclipse, set a breakpoint in your custom Java coding, and then debug your Java service.

To illustrate this, I will develop a real-life IDoc mapping while also introducing the new Java IDoc API that allows you to process and convert IDoc data easily. I purposely insert a little bug into this mapping. Then I put SAP BC into debug mode, attach the Eclipse debugger to it, send an IDoc from the SAP back-end system, and capture it in the debugger. Using the captured IDoc data, I step through the mapping code, find the bug, and fix it — all without requiring a single restart of SAP BC. Other productive interfaces that this SAP BC installation processes are not interrupted at all.

In addition, I show you how to set up your Eclipse project to smoothly cooperate with the SAP BC Java service framework and how to integrate the resulting source files into a third-party code revision control system (such as Perforce, Concurrent Versions System [CVS], or Microsoft Visual SourceSafe).

Ulrich Schmidt

Ulrich Schmidt joined SAP in 1998 after working in the field of computational algebra at the Department of Mathematics, University of Heidelberg. Initially, he was involved in the development of various products used for the communication between SAP R/3 systems and external components. These products include the SAP Business Connector, which translates SAP’s own communications protocol RFC into the standard Internet communications protocols HTTP, HTTPS, FTP, and SMTP, as well as pure RFC-based tools, such as the SAP Java Connector and RFC SDK. Ulrich gained insight into the requirements of real-world communications scenarios by assisting in the setup and maintenance of various customer projects using the above products for RFC and IDoc communications.

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.