Skip to Content

I am sure the open source project abapGit and the development environment Abap in Eclipse are already well known, therefore I skip the introduction of them. 

For commiting your ABAP code from Eclipse to a GIT repository currently the following steps are necessary:

  1. Open an SAP GUI (either as a particular instance or within  ABAP in Eclipse)
  2. Start the transaction ZABAPGIT
  3. Select a specific ABAP package
  4. Peform the desired Git commands

The first three points are always identical, thus they are perfect candidates to be automated.

The first two points I have already completed but with point 3 … I am struggling, but to this point a bit later.

To get the first two points working automatically is now quite easy. The only necessary step is to go to the Eclipse marketplace and install or update the free plugin ABAP Continuous Integration. After completing  this installation you get an additional menu entry: abapGit, invokable also with the Shortcut Ctrl+Alt+K. Of course abapGit has to be already installed before.

Pushing the menu item or pressing the shortcut opens abapGit for the currently selected project in the project explorer.
Currently an ABAP development package or an child object of this package has to be activated to get the shortcut and the menu item working but I will investigate how to get the functionality available for the whole workspace.

Well if you are constanly working with the same package or the clicks to change the package do not bother you … perfect – the new menu item will save you hopefully a lot of time when calling abapGit out of the Eclipse environment.

If you would like also to get also the package change automated, you are welcome to join the abapGit community package change challenge 😉 .Any idea, hint or anything else helpful is welcome – lets solve this challenge together.

What I tried already:

Approach 1: Changing the package with an ADT rest service.

I have already created a prototype with the ADT SDK to get the package name and the username to the ABAP backend. See. ABAPCI_ABAPGIT – connection from Eclipse to abapGit. The only thing that is missing is how to trigger the package change on the abapGit side.

Refreshing the abapGit Transaction, or reloading it?

Details for the ADT SDK:
https://blogs.sap.com/2014/08/31/creating-a-abap-in-eclipse-plug-in-using-the-adt-sdk-part-2/
https://archive.sap.com/documents/docs/DOC-40668

 

Approach 2: Calling the ZABAPGIT transaction with parameters

With the ADT SDK it is also possible to open a transaction with parameters. On thing todo with this approach is certainly adapt abapGit to consider this parameters. The harder part with this approach is maybe to not loose the already inserted git repository credentials.

 

Approach 3: Ideas welcome

To report this post you need to login first.

14 Comments

