Skip to Content

Are you an ABAP developer? Are you using abapGit?

If you answered “Yes” to the first question did you answer “Yes” to the second question too?

You might be thinking – “What is abapGit?” – so let’s start there. The simple answer is that abapGit is a Git client written in ABAP for ABAP.

Some of you are now thinking “What is Git?”. I’m sorry that is outside the scope of this post but please, please, please use Google to figure that out. And I urge you do it quickly – like “now” – and then return to this post later. Git is a fundamental part of the contemporary developer’s toolkit. IMO ignoring Git is not an option for developers in 2017.

Back to the topic at hand. abapGit is an Open-source project initiated by Lars Hvam under an MIT License.

At time of writing there are 24 contributors to the abapGit project. There have been over 400 commits in the past 5 months alone which shows this is a very active and vibrant project. Maybe you too will want to contribute and help make abapGit bigger and better?

One of the design goals of abapGit is that it should have a “small footprint”. This can mean many things to many people. One thing is it is absolutely the easiest ABAP project to install – EVER! No transports. No multiple steps. No pre-install of other things. No file uploads. No patches required. No add-ins required. Simply copy and paste code into a program on your ABAP development system and activate.

Like this….

The first thing you might want to do after installation is connect to GitHub so you can keep your abapGit code up to date. Yeah – amazing concept isn’t it? We can pull down the latest version of the abapGit project any time we like. Kapow! Take that CTS! abapGit also has a “background mode” so you can automate this task.

You are highly likely to want to use GitHub for some of your repositories anyway. It is the most popular hosted Git out there, it is free, and it contains some other awesome ABAP Open-source projects like abap2xlxs.

For abapGit to talk to GitHub we have to use TLS. This means we have to install some root certificates on our ABAP system using transaction STRUST. The abapGit installation documentation takes you through how to get these certificates and install them. And there is also a simple test program so you can ensure the connection to GitHub works.

If you want to connect abapGit to other Git servers they may well mandate you use TLS as well and therefore you might have to install other root certificates depending who their CA is.

So now that is done, let’s see how we can link to the abapGit repository on GitHub so we can keep our installed abapGit code up to date with the latest developments. There is a wizard to help you do this in a few clicks of the mouse.

When abapGit is run for the first time it will take you to the abapGit tutorial page. You can also find this via the menu Help->Tutorial. Simply click on the “install abapGit repo” link to kick off the process. You will be asked to confirm that you want to install into package $ABAPGIT. abapGit links Git repositories (repos) to ABAP packages. So we need to store the abapGit artifacts in a local package of their own – in this case $ABAPGIT. You will also be asked if you want to overwrite the ZABAPGIT program you just created. Answer “Ok” to this. Activate all the abapGit artifacts and you are done.

To finalise this post – and hopefully to leave you with just one example of how abapGit changes the game for ABAP developers let me take you through a simple scenario. We need to start by cloning a repo to an ABAP package. I am going to use the sample code from my recent presentations on Building Gateway Services which can be found at https://github.com/grahamrobbo/teched16_example.

See how easy that was? A few clicks here and there and I have all that ABAP code pulled down from GitHub into a package I was able to create from inside the abapGit UI including activated everything. Kapow!

Now watch as I stupidly decide that my code needs a little too much refactoring. I brilliantly decide to delete the interface ZIF_GW_METHODS because I have forgotten how this is used all over the place. Suddenly I have lost important code, the stuff I have is broken, and I can’t activate anything. Arrrggghhhh. I guess I will have to logon to the production system and copy and paste the old code from there to get me back on track? Assuming I can remember all the other changes I had in progress as well.

Or – I can just refresh my package from the latest commit on my GitHub repo. And because I “commit early and commit often” I have lost none of my work in progress either.

Kapow!

And that is just one benefit of bringing Git to the ABAP developer toolset.

 

RIP Adam West

Thankyou SAPlink

 

BREAKING NEWS BREAKING NEWS BREAKING NEWS BREAKING NEWS BREAKING NEWS 

In his SAP TechEd Las Vegas keynote presentation Bjoern Goerke announced that “we (SAP) are going to work with the SAP Mentors to embed this (abapGit) into the ABAP design-time“.

You can hear this announcement and see Bjoern’s demo around the 41 minute mark of the keynote presentation replay.

To report this post you need to login first.

