cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use the EP's System Connection in Java with JCo?

Former Member
0 Kudos

Hi all gurus!

I'm trying to create an IDoc in an iView and for this I use the java class JCO to get a client and this client is then operated with "send" and "confirmTID", all done with this example as a template:

The forum thread regards an error due to erroneous JCO version, but I have copied the code and made a running example. The problem is that the example creates a connection via this code (obfuscated data):

JCO.addClientPool("MyIDocPool", 3, "400", "<username>", "<pwd>", "EN", "<host IP>", "00");

I want to use the System Connection I have in the portal. When you use that, you get an IConnection with which you can operate remote enabled function modules in the SAP system.

But how do you combine the System Connection and the JCO used for the IDoc creation in the java class?

Regards

Benny

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

There are 2 ways to writing java code for jco conection

1>Dynamic JCO

http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicJCOHandling-Creation,Updationetc

2>JCA

http://help.sap.com/saphelp_nw04/helpdata/en/fd/16e140a786702ae10000000a155106/content.htm

I hope the above links will help you much

Thanks,

Sreeni.

former_member189631
Active Contributor
0 Kudos

Benny,

You use JCo to connect to SAP Backend system.The data should be retreived from the backend only throurgh RFC enabled function modules or BAPI.

There are two ways of connections available when you want to connect to the backend system from a java applications one is direct method and the second is client pooling. In direct connection the back system will be connected every time when you access the applications. In pooling a common connection can be shared by n number of users. In both the methods you need the backend details for R/3 Connection.

Also you can pass the logon ticket to make connection if use SSO with logon ticket. Check the JCO api for more details.

So have a BAPI/ RFC FM to perfrom any opperation on the backend when you want to do it from other non SAP applns.

Note: If you use WD for JAVA, you can just configure SLD and JCO to make the backend connection.

Ram

Former Member
0 Kudos

Hi Ram!

The IDoc I'm talking about will be used solely for creating an order in the backend system, no data will be retrieved.

I'm aware of the two methods of connecting via client and via client pool. What I try to understand is if I can use JCo in combination with an ordinary portal system connection or if I have to create a client in the java code using data such as server, user, pwd and so on.

And my second concern is SSO if I have to create the client in java code. How do I then incorporate SSO with JCo? I have found a lot of documentation regarding JCo for non-SAP java system towars an ABAP system but very little documentation regarding the JCo integrated in SAP, there is help.sap but there are only conceptual docs and very little of examples.

Regards

Benny

Former Member
0 Kudos

Hi,

This link might give answers to your questions about accessing SAP Portal system alias from java and doing an SSO

Another approcah I can think of is using an SAP transaction iView for this purpose.

Regards

Srini

Edited by: Sinivasan Rajamani on May 22, 2010 7:18 PM