Skip to Content
May 16, 2020 at 12:27 PM

JCo, BAPI (RFC) and Eclipse Plugins

225 Views Last edit May 16, 2020 at 12:28 PM 3 rev

I'm working on a 731 SP15 SAP system, with the Eclipse 2020-03 and the last ABAP Core Development Tools etc. The goal is to create an Eclipse plug-in, that can call an RFC FM on the backend. I can't use the BADI as showcased by Christian Drumm here as I'm not on a high enough release.

To get started, I've used the HelloWorld template, and replaced the text to be displayed in the popup with information retrieved from the backend via RFC. I've followed the example JCo in the JCo SAP Help but I'm having trouble getting it working.

In the example, we create the destinations by defining them in the file system. Alternatively, we can create our own implementation of DestinationDataProvider and register that. The problem I seem to be having is that in the Eclipse environment, the ADT have already registered a data provider. I've dug around, but can't find how I can get a list of the destinations that ADT uses/creates when an ABAP Project is created.

I don't know how to get from the project to the name of the destination that ADT must be using for all its work.

  1. Is it possible to get the destination (to use with JCoDestinationManager.getDestination) from the ABAP project
  2. Is it possible to see the registered destinations in the current DestinationDataProvider?
  3. Is it possible to add a new destination to the current DestinationDataProvider?

What I'd like ideally is something like:

IProject project = ProjectUtil.getActiveAdtCoreProject(selection, null, null,
String projectDestinationName = someMethodThatGetsDestinationFrom(project);
JCoDestination destination = JCoDestinationManager.getDestination(projectDestinationName);

TL:DR It would be so nice to be able to call an RFC from a plugin in Eclipse, using the credentials stored with an ABAP Project. Any suggestions?