Professional Documents
Culture Documents
01 SAP Enterprise Connector
01 SAP Enterprise Connector
01 SAP Enterprise Connector
Siddhartha Bhattacharya
SAP Enterprise Connector Overview
Contents:
z SAP Enterprise Connector Architecture and Wizard
z Proxy Generation
z Programming Model
A development tool that provides help classes and RFC function module
module
method calls for Java applications
Integrated into the Netweaver Developer Studio
These generated method calls and help classes are called Java Proxy.
Proxy.
The Java Proxy hides native SAP Java Connector (JCo
(JCo)) calls.
This architecture guarantees type-
type-secure data access and increases
client application stability.
An RFC interface defines the name; the parameters (importing, exporting, changing, and table); and the
exceptions of an RFC function module
The individual parameters or data elements of a ABAP Dictionary data type are declared as attributes of
the generated Java classes
Java – ABAP Data type mapping
The SAP Enterprise Connector maps the elementary ABAP/4 data typestypes
to primitive Java data types or existing Java classes
SAP Enterprise Connector generates an independent Java class for each
data type that is referenced by the selected RFC function module.
module.
Data elements of a ABAP Dictionary data type are defined as attributes
attributes of
the Java class. The getter and setter methods enable read and write
write
access to individual data elements.
SAP Enterprise Connector generates an input class that contains all the
importing and changing parameters of a function module.
In the same way, the tool generates an output class that combines
combines all the
exporting, changing, and table parameters.
The class names comprise function module names followed by the stringstring
_Input or _Output.
The individual parameters are defined as class attributes that the
the calling
program can access, to read or write, by using getter and setter
methods.
A generated class, whose name consists of the function module name name
followed by the string _Fault, contains all the exceptions of the
the function
module.
Also generated is a Java exception class that a Java program can catch
and handle.
This exception class encapsulates the other class, and its name consists
of the function module name followed by the string _Fault_Exception
_Fault_Exception
Function module
The generated Java proxy class contains all the selected function
function
modules, and these are defined as methods of this class.
The class name comprises a name that you enter during generation,
generation, and
the string _PortType
_PortType..
y You can also display the selected function modules as a working set.
y You can use either Show Flat List (this is the default) to search
search for function modules, or Show
Component Hierarchy to browse for function modules.
y When searching for function modules, you can use asterisks ( * ) as wildcards. After entering the
search string, choose Search to display a list of function modules.
modules.
Project Structure
client.connect();
Replace client, username, password, language, server and sysnr with actual SAP R/3 login values.
Using proxies to Call function module
if (pool == null) {
OrderedProperties logonProperties =
OrderedProperties.load("/logon.properties");
logonProperties); // properties
JCO.getClient(POOL_NAME);
Replace client, username, password, language, server and sysnr with actual SAP R/3 login values.
Using proxies to Call function module
/*
*/
proxy.messageSpecifier.setJcoClient(client);
Bapi_Companycode_Getlist_Output output =
proxy.bapi_Companycode_Getlist(input)
client.disconnect();
Display Results
Iterate over the List returned and display the results.
Bapi0002_1Type_List list=
output.get_as_listCompanycode_List();
Console output
The result will be displayed on the console