cancel
Showing results for 
Search instead for 
Did you mean: 

Extract R/3 data via EJB

Former Member
0 Kudos

Hi *,

I'm looking for a best way in order to extract data form an ABAP (R/3) system and exspose those data via a Web Service. The scenario I thought, is to use a WAS 6.40 and implement an EJB which get necessary data via a BAPI call (using JCo or JCA) and build, upon this EJB, a web service (using developer studio wizard).

So my questions are:

1) what do think about this kind of scenario? Do you know any better ways to achive the same objective?

2) Do you know if there're any documentations or whatever which could help me in order to develop an EJB which collect data from an ABAP (R/3) system?

Any hints will be very precious

Many thanks

Cheers

Roberto

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Roberto,

the best way to achieve this depends on the version of the ABAP system. If the version is >= 6.20, you can create the Web Service directly in the ABAP system and there's no need to use the Java personality of the WebAS and EJBs to achieve this. You may have a look at <a href="/people/thomas.jung3/blog/2005/01/05/develop-a-web-service-that-sends-an-email--in-abap Jung's weblog entry</a> describing how to create a Web service using ABAP. There are some 6.40 specific features used, but anyway.

Hope that helps.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

thanks for your info. Just to provide an extended scenario's description, we have more than 1 ABAP/non ABAP backend system and we'd like to expose data from those systems, using, for example more than 1 web service. So we thought to have a unique Web Serivices repository (a WAS 6.40 or whatever) where to store the server part of our web services. In other words if I need to extract some data from an R/3 system and expose them via a WS, we'd like to develope the WS on this "central" repository and connect to the backend just in order the gather the data, and don't create a WS on every system we'd like to connect. This is the reason I asked for creation of an EJB which connects to an ABAP system.

All the ABAP systems have a version <= 6.20

In this kind of scenario what do you think could be the best way?

Many thanks again

Cheers

Roberto

Former Member
0 Kudos

Hi Roberto,

well, this is something different Of course it's possible to create something like the WS repository you mentioned, but you must be aware, that this central system might become a bottleneck regarding the expected performance:

1. For each service you need in the ABAP backend (available via remote function call or BAPI) you could create a stateless session bean, which acts like a wrapper and a facade around/for the corresponding service calls.

2. The bean exposes public business methods, which can be used to create the web service definition in the Developer Studio (there's a wizard available to do this).

3. The proxies necessary to call the ABAP service can be generated using the SAP Enterprise Connector wizard available in the Developer Studio (at New->Other). The session bean uses the generated classes (or jars) for the function calls. If you prefer/need a transactional environment, you could also use the SAPJRA to access the backends.

4. After publishing the web service, your bean is called which itself calls the ABAP backend via the proxy and converts and returns the results via its business methods.

This is possible with WAS for Java versions >= 6.30 and ABAP system versions >= 4.0.

Hope that helps.

Regards

Stefan

Vlado
Advisor
Advisor
0 Kudos

Hi Roberto,

To your questions:

1) I like very much your scenario. Actually, this is also what I thought about

2) You can implement a (stateless) session bean and put the code for calling the BAPIs (via JCo) in its business methods. You may want to have a look at

http://help.sap.com/saphelp_nw04/helpdata/en/35/42e13d82fcfb34e10000000a114084/frameset.htm

and especially

http://help.sap.com/saphelp_nw04/helpdata/en/de/e6c9255044b241a9401a3a1b7009a9/frameset.htm

on how to use SAP JCo to call a BAPI.

Hope this helps,

Vladimir