cancel
Showing results for 
Search instead for 
Did you mean: 

SAP jco or web services, which i should use ?

Former Member
0 Kudos

hi all,

I have to create a JAVA web aplication and i need get data from SAP ERP,

which i should use sap jco or web services ?

pros and cons of both ?

Accepted Solutions (1)

Accepted Solutions (1)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Julian,

in principle, you can use both. JCo uses RFC underneath, which means that you are tightly integrated into the programming model of ABAP. Therefore, you can immediately call any remote enabled function module that is existing. But being a propriatary library, you need to learn JCo and install it into your environment. WebServices are based on a set of standards and you simply can use the infrastructure of available Open Source Libraries to exchange data with the ABAP system. This means, if you are familiar with such a library, you can simply use it and don't have to learn anything in addition. However, on the ABAP system side, it's an add-on library to the ABAP language not so tightly integrated. In general, performance is better with JCo (depending on function interface), but normally the RFC protocol cannot easily cross company network borders (which is different in the HANA Cloud Platform use case of JCo), which is a pro for WebServices.

One more important argument is depending on the concrete application scenario: What kind of remote interface is offered by the ERP system. Depending on what is available, you might not have a choice, if the ERP system should stay untouched.

Best regards,

Markus

0 Kudos

If i want to use Java for consuming ABAP oData which of following is good and secure?

*RestAPI

*OData4j

*Jco

I used first two options and i'm getting error like

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Answers (2)

Answers (2)

Former Member
0 Kudos

Which java system are you coming from?  Or are you calling from a stand alone java client?

If coming from Netweaver Java, I'd suggest using EJB with SAPJRA.  You can use SSO in this scenario as well.

rolf_paulsen
Active Participant
0 Kudos

Hi Julian,

if you have Java EE skill and there are developers to implement web services on ABAP side, you are well served with Webservice standard. The integraton with ABAP works fine. We use Netweaver AS Java with Webservice access to AS ABAP even in both directions and do not have any performance issues. Another advantage beside the standard program model on Java side is that you can use SAP Logon tickets to call Webservices, so you may call ABAP business logic as the user logged on on the Java system, and vice versa (mutual trust of both systems required). Secure https connection is also possible.

The programming model with JCo/RFC is proprietary. But there is one requirement that forces you to use RFC/JCo: transaction safety, in other words: Two-phase-commit on Java and ABAP site. Webservices are not transaction safe, there is no transaction standard in Webservices.

You can bypass this lack using idempotency in most cases.

To get a programming model with JCo that Java developers are used to (e.g. annotations), look at hibersap.

http://hibersap.org.

This is a really cool library that removes a lot of pain of JCo development.

Besides Webservices, at least for read access you might look at OData services provided by ABAP systems (if you are on a current release and SP level on ABAP side). You can consume those services using Apache Olingo on Java side, of course you can also provide OData on Java side both for ABAP consumption (e.g. SAP Gateway) and for SAPUI5 user interfaces on Java web application..

Regards

Rolf

HAL9000
Product and Topic Expert
Product and Topic Expert
0 Kudos

SAP Logon Tickets can be used with JCo, too. Also secure communication is possible. Instead of using SSL/TLS with the HTTP protocol (HTTPS), RFC can be used with SNC for a secure network communication.

rolf_paulsen
Active Participant
0 Kudos

Thank you for this completion, I will try it out.

Regards

Rold