cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a remote JCo destination file

Former Member
0 Kudos

Hi everybody.

This is my first post here in the SAP SDN Forum.

While I'm not a SAP developer, I'm a Java developer. Currently I'm making an application to connect to SAP AS (with JCo 3.0) and retrieve data from BAPI structures and tables. I'm using the JCo 3.0 guide (SAPJCO_Doku_3.0_EN.pdf) successfully but I have some issues:

First: How can I call "remotely" the destination file??? For example: supose first that my destination file, let's say the ABAP_AS_WITHOUT_POOL.jcoDestination file and the Java application are stored in a directory like C:\My Documents\Files, from a first and successful run of the application. With another application in another directory I'd like to call and use that destination file, so in my second application I shouldn't create a second destination file. How can I do it??? What elements and/or properties should I use??? (Maybe the JCoDestination, the DestinationManager, the getRepository and related).

Second: Is it the same for calling a destination file that is in a remote machine??? In a directory like +
255.255.255.255\shared\Files+

I guess if this is in some way equivalent to file reading in Java, but I'm not really sure.

Please help me. Most of the sources I've read didn't say something useful about this, and I need this for my final application.

If you can, please add some generic example-code for a better understanding.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

JCo provides the interfaces DestinationDataProvider and ServerDataProvider for providing connection/logon data for RFC (remote function call) clients (i.e. Java program calls RFC function on SAP server) or RFC server programs (SAP calls RFC function on Java program acting as a server). When you check the JCO API documentation for usage of those interfaces you'll see that for example for the client you can register your own DestinationDataProvider via method Environment.registerDestinationDataProvider(DestinationDataProvider).

Thus if you don't like the default implementation delivered by SAP (i.e. file based), you can simply create your own class. Note that to some degree the document SAPJCO_Doku_3.0_EN.pdf already points you in the right direction: It mentions on page 8 in section SAP JCo Customizing and Integration:

You should always implement the interface DestinationDataProvider to optimize data security. If you are using server functionality you should also implement ServerDataProvider. These interfaces support the secure storage of critical data.

Cheers, harald

Answers (0)