Tuesday, April 15, 2008

How do I run ABAP programs through a Java-based interface?

I have to develop a Web-based application using IBM Websphere Application Server that accesses SAP using J2C connectors. My problem is that I need to run ABAP programs that access (update/insert/delete) custom "Z tables" in SAP. How can I run ABAP programs from VisualAge for Java (using Websphere J2C connector for SAP)?

The best way to run ABAP programs through a Java-based interface is to RFC-enable them. By creating an RFC wrapper around your ABAP programs, you allow the R/3 application server to effectively manage any communication from the outside world. If you have already written the application in ABAP, then you simply need to go into the Function Builder (SE37), create a new RFC with the requisite parameters, insert your ABAP program, and check the 'RFC Enable' box under Administration.

If you are doing simple table lookups, you may want to build your application logic in Java (e.g. when and what data is retrieved) and use RFCs such as RFC_READ_TABLE to connect to R/3. This allows you to maintain your application outside of SAP and means that you can leverage some of the more advanced features of Enterprise Java (messaging, EJBs, etc.).

No comments:

Blog Archive