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.

41 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. Andrey Vishnevskiy

      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. Former Member

    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. Former Member

    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. Former Member

    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) 
      1. Marcin Pciak

        Hello Graham,

        I am just starting to explore abapGit, but spotted several things that don’t work similar way git works with other application servers.

        A typical scenario for non-SAP development (i.e. using PHP on Apache with Git) is like:

        • a Developer1 installs Apache server on his localhost together with git bash
        • he initializes git project on his localhost where he does his development – he commits to his local dev version only
        • he initializes global repo on company’s Apache server where he pushes his local dev
        • the application is deployed on this company’s server pointing to this global repo (with autodeployment option on)

        Now new Developer2 joins the project and needs to start working on different functionality of the same application. What he does is:

        • he installs Apache server on his localhost with git
        • he clones the project from global repo to his local one to get the latest app snapshot
        • he creates new functionality and changes some code of main app
        • he commits his changes to his local repo
        • he pushes his changes to global repo (after prior optional pull & merge)

        What that means:

        • both developers can work on their own local versions of the same project (local repo)
        • once tested they can push it | pull it | merge it with the global repo

        With abapGit the usage of git is different:

        • none developers have their local Netweaver server installed, therefore they cannot commit to their local repo – there is only one version on NW company’s server
        • they cannot work on same code on this NW company’s server because naming convention in SAP is unique at object, not at package level
        • that also means they cannot work on different branches of the same project at the same time, because only one version can exists at a time at NW’s repo
        • most likely they will have a locking conflict once they want to change same object even at different point in time

        Assuming above as far as the project is developed on same NW server, abapGit seems a very neat tool only for backup and prototyping (using git branching), and an exchange tool accross different NW’s server. It does not however leverage power of Git for shared projects, probably due to SAP naming restrictions and the fact that most developers don’t have their own NW localhost.

        Hoping to hear you thoughts on this 🙂

         

         

         

        (0) 
  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) 
  10. Rodrigo Luiz Hoffman

    Hi Graham!

    Just one thing more I’m trying to understand: Can I have different repositories per Project, per Package, or both are essentially the same thing? What if I need to modify a specific program as part of two different projects at the same time, and merge the changes afterwards?

     

    Thanks in advance!!

    (1) 
    1. Graham Robinson Post author

      Hi Rodrigo,

      the abapGit paradigm is that you essentially link an ABAP package to a Git repository. You can make use of the ABAP package hierarchy so that sub-packages are included in the Git repo.

      In theory you can link a Git repo to multiple ABAP packages on the same system – but in practise you can’t because ABAP does not use the package as part of the object name so you would get duplicate object names. (ABAP namespace issues are many and varied and a mess IMO #justsayin)

      I haven’t tried it but you should also be able to use a Git Submodule to clone another repository into your project and keep your commits separate.

      I know this doesn’t answer your question. 🙂

      Taking your simple example of “modify a specific program as part of two different projects at the same time” – I guess I need to better understand what you mean.

      If you mean that a single project (i.e. git repo) has been replicated to two different ABAP systems and been modified on each you are probably asking how to handle conflict resolution when the two changes need to get merged back into the master branch. abapGit does not support conflict resolution itself yet. It is obviously an important feature that many would like to see supported – and really it comes down to finding some contributors who are motivated to work on this issue.

      However most git services (esp. GitHub) include tools for conflict resolution that you can make use of. So when I demo abapGit I show how you can use the GitHub conflict resolution tools to handle conflicts.

      I also like the GitHub Flow developer workflow. If you follow this pattern both your developers should create their own development branches. The first developer to merge his branch into the master branch will have no conflicts. The second developer won’t be able to merge into master until he resolves any conflicts in his branch. This ensures the master branch is always deployable. Note when using GitHub Flow you should protect the master branch – this ensures you can’t commit directly to the master branch but must merge from another branch via a pull request.

      If your question is asking for the best way to modify an ABAP program that is going to be deployed to two different ABAP systems then I think the simplest way is to do the development in one of those systems, commit the changes and then pull the updated version onto both systems for testing. This should ensure there are no conflicts which do, after all, complicate the process.

      I hope that goes some way to addressing your question.

      Thanks

      Graham Robbo

       

       

      (0) 
      1. Rodrigo Luiz Hoffman

        Thanks for the clarifications, Graham! Just so you know the reason I’m asking all of these questions, my colleagues want to implement Charm for object management in SAP/ABAP. As I know git is a great tool, I am trying to understand whether AbapGIT would improve development productivity/management if used in conjunction or instead Charm.

        The way I see now, while Charm would help with better object sequencing/management, git would help with easier management of codes and projects… still working on that puzzle though… will share more about it when getting to an outcome!

        Thanks,

        Rodrigo

        (0) 
  11. Sascha Junkert

    Hi everybody,

    very interesting discussion so far, thanks for the insights!

    Is anybody using abapGIT in an enterprise production environment yet and can give us some lessons learned? Is it stable enough to use in mission critical systems without fear of breaking “something”. What about change management on an organzational level? I would imagine that not evrybody is happy using these new hippster methods of developing software… 🙂

    I understand that abapGIT is currently not available for Eclipse ADT? Any plans to adopt it as Eclipse is pushed more and more as standard ABAP ide (at least this is my impression)?

    Cheers,
    Sascha

    (0) 
    1. Nic Teunckens

       I understand that abapGIT is currently not available for Eclipse ADT?

      I dó think it is possible to use ABAPGit by Executing the Z-report for ABAPGit directly although I must confess I haven’t used it Yet. See this GitHub-issue on ABAPGit Eclipse-Support : link

      (0) 
    2. Graham Robinson Post author

      Hi Sascha,

      you can run abapGit from inside Eclipse ADT like any other program – but at this stage it is not provided as an Eclipse plug-in.

      Cheers

      Graham Robbo

      (0) 
  12. Former Member

    Hi Graham, Lars,

    I do understand that I may be a relic but… Is that possible to backport ABAP Git to R/3 4.7? I’ll try my best, but I don’t think it’s gonna be easy… For example, R/3 doesn’t have this interface, IF_T100_MESSAGE. I can guess what it is like and create a Z-version of it, but, probably, it will be easier to do backporting from a system which already has all the objects… Another thing is regular expressions which, again, are not available in R/3. It’s possible to use a custom class that utilises javascript for regex’es, so I’ll try this option, but apart from that it would be really great if someone could help with backporting. Once it’s there, even relics like me can start getting benefits from the advanced version control that Git provides.

    Kind regards,

    Vlad.

    (0) 
    1. Graham Robinson Post author

      Hi Vlad,

      there are lots of issues that need to be considered when choosing how far back to backport a project.

      The reality is that this is an Open Source project that relies upon its’ contributors to donate their time to work on it. Therefore what is doable is directly related to the priorities, interests and resources of those contributors.

      For example I have no access to a 4.7 system to develop on – even if the dependency issues could be resolved.

      But you do. So by all means raise an issue and see if you can find enough people who would like to contribute to a backport to 4.7. Or even create a pull request for discussion around the topic and see where it goes?

      I can’t speak for Lars – who knows the code much better than I do – but if you find enough support and resources for this initiative I suspect the best thing to do would be to fork to a new project as the dependencies are huge – much more than the few that are obvious. This means your code line will have to diverge significantly from the main branch.

      Good luck.

      Cheers

      Graham Robbo

      (0) 
  13. Attila Berencsi

    Hi ABAP Git Magicians,

    I want to move a report  btw. 2 systems , but the objects are distributed across packages. For example data elements under ZBC and the report within package ZBC_UTIL (under the ZBC package. I do not want to move all (unnecessary) objects of ZBC to the other system.  There is an option under Advanced menu to “Object to files”. How do I import it in the other system ? Probably the goal of this option is not I want to achieve, but rather place an object to an external repository manually. I would like to do the same as with SAPLink before. To create a nugget with arbitrary objects list and import it in another system. A workaround what I found out, is to create a transport request and record the required objects inside, and after use the transport to zip option(not tried yet). The report was created before the system was upgraded, so the original requests re gone.

    What would be the best in your opinion to realize my requirement with ABAPGit ? (I know that Git is project/package based and not like SAPLink, but if I can do this somehow easy, it would be great)
    Thank You

    Attila

     

    (0) 
    1. Graham Robinson Post author

      Hi Attila,

      a common problem – and an annoying one too.

      I think you are on the right track. Git conforms to a hierarchical filesystem paradigm where a repository is related to a sort of folder endpoint – so all tracked objects need to be children of the same parent. Therefore the obvious structure to link a repo to to is an ABAP package.

      It sounds like your objects are all under the same package structure – so that is not a problem for you – but you also want to cherry pick just a few objects and move just them. What this describes is what CTS does – and SAPLink as well.

      So I think your strategy of identifying the objects you want and then serialising them and moving them to the target system is probably the only way to do it. Whether you choose to use an SAP transport request, SAPLink or abapGit .zip option probably doesn’t matter. The hard bit will be identifying all the dependencies you need to move.

      The only other suggestion I have – and it is a slightly mad one – is that you could use abapGit to push your entire package structure to a git repository, clone the repo to your local filesystem, create a new branch, delete all the objects you don’t want from that branch, push the branch back to the repo and finally pull down the branch into the new system.

      Sorry I have no silver bullet for you.

      Cheers

      Graham Robbo

       

      (0) 

Leave a Reply