Introduction

You have probably stumbled upon some cool projects at github like the linux kernel or node-js. Until now it has been quite cumbersome to push your open source ABAP to Git repositories, abapGit will help to make this easier.

 

 

abapGit is a Git client written in ABAP for ABAP, it lets you clone projects or commit objects to the Git repository.

 

 

Installing

  • Download the source code from the github repository
  • Paste the code in new report using SE38
  • Configure SSL in transaction STRUST
  • Run

 

 

Uninstalling

  • Delete report
  • Delete standard texts ZABAPGIT* via SO10

 

 

How abapGit works

First step is to clone a repository, this will create the objects from the repository in the SAP system. After this, one of the following commands will appear:

 

pull

If the files in the repository have been changed, the ABAP objects can be updated with the pull command

 

commit

If the latest changes are implemented in the SAP system, and objects in SAP are changed, the changes can be pushed to the Git repository using the commit command.

 

add

After having pulled or cloned the repository, the objects will be in sync, at this stage it is possible to add new ABAP objects to the Git repository.

 

 

Design/Internals

The “distributed” part of Git is not implemented in abapGit, it will pull data from the repository quite often, and advanced git commands like blame etc. is also not supported. It is currently only possible to serialize reports, classes, data elements, and domains, other objects will be implemented over time. All code will be serialized to .abap files in the repository making it easy to read online, meta data will be serialized to .xml files.

Beware that this is alpha software and provided “as is”, take care and only run in test systems.

 

 

 

Hopefully abapGit will help to ease cooperation in ABAP open source projects and inspire more to do open source ABAP.

To report this post you need to login first.

20 Comments

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

  1. Mauricio Cruz

    Hey Lars, good job on this project!

    I just tried in a 7.3 dev environment without STRUST configured, therefore I couldn’t do much. Later I’ll try to configure SSL in my own SAP environment and perform a full test, but I can already say that the html-approach for the UI looks great.

    I saw that you implemented your own logic to created “.abap” files, and that’s ok for storing and versioning objects outside SAP systems. But there’s a problem: how to get them “installed back” in another system after they’ve been versioned by abapGit? I guess you know about .NUGG files and SAPLinks, which solves this issue, so what are you thoughts about a future SAPLink-abapGit integration?

    I use git with .nuggs on a daily-basis, so I’m looking forward to contribute with your project in the future.

    Great job man!

    (0) 
    1. Lars Hvam Post author

      There are two links on the github page that might help you setup STRUST. Get the certificate from DigiCert Root Certificates :: Download and Test SSL

      Installing back: cloning or pulling will install the objects from Git back into the SAP system. The serialization and deserialization currently works for classes and reports(with some bugs/todos)

      SAPLink and abapGit currently have two different approaches for serializing ABAP code. SAPLink serializes it into a xml file and converts eg ‘>’ to ‘>’, abapGit serializes it into a .abap so it can easily be read, and keeps meta data separated in a .xml file.

      (0) 
  2. Kay Streubel

    Hi Lars,

    this looks excellent! However, it looks like you have to individually develop the serialize/deserialize logic for dev. objects similar to SAPLink. Wouldn’t it make sense to combine the efforts and add a git adapter to SAPLink?

    This article also looks promising. It would be nice if we could add a git adapter to standard SAP transport management… So far for some inspiration coming from your code.

    Thanks!

    (0) 
    1. Lars Hvam Post author

      One of the design goals for abapGit is to have the ABAP code easily readable when shown in the git repository, this requires different serialization than nuggets and slinkees.


      If ABAP code is to be reviewed in a pull request, or via using Phabricator, or via review.ninja, I think it is a requirement that the ABAP is in raw code format.

      But, yes, abapGit is licensed under MIT so anyone can take the code and use it for a git adapter in SAPlink.

      If you have any requests for any dev objects that you would like to serialize using abapGit, please add an issue on github 🙂

      (0) 
  3. Kay Streubel

    Hi Lars,

    I’m toying with abapGit again. I can push all my objects to the remote git repo, but pulling in objects from the remote repo is not working properly. There are extraneous line feeds which make the activation break.

    Is there anything I’m missing?

    BR,

    Kay

    (0) 
    1. Lars Hvam Post author

      Cool, can you try pushing some test objects to a public github repository? Then I can take a look at it. Also please create this as an issue on github, it works better for tracking errors.

      (0) 
  4. Abdul Hakim

    Hi Lars, Great Job.

    Can we do ABAP development on GitHub as we do realtime in ABAP Workbench or it is just a offline version and dont sync up with backend SAP system? Also will this project finally pay way for ABAP in cloud? For instance HCP etc..? Appreciate your detailed response.

    Thank you

    Hakim

    (0) 
    1. Lars Hvam Post author

      abapGit allows for sharing and versioning code on eg. gitHub. Development happens in the normal ABAP system with ABAP workbench, after development is done its possible to push the changes to the git repository. Then on a different ABAP system the code can be pulled down and activated in this system.

      abapGit is not related to cloud/HCP, scope is only git.

      (0) 
  5. Lars Hvam Post author

    support for offline projects added. It is now possible to install or download without SSL or internet connection

    (0) 
      1. Lars Hvam Post author

        next major feature will probably be folder/package support

        If the main package ZMAIN contains a child package ZMAIN_UTILS, then the objects from the ZMAIN_UTILS package will go into folder /utils/. Or at least thats the idea, we’ll see when it happens 🙂

        (0) 

Leave a Reply