24 Comments

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

  1. Roberto Vacca

    Hi,

    I like this Spot and batman too 🙂 I’ve never used AbapGit. Two questions like a stranger:

    • Is this the end for ZSAPLINK project ? (I know versioning control system in a “cloud” is an other thing but SAPLINK project is a kind of “repository for abap projects” between developers)

     

    • They tell us that Eclipse ADT will be the new world for ABAP developers even if i’m not soo sure especially in those countries with retirements seniority problems 🙂 …anyway.. on Eclipse ADT we’ve a local version until we update it on the Application Server Repository. Is AbapGit a kind of emulation of this system inside SAP GUI?

     

    Thanks for the Blog

     

    (0) 
    1. Rainer Winkler

      Hi Roberto,

      that are many questions. I think Gregor Wolf and Lars Hvam can give the best answers.

      abapGit has a very good documentation http://larshp.github.io/abapGit/ . In my understanding it is not a “cloud” project. You can export to file and use also own local repositories. That people use github for openSource projects is convenience. But real customer applications might be stored on a local repository.

      Regarding SAPlink you should for instance ask Gregor Wolf. My understanding is, that abapGit is more powerful than SAPlink, so I doubt that there will be many people that keep improving SAPlink. Nonetheless, you could do this.

      Eclipse ADT keeps local versions of code. abapGit is much more powerful than this as it connects to git.So versions can be shared between many developers and repositories. I would not call this an emulation.

      I use abapGit since a few months and I am happy that Lars Hvam invested the effort to develop it. I also used SAPlink sometimes to export and import coding. But working with a version control like git is much more powerful and saves me currently a lot of work.

      Best regards

      Rainer

       

      (2) 
    2. Andrei Vishnevsky

      Hi Roberto,

      Short answer for your first question: abap2xlsx project has recently switched from SAPlink to abapGit 🙂

      And in abapGit there is such a thing as “offline projects” which are not connected to git and nothing but zip archives when you’re exporting them from the system. So they can be used to pass offline files back and forward. It means abapGit is not only about version control.

      (4) 
  2. Florian Henninger

    For me abapGit is a absolutely advantage for every developer. I just can repeat Graham.. if you do not know GIT at all.. go and get used to it.

    I mainly use it to get my templates quick from one system to another system without the need to create everything by hand. A Transport-request is not an option because these are my own small pieces of a solution and abapGit is providing an awesome benefit for it.

    I’m still in that phase that my stuff has te be commited to git, but I hope to finish that task before the end of the year:-)

     

    ~Florian

    (2) 
  3. Graham Robinson Post author

    Thanks for your comments – I started to respond to the abapGit vs SAPlink thread but instead went for a new post. You can find it here.

    Cheers

    Graham Robbo

    (2) 
    1. Matt Harding

      Hi Justin,

      Basis probably might need to be aware of it, but something they should definitely know about is the need to activate TLS on your system (if not already done) which requires you to set the cryptic parameters in rz10 (note 510007 referenced by 2110020):

      ssl/ciphersuites  =  135:PFS:HIGH
      ssl/client_ciphersuites  =  150:PFS:HIGH

      Cheers,

      Matt

      ps. Robbo – All installed, but just need to figure out how to create a repo from a package safely. Almost there…

       

      (0) 
        1. Matt Harding

          Thanks Lars – Wasn’t hard at all to find the doco I needed that you pointed out and was just taking it one step at a time (unfortunately this step actually failed for me but I’m dealing with lots of authenticated proxies that work one minute, but not the next so figured I’d come back to it another day). Mighty impressive work has been done here!

          Cheers,

          Matt

          (1) 
  4. Ricardo Israel Mata Viejo

    It’s a great option for developers, my great concern is the installation of the certificates and the communication to the external servers. Many organization doesn’t like to have communication to external providers directly to their backend, sometimes not even with a cloud middleware, and in some cases, backend is not allowed to have internet access at all. That’s something Architecture need to approve. Then certificates installation is a Basis activity that for sure will need approval from infrastructure as well. I am not sure how feasible it is until more and more enterprises change their mindset about online tools directly to their backend.

    regards,

    (1) 
    1. Lars Hvam

      Yeah, I agree

       

      In abapGit there is also a feature for offline projects, which works with uploading and downloading zip files from the frontend PC, see

      http://larshp.github.io/abapGit/guide-import-zip.html

      http://larshp.github.io/abapGit/guide-export-zip.html

       

      I’ve also been working on a git server in ABAP, this way the code does not have to leave the system, see blog https://blogs.sap.com/2017/05/07/abap-using-git-for-safety-and-transparency/

      (0) 
      1. Graham Robinson Post author

        And, of course, you can implement your own Git server inside your firewall if you want to…….but please understand we are only talking about pulling and pushing from your ABAP development system. This is what developers do on all other platforms right now.

        I understand that customers need to be comfortable with this but I think it important that they don’t treat SAP as a special case. If their Windows systems are getting updates directly from Microsoft servers, if their Unix systems get regular updates from external servers, if their corporate smartphones and tablets get app updates directly from external servers (without any QA process) why can’t their SAP developers use an external code management system when the code subsequently goes through a rigorous QA process before even getting close to production?

        SAP is not a special case here.

        (0) 
  5. Jacky Oakley

    Nice blog Graham!

    Just curious, I saw in the video that you have a URL (google) in your SAP Easy Access.  I know how to change the image there but how do you make it to be a URL rather than an image?

    (0) 
  6. Andrei Bohus

    Hello,

    I have some questions:

    – if i understood correctly a developer is able with abap for git to create a local version(clone) of the production code(remote repo) in a development/local package and sync it with git (push, pull). Does this imply that the developer should have installed a local version of ABAP on the local machine or it is possible that the local version and the ‘remote repo’ are on the same machine. Because as far as i know the usual abap development system is one remote machine where all developers log in and change the code/which is locked if multiple users access the same file?

    – now during the clone the package name should change. E.g: the remote repo code (master branch) has package /XYZ/DATA_ACCESS. How to a create a local version of it? Save it in my temporary package /TMP/UNAME? The names of all the files is changed?
    – how do i merge a branch to the master branch? how do i solve code conflicts?

    – How would you setup a environemnt using abapGit. Environment: development system, test system, performance system, delivery system.

    – How can you integrate abapGit and the  standard snote delivery?

    (0) 
    1. Lars Hvam

      I typically use abapGit for moving code between systems that are not in the same landscape, this works very well for open source projects.

      With abapGit it is possible to work in a lot of different ways, but it is limited by the functionality in the SAP kernel. You can take a look at http://searchsap.techtarget.com/tip/Implementing-modern-practices-in-an-ABAP-development-shop for some suggestions on how to work.

       

      Automatic renaming:

      Not implemented, but pull requests welcome. The difficult part is renaming the dependencies, eg structure using data elements

       

      Merging branch:

      There is a feature under Branch -> Overview for merging branches(feature not documented yet). Conflict handling currently not implemented, https://github.com/larshp/abapGit/issues/797

       

       

      SNOTE:

      Not integrated, abapGit is a community project.

      (0) 
  7. Rodrigo Luiz Hoffman

    Hi Folks!

    I really like the first glance of abapGIT, but I still have a couple of doubts. When we say the program is editted “locally”, that means on a file on my machine in a local git repository? Would that be edited through Eclipse?

    That’s ok for code control, but that means I cannot test different branches (like a release branch for the future) in the same environment, correct?

    (0) 
    1. Graham Robinson Post author

      Hi Rodrigo,

      it is great to see you looking at abapGit.

      When running the abapGit git client the “local” repository refers to your ABAP package. The “remote” repo will typically be hosted somewhere like GitHub.

      You use the same tools to edit the local repo you always have. ABAP workbench, eclipse with ADT, etc.

      As you have make changes you test them and then you commit them so they are inserted into the remote repo. Remember to commit early and to commit often.

      There are plenty of different ideas about the best developer workflow – but I like GitHub Flow.

      When I want to make changes to my ABAP code I create a new working branch. This means my master branch remains unchanged so I can always return to it easily. Over time I might make many commits to my working branch. Remember to commit early and commit often. 😉

      I might even have a few different ideas about the best way to refactor my code. So I can create a different working branch for each idea as I try it out. Those I like I keep – or merge into the original working branch – those that don’t pan out I simple delete that branch.

      As I switch between branches abapGit pulls down the latest code for that branch from the remote repo and replaces my “local” repo (my ABAP package) with it.

      Therefore you can test each branch in turn in your local ABAP environment. You can also revert to the master branch at anytime – for example to apply an emergency fix to the latest production code. And you can then switch back to your working branch and continue your developments.

      Once you are happy with your changes you can merge your working branch into your master branch.

      I hope that helps.

      Cheers

      Graham Robbo

      (3) 
  8. Suhas Saha

    I am using abapGit along with the abapGitServer since a couple of months. It’s a nice polished product. Good job done to Lars & other project contributors!

    Conflict handling currently not implemented, https://github.com/larshp/abapGit/issues/797

    Any updates on this feature?

     

    (0) 
    1. Graham Robinson Post author

      Hi Suhas,

      nice to hear you are seeing the value in abapGit. Expect to hear more soon.

      As for conflict handling – remember this is an open source project. You can start this work yourself if it is important to you. 😉 #seewhatIdidthere

      Cheers

      Graham Robbo

      (0) 
  9. Rolf Paulsen

    Hi,

    are there ideas how to handle “non-code” artifacts, especially BOPF objects that are stored inside SAP BOPF tables? Maybe (de)serialize the BOPF table content in XML? Inside ABAP server versioning it is afaik not possible to get a diff for BOPF objects.

    Regards

    Rolf

    (0) 

Leave a Reply