Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
ryfleisch
Participant
To the existing SAP development audience - git and abapGit can be curious things. Why did SAP ABAP need to have git when CTS has reliably moved and tracked changes across SAP environments for years? Obviously it's useful for open source ABAP - but really what else?

In case you missed it: abapGit can be adopted even if you’re not intending to open-source your development on GitHub. And I firmly believe its advantages to your development process are significant enough to consider using abapGit for your company’s internal ABAP development efforts. And while GitHub remains the defacto king of git repositories - know also that abapGit can be used upon other git offerings like Azure DevOps, Bitbucket, Gitlab and others.

Here are a few of the ways that abapGit transformed my development approach I'd like to share.

1. Improved metrics on development productivity 

If you’re managing a team of ABAP developers - it can be challenging to figure out what exactly they are working on each day. The solutions being worked on by each team member can be very complex and the requirements are often time-critical.

How then do you best monitor developer activities without intruding on their time? Agile stand-ups in theory are meant to capture this - but can frequently instead go off topic or extend far beyond an intended 15 minute limit.

Also at an individual level - how do you as an ABAP developer self-report and self-evaluate your progress? Given the swiftly changing priorities SAP developers must often pursue, it can be hard to really speak to what you worked on even earlier last week.

In git - the task of writing a commit and pushing to a branch is often a non-invasive task to do. It takes only a moment of your time as a dev, but it accrues value over time having an on-going log of your work.

I generally encourage developers of all kinds to try out doing at least 1 code commit pushed to a repo per day. After doing this for a period of time, you have a stronger sense of self-accountability in your development goals. For development managers, I think the code commit history is a great way to get unbiased observation of your team member’s development task progress. Sometimes for what you may lack in desired customer results - you can make up for in demonstrated consistency towards a goal.

If you take nothing else from this blog: try doing one abapGit (or general git) commit each day, pushed to the remote repo. Start with yourself, but also have other team members participate as well.

Sometimes when I feel bogged down in other non-development work - I stare down my own git commit history in the recent months of building proUBC. It's a great way to get a birds eye view of what your day to day tends to be like - especially if you're trying to juggle development and non-development workloads personally.

2. Urgent fixes, rework, code analysis, and other dev quality are handled in more nimble and transparent way

One of the most frustrating tasks ABAP developers can frequently encounter is object contention and collisions or similar tasks of rework for bugfixes. And here's a few of the ways many ABAP developers deal with this frustrating occurrence: a lot commented out code, entirely newly-named object copies, monolithic N+1 environments to handle parallel versioning, lengthy cross-team bargaining, experimental sequencing of change imports, or total change blackouts. These solutions can sometimes actually contribute to the object collision or rework problem rather than resolve it when they increase the amount of manual effort required to resolve object contentions.

If you have an object contention - frequently your basic need is get a set of code and objects from specific state and specific point in time and decide how to best proceed. This can difficult to do manually if you've had several conflicted CTS tasks incubate for a long period of time. However git branching and commits are that anchoring piece of data that allow you take yourself easily to that desired snapshot of code and object state. Have an issue? Restore the code from a specific commit and branch. This can be far less risky than peering at ABAP objects line-by-line to determine what changes to keep or remove.

Even without object contentions or rework - the code quality practices you commonly see in SAP projects can seem nightmarish and monolithic. Not at all because of the coding guidelines used, but because of the extensive documentation and review of the code change that's often demanded in dozens of pages excel sheets and word docs. Every time I've used excel to review code quality on my projects or my colleagues - it always felt like I was being pulled out of the element. To do the code quality review work well - I really wanted to comment and annotate in the same place where the code and development lived and could be addressed if needing a fix. Too often - I've had the feeling with word/excel based code reviews that the changes asked for simply really wouldn't be attended to.

