You are on page 1of 4

JCO RFC Provider Service, Exercises

Unit: JCO RFC Provider Service


Topic: Making a remote call from SAP R/3

At the conclusion of this exercise, you will be able to:


• How to make an outbound call from SAP R/3 to WAS.

1. Development Objectives
Creating a J2EE Project and using the SAP Java Connector (SAP JCO) process a
function call made from SAP R/3. The J2EE Project will contain an EAR
application and an EJB-JAR application. The EJB Project contains a Stateless
Session Bean with a processFunction () business method that will be called by the
JCO RFC Provider Service in WAS. The EJB JNDI name is the name of the
calling SAP R/3 function module Z_JCO_RFC_PROVIDER.

2. Prerequisites
2-1 You have configured a RFC Destination in Visual Admin JCO Rfc
Provider tab and it is running.
2-2 You have configured a destination in SM59 and tested the link to the J2EE
Server.
2-3 The function module Z_JCO_RFC_PROVIDER is defined in SAP R/3.
2-4 You have opened the Netweaver Developer Studio, imported the projects
and selected the J2EE perspective.

3. Exercise Guide

3-1 Open the project template in the exercise directory called


InitialProject_JCORfcprovider.
3-2 Setup classpath – Add sapjco.jar and logging.jar to the classpath
3-3 Add com.sap.mw.jco and com.sap.tc.Logging library to the EAR Make
the reference type as ‘weak’
3-4 Add code to the processFunction() method of the EJB
3-3-1 Print the value of BAPI’s import parameter ‘UNAME’.
3-3-2 Set the value of BAPI’s export parameter ‘RETURN’ as ‘From
EJB’

4. Deploying the Application


4-1 Right Click on the TestEJB Project and “Choose Build EJB Archive”.
4-2 Right Click on the JCORfcProviderProjectEAR and “Choose Build
Application Archive”.
4-3 Right Click on the JCORfcProviderProjectEAR.ear file and “Choose Deploy
to J2EE Engine”

5. Testing the Application


Login to SAP R/3, Goto transaction SE37, Enter function module name
Z_JCO_RFC_PROVIDER and Click F8.
On successful execution the export parameter will have the value ‘From EJB’
populated from the EJB business method.

To View the values sent from SAP R/3 use the Visual Admin logviewer –

You might also like