You must be Logged on to comment or reply to a post.

  1. Thomas Fiedler

    Hi Andreas,

    we are already working on a native abapGit Integration into Eclipse.

    Colleagues would be more than happy to get you on board.

     

    Regards,

    Thomas.

    (13) 
    1. Andreas Gautsch Post author

      Hi Thomas!

      Good to hear that abapGit will be integrated also into Eclipse. Of course the approach shown in this blog will be obsolete starting from the time the native integration will be available.

      Would be a pleasure for me to get involved in the development as I am already very curious how it will look like.

      Have a nice weekend, Andreas

      (0) 
  2. Paul Hardy

    I have installed the plug in, but the menu option does not seem to be there on any of the context menus and CTRL+ALT+K does not do anything.

    There is a little button at the top which calls up the CI view, with a “Java Nill Pointer” error as well. That is better than last time I tried a month ago where I got the Eclipse equivalent of a short dump. I installed an update to your CI plug-in since then.

    In that view there is a button with “Launch abapGit” and a red icon to do the same. Neither does anything when I click them, and yes I do have abapGit installed on the SAP system!

    Also how do you assign a colour to an SAP system? I cannot see any option to do that.

    I am very impressed with what you are trying to achieve here, by the way.

     

     

     

    (0) 
    1. Andreas Gautsch Post author

      Hi Paul!

      The Java Null Pointer does surprise me a bit, could you please tell me if you get the error also with the latest version 0.3.12 and if yes maybe post the stacktrace.

      Well if everything is working like expected the current behavious should be:

      The menu option currently is only shown if you have marked a package or a development object within a package.  If clicked or respectively using the shortcut while the project explorer item is still marked abapgit should open for the destination to that the package/object is assigned.

      I fixed the “Launch abapGit” button and the function behind the Git-icon, I uploaded version 0.3.12 to the Eclipse marketplace just now. The button and the icon only work if you have set the development  project in the Eclipse settings: Preferences -> ABAPCI -> The first text box should include the name of your DEV system displayed in the project explorer.

      To assign a color to an ABAP project open the View “ABAP Colored Project” – with a right button click you can add a project and assign a color – although this feature currently does not support all development objects.

      Thanks for your appreciation, I thought it is easier to tame a monster like Eclipse although ADT facilitates a lot, but I think I should not try to tell you something about monsters 😉

      (0) 
      1. Paul Hardy

        Thank you very much for responding. I just opened Eclipse and installed the update to ABAP CI.

        Now the abapGit screen opens when I press the button – I still get the null pointer exception. Forgive my ignorance but I have no idea how to look at the stack trace so i can show it to you. If you can tell me how you would be doing me a favour.

        In regard to the coloured projects thing, again I got a fatal error, but this time it did show me the trace:-

        java.lang.NullPointerException
        at abapci.xml.ColoredProjectModelXml.getColoredProjects(ColoredProjectModelXml.java:129)
        at abapci.model.ColoredProjectModel.getColoredProjects(ColoredProjectModel.java:33)
        at abapci.presenter.ColoredProjectsPresenter.setViewerInput(ColoredProjectsPresenter.java:25)
        at abapci.presenter.ColoredProjectsPresenter.<init>(ColoredProjectsPresenter.java:16)
        at abapci.views.AbapCiColoredProjectView.createPartControl(AbapCiColoredProjectView.java:54)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:151)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:147)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:355)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:990)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
        at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
        at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:992)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:661)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:546)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:530)
        at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:70)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:992)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:661)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
        at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1293)
        at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:68)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:4889)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:52)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
        at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:173)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:620)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:584)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:769)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:743)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:681)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:676)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1179)
        at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1287)
        at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1278)
        at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:4329)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4325)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4305)
        at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:132)
        at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:110)
        at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77)
        at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
        at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
        at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
        at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:390)
        at org.eclipse.ui.internal.ShowViewMenu$1.run(ShowViewMenu.java:139)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
        at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1499)

        How can anyone make head or tail of these Java error logs? They are worse than the hexadecimal bits of a ST22 dump.

        Also, I want to use you (more specifiaclly the CI Eclipse plug-in) as an example in the next edition of my book of a useful Eclipse Plug-In. Is that OK with you?

        Cheersy Cheers

        Paul

        (0) 
        1. Andreas Gautsch Post author

          Hi Paul!

          I think I know the reason, in an early first version I used another XML structure. If you delete this old file a new one will be created. A detailed explaination can be found  here: https://github.com/andau/abapCI/issues/4.
          (Anyway in the latest version of today you should not see the nullpointer anymore but get a message which points you to the just mentioned issue description).

          The deletion or renaming of this old file should hopefully solve both errors. If not let me know. I agree with you the Java stacktraces are really special – I only look at the first few lines there is mostly the relevant line in the code which throws the exception.

          It would be an honour for me if the plugin gets mentioned in your next book.

          Cheers, Andreas

           

          (0) 
          1. Paul Hardy

            Cheers for that, I delted the file and installed the latets updtae and evrything works like a charm now.

            Cheersy Cheers

            Paul

            (1) 
  3. Christian Guenter

    Hi Andreas,

    very nice indeed. When abapGit is opened I see the home screen and not the linked repository, but that should be case if I got you right, right?

    Regards,

    Christian

    (0) 
    1. Andreas Gautsch Post author

      Hi Christian!

      Yes exactly, up to now I am stuck with the automatic change of the package within abapGit. But hopefully the feature also helps you a bit also in the current state.

       

      Greetings, Andreas

      (1) 
  4. Robert Woeltjes

    Dear Andreas,

    I really enjoy what you are doing and wanted to check out the state of the CI Eclipse plugin.
    Sadly when I try to install the plugin via the Eclipse marketplace I get this error message:

    Unable to read repository at https://raw.githubusercontent.com/andau/abapCI/master/com.abapci.updateSite/site.xml/content.xml.
    sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 

    Is there something wrong with the plugin, or is there something wrong on my side?

    (0) 
  5. Thorsten Scheyter

    Dear Andreas,

    Great work! Does anybody else have trouble with Photon?  I compare it to a manual (Save -> Activate -> Perform Unit Tests ) execution. The ABAP CI Plugin has a much longer runtime.

    Thorsten

    (0) 
    1. Andreas Gautsch Post author

      Hi Thorsten!

      The reason for that is maybe that the Unit tests are running in some cases twice and with some delay. The activation of the ABAP objects is asynchronous. But on the other side the Unit testrun from the ABAP CI plugin is executed in the background.
      If you have packages with a lot of unit tests there is also the option “Run Unit tests only for activated ABAP objects” – feel free to try this checkbox (its the second one in the ABAP CI preferences).

      Greetings, Andreas

      (0) 

Leave a Reply