cancel
Showing results for 
Search instead for 
Did you mean: 

RFC connection from a Java application (client) to SAP with Jco

Former Member
0 Kudos

Dear all,

we would like to make RFC call from a java application (client) to SAP (server) via Java connector. I have prepare a configuration file with following information:

[SAP]

Server=xxx.xxx.xxx.xxx/S/3300

User=xxxxxx

Password=xxxxx

System=00

Mandant=100

xxx.xxx.xxx.xxx is the IP address of SAP gateway and application server.

But I got the following error by test the connection:

Connect to SAP gateway failed

Connect_PM GWHOST=xxx.xxx.xxx.xxx/S/3300, GWSERV=sapgw00, ASHOST=xxx.xxx.xxx.xxx/S/3300, SYSNR=00

LOCATION CPIC (TCP/IP) on local host

ERROR hostname 'xxx.xxx.xxx.xxx/S/3300' unknown

TIME Fri Jan 16 10:56:36 2009

RELEASE 620

COMPONENT NI (network interface)

VERSION 36

RC -2

MODULE ninti.c

LINE 382

DETAIL NiPHostToAddr

SYSTEM CALL gethostbyname

COUNTER 1

Can someone help me?

Thanks and regards

Tao

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

it seems you gave parameters like you do in Java gui but for JCo it should be like this in java code,

public CallFunction() {

try {

// Logon info

mConnection = JCO.createClient("500", // SAP client

"username", // userid

"password", // password

null, // language

"server name", // application server host name

"00"); // system number

mConnection.connect();

mRepository = new JCO.Repository("ARAsoft", mConnection);

} catch (Exception ex) {

ex.printStackTrace();

System.exit(1);

}

so change your configuration file with respect to code.

manu_susankar
Active Contributor
0 Kudos

Hi Tao Chen,

Could you pelase check the below link:

http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5c6a85b11d6b28500508b5d5211/content.htm

Regards,

S.Manu.