In contrast - git does a great job co-locating these review and quality practices with the code - but without forcing too many comments. You can quickly suggest a code edit in a separate branch that coworkers can incorporate to a merge to their dev branch. Before merging all changes to the main branch (think releasing a TR if you're an ABAPer still not familiar with git), git repos allow for commentary and review to take place upon the pull request.

Overall - git does a phenomenal job of capturing developer's thought process while making and reviewing changes. That's rather useful in ABAP both in the moments of production go-live and ongoing long term platform sustainment. All too frequently - its challenging for project teams to successfully extricate themselves and hand off to production support because of the reoccuring questions. "What was this developer thinking?" is common question ABAP developers face day to day.

3. Development can become more organized and portable

Do you have a ZSD or ZMM package in your SAP ABAP environment that seems to attract every new object like a magnet and creates dependencies? If you do - you probably have a goal of doing more consistent modularization of your ABAP developments into separate packages. As hard as we try to document cross-WRICEF dependency graphs, the effort is long and major dependencies can be easily overlooked.

What you'd probably like to do is to splice some code out of one environment, and put it into another clean environment to see what works and what doesn't. With git, satisfying this need is putting together a repository in one environment - then pulling that repository in a new, clean environment.

Without git, you may attempt to import/export code manually or do a transport - but those approaches have drawbacks for this kind of development activity. You want to generally keep the activity quick, simple and not force any probability of an object lock.

4. Archiving legacy code becomes more simple and cost effective

The nice thing about abapGit is that it can version and host ABAP code without requiring an ABAP server. This is an excellent feature for archival of code as well as development.

The task of retiring old ABAP systems can be a tricky one - if you lose access to a SAP system because it gets shut down, what do you do if you’re asked to investigate or revive some custom business functionality? Many times in preparation of such a thing to occur, I've witnessed ABAP developers scrape code line by line into text files or word docs. Other times, the legacy system gets shut down and the custom functionality that the customer wants back 6 months later is seemingly lost forever.

If you've worked in Basis administration before - I have a hunch you've begged a development team to let go of an underutilized ABAP server that had some pre-release/pre-upgrade code. Being able to confidently and quickly follow through on retiring unused systems can be a big money saver.

Many other times without abapGit - custom code lives and dies in the development system and production environment it began its life on. When S/4 HANA implementations occur, off-ramping legacy programs while retaining understanding is a challenge that undoubtedly keeps team leads, CIO, and business users up at night. Having your legacy code tucked away offline in abapGit can be a way to give teams peace of mind in moving forward with various object retirement plans.

 

5. Cloning repos > Copy / paste from website

Just because you’re not writing open source code, doesn’t mean you can’t use it! There are many great open source ABAP projects with generous open source license terms that empower you to use the open source solution freely for use at your company (Yours truly works on one that brings blockchain integrations to SAP).

The trouble is - that in the year 2023 - there are too many ABAP developers haven't touched an git repository. There's this ongoing meme that every month someone creates a 'how to generate an excel file in ABAP' blog that doesn't use the abap2xlsx library. I don't think the issue isn't abap2xlsx itself. More broadly, I think its that culture shift to open source hasn't permeated ABAP developers nearly in the way it has everywhere else. By ABAP's nature and context - a lot will be understandably closed off to the world - but this shouldn't eliminate some of the fastest ways.

There's likely an abapGit open source project out there that makes developing one of your upcoming projects faster. A good example of this may be abap-openapi in which HTTP proxy classes are automatically written for you in ABAP from an OpenAPI definition. In personal experience - using abap-openapi was faster and more simple than trying to use SPROXY/CPI/PI/PO to orchestrate API calls. It wasn't perfect - but it removed a lot of menial coding.

6. Global code reuse across internal systems becomes more achievable

If you have some common utility classes and other programs used across a multitude of SAP systems, you've probably scratched your head how to easily get them all versioned the same.

Defining a transport route that propagates code across multiple SAP systems for this one off purpose is sort of risky. And manually applying the change in each system is too time intensive to be feasible long term.

Why not have it as an abapGit repo? Syncing the changes can just be a pull away! If there's any system-specific deviations - you could always have that in a specific branch that doesn't merge to the others.

7. You will be better positioned to apply CI/CD and Agile processes to SAP development

The concept of branched, parallelized development can be a foreign one to an ABAPer who has only ever known SAP systems that have one active version of code at a time. In some ways, the way in which ABAP development-production environments are typically deployed doesn’t cater to parallelized development very well. But nonetheless, there’s yet a desire to achieve CI/CD in ABAP development environment in interest to servicing your business users better.

In ABAP - our primary control tower for managing changes in the environment is CTS and Charm. In reality though, other systems like Jira or ServiceNow cast a big influence in how CI/CD and Agile are to be implemented in a corporate environment.

If you're using abapGit in your company's internal git host like Bitbucket or Azure DevOps, chances are good you could leverage CI/CD resources already implemented by your company. For example - your corporate Bitbucket may be implemented in such a way that a Jira issue of a particular status must be included in the git commit message. This can be used to facilitate better agile development practices in SAP development teams. Something like this is possible in Solution manager too - but if it was already implemented across the rest of the IT org, why reinvent the wheel?

Summary

I know too that gCTS has been provided for many of these very same goals. My preference for abapGit over gCTS will have to be a topic for another day - but in general I'm still keen to see what shall come next for gCTS. Ultimately - both do weave a similar thread in bring the productivity benefits of git to the SAP ABAP ecosystem. In spite of my personal preference, I encourage you to try both if you can.

Very broadly - Git has enabled the success of many open source projects to outcompete the commercial-based competitors. Git is an essential part of the soul of open source - yet its purpose isn't solely that. Git broadly serves developer collaboration and productivity - and that's something every ABAP project can use more of!

What ways has abapGit benefitted your development team's internal projects? Did any use cases mention here surprise or stick out to you? Sound off in the comments below and check the SAP ABAP community project page or the latest projects listed on dotabap to learn more about the latest abapGit developments. Follow me here on SAP community or find me on Twitter or LinkedIn to learn more about my point of view on SAP development.

 
10 Comments
Jelena
Active Contributor
Thank you so much for sharing this thoughtful and informative post!

As a consultant, I don't get to use abapGit much due to client choices. But it is a very useful tool for all the reasons you explained. Many years ago, I worked at a global company that had several SAP installations and there was one global project where code had to be shared by all of them. We had to get the transport files, send them out, then manually install them, etc. Imagine how much easier this would've been with abapGit.

Thanks again!
ŁukaszPęgiel
Contributor
Nice post. Additionally it helps in the decommissioning process of unused code during S/4 conversion. Also in bringing back somehow still needed code 😁

No stress when pressing delete button on object 😉
UweFetzer_se38
Active Contributor
Exactly one of my user cases
nlara
Participant
Ryan - Great post!

Implementing abapGit and abaplint in our development workflow has been a game-changer. Not only have we seen a significant reduction in bugs and errors, but our code review process has become more efficient and effective.

As Jelena mentions, some customers may be hesitant to implement, but that's a missed opportunity. The broader developer community (outside of SAP) has adopted these tools because they work! The tide is changing, though! IT leaders who understand technology are reaping many of the benefits you pointed out.
Constantinos
Explorer
Great article. Thorough and beautifully written, too.
casualCoder
Explorer
0 Kudos
In the Moment and with our current System Configuration we cannot use the Main Function of git managed Code, it's Branching. How do you branch your code within a Team so changes do not interfere with each other?
marcfbe
Participant
0 Kudos
Works best if you do it the same way as with git: Each developer or team have their own environment.
kartefact
Participant
0 Kudos
Excellent post!

I've been trying to integrate abapGit into my workflows to improve code quality, track changes more reliably and easily and have code change integrate seamlessly into tracking tools like Jira, but have been unsuccessful so far for the lack of an in-depth knowledge in designing a CI/CD landscape for an already SolMan managed on-premise landscape.

I'd love for a tutorial post by someone who has implemented git in their enterprise landscape which can also act as a case-study highlighting how exactly the points mentioned here are realised.

Especially something like the following:

When a developer commits the code into the remote repo from the dev system, perhaps a pipeline can exist that starts the build which does the static code checks and upon passing, copies the code automatically to the quality system and further running another build which can run functional tests in the quality system passing which the code can further be moved to the Pre-production system.

If any of the builds fail, it automatically should trigger an email to the developer and the reviewer etc.

I know I'm being very crude in my description, but I hope you get my drift.

Would urge someone with experience in setting something up like this to pen a blog post detailing out the setup - what tools they use, what sites/plugins etc. It'll be of great help encourage other orgs to put together such systems in place and perhaps standardise such setups in the future going forward.
larshp
Active Contributor
0 Kudos
in abapGit development each commit triggers static analysis see https://github.com/abapGit/abapGit/pull/6189/checks?check_run_id=12968119295 for an example

you dont want to push work in progress code to the quality system, see https://blogs.sap.com/2020/12/28/so-what-is-ci/
kartefact
Participant
0 Kudos
After reading the post and related posts, it seems like there's no "proper way" to setup CI/CD in existing landscapes yet.

Right now if I have to recommend this to management as a developer, I myself am not clear where to begin and how it'll help, what's be the cost etc.

Examples of implementation of some devops strategies in traditional landscapes would really help understand some viabile options.