As we all know, maintaining a single code base for SAP solutions across multiple versions can be quite a challenge. Today, I want to share a real-world example I've encountered in my day-to-day ABAP development: Remote-enabled Function modules in S/4HANA 2022 automatically create an authorization object, S_RFC, while older versions don't support this feature.
Why does this matter?
Cross-version compatibility is crucial for SAP solution providers and enterprise customers managing complex landscapes with multiple SAP versions.
For developers, ensuring code works across systems is gratifying as it minimizes maintenance and eliminates the need for duplicative efforts in managing multiple code bases.
For the business there are many reasons why this topic is of importance.
- Wide customer base: As a software provider, your goal is to cater to a broad range of customers who may be using different versions of SAP. Ensuring cross-version compatibility allows you to support diverse clients, improving your market reach and potential for growth.
- Customer satisfaction: Clients expect software solutions to work seamlessly with their existing systems. By ensuring compatibility across different versions, you can provide a better user experience and foster customer satisfaction, which can lead to long-term relationships and positive word-of-mouth.
- Reduced support and maintenance costs: When your software is compatible across multiple versions, it reduces the effort needed for version-specific bug fixes, patches, and updates. This can result in lower support and maintenance costs, allowing you to allocate resources more efficiently.
- Easier upgrades: As clients upgrade their SAP systems, they want the transition to be as smooth as possible. Providing cross-version compatibility can help minimize disruption during upgrades, making it easier for customers to adopt new versions without negatively impacting their business processes.
- Competitive advantage: Demonstrating a commitment to cross-version compatibility sets you apart from competitors who may not prioritize this aspect of software development. As a result, you can position your software as a more versatile and future-proof solution, attracting customers who value adaptability and longevity.
So, how do we tackle this challenge?
Let's dive into my approach, which leverages ephemeral instances, abapGit, ABAP Unit tests, and a smart branching strategy to make this compatibility conundrum a thing of the past!
Approach
- Ephemeral instances to the rescue: As always, I start by spinning up temporary instances of different SAP versions, including ECC 6.0 Ehp 8, S/4HANA 1709, and S/4HANA 2022. This way, I can test my code against the different versions and their unique features.
- Enter abapGit: Next, I use abapGit to pull my code into these instances. This awesome tool helps me manage and synchronize my ABAP code with Git repositories, making it easier to handle version-specific changes like the S_RFC authorization object.
- Run those ABAP Unit tests: With my code in place, I execute ABAP Unit tests on each SAP version. The great news is that abaplint, another handy tool, alerts me to any incompatibilities related to the S_RFC authorization object or other features.
- Branching out for older releases: Informed by abaplint, I create a dedicated compatibility branch for older SAP releases. In this compatibility branch, I can handle the S_RFC authorization object's lack of support by implementing alternative solutions. For simplicity, I deleted the object from the branch.
S/4HANA 2022
I like working with the latest system we have, S/4HANA 2022. This way, I can use the latest ABAP features and fix any issues with older versions in a separate compatibility branch. I run unit tests to make sure everything works well.
Note: I didn't include screenshots of the ABAP Unit results in this post because it's not the main topic. However, you should execute your unit tests in each system and ensure everything is passing.

I can commit all the changes and check abapGit. As expected, everything looks correct since the development happened in this system.

S/4HANA 1709
Next, I want to test the code in S/4HANA 1709. I create a temporary instance of this version and use abapGit to get the latest code from the main branch.

I run into an unexpected error. I prefer to focus on development, not remembering which object types are available in each system. Thankfully, the abapGit community ensures the tool offers helpful error messages. The issue is that S_RFC authorization isn't supported in this system.

I make a new branch for SAP versions before 2022, remove the S_RFC object from the repository, and commit the changes.

Back on my 1709 system, I switch to the new branch, and as expected, the error is resolved.

SAP ECC 6.0
I repeat the same steps for my ECC version, and once again, I achieve the same successful results with my new branch that doesn't include the problematic object.




Advanced Approach: Use a CI Pipeline
In this post, I manually demonstrated one way to maintain a single code base and ensure compatibility across multiple SAP versions. However, a more efficient approach would be to integrate these steps into my CI pipeline and automate the manual tasks. This way, I would receive a report of any errors on specific systems without hands-on intervention. Based on the report, I could determine which SAP versions should use the compatibility branch and re-run my tests. This automated process should take about 10 minutes, eliminating the need to manually create temporary instances and import the code.
Summary
This is how I've tackled the challenge of maintaining a single code base for SAP solutions across different versions, even when dealing with version-specific features like the S_RFC authorization object. By making use of ephemeral instances, abapGit, ABAP Unit tests, and a clever branching strategy, I've managed to stay on top of this compatibility hurdle.
I hope my approach inspires you to tackle your own cross-version challenges with confidence.
Want to code like the top 1% of elite SAP developers?
Elevate your skills with exclusive insights, expert tips, and cutting-edge best practices. Don't miss out – become part of the elite SAP community today!