Skip to Content
Author's profile photo Nabheet Madan

Why OpenSAP started ABAP Unit Test course now – My 2 Cents

ABAB Unit Test Blog Series

Finally done with my week 1 of the ABAP Unit OpenSAP course and thought of writing my idiotic rants:).

Actually I was thinking why all of a sudden this course was started by OpenSAP when we have our fellow mentor Paul Hardy  writing beautiful blog series long time back in 2013-2014. Even yesterday also he expressed his views about the same. I can relate in his blogs how OpenSAP course materials emphasize what he has been trying to convey for last so many years. The important question which I am struggling with is why NOW this course so late?

I wanted answer to it so the quest to understand the same started:)

Is SAP using ABAP unit concept in its developments?

This was the question which could actually help me in understanding the reason. Luckily I have access to ECC as well as 1709 system. So I thought of taking a look into the program structures of 1709. I checked my frequent used two programs one is tcode /UI2/FLIA(FIORI Launchpad intent analysis) and another is program /UI5/REPOSITORY*UPLOAD.  And I can see the difference in the way the code is being structured. Usage of ABAP Unit classes is pretty clear as highlighted in screen shots.

It is pretty evident that for all new developments ABAP Unit test concept is being used exhaustively. I was also curious to know whether in VA01 our golden transaction has some change happened. Bingo, Even our VA01-SAPMV45A also has a unit test framework implemented as can be seen in screen shots.

It was clear that SAP is using it in most of the programs but still why this course NOW question remained unanswered.  Still I was not able to connect the dots.  Eventually my next thoughts went to what actually has changed?

What has actually changed from journey from ECC to S4 HANA

If we look at the journey so far a lot has changed in the architecture of SAP. Two Important things which stand out are, one the frontend is decoupled from the logic and more processing has been pushed to the backend database. We are using FIORI Apps for almost everything and data is exposed via Odata framework. So SAP is gradually moving away from all the procedural codes towards more robust and solid foundation of object orientness. It is extremely tough to actually write Unit Test scripts with the existing procedural code containing thousands of global variables etc.

So now in era of simplification, it makes more sense for this course. ABAP Unit test adds more value with the current architecture of SAP.

So what is next?

Since at a higher level we are able to co-relate how the whole ABAP Unit test fits in the overall strategy of SAP. It makes more sense for me to at least investigate how to write testable code for our Odata services which we have created so far.

I hope to share that experience in my next blog. Please feel free to provide your feedback, I might be completely wrong:)

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Michelle Crapo
      Michelle Crapo

      Great reasons to add it to my programs. I just hope I have the time. It is become a time crunch to add test - even user testing. I think that's normal. But not the best way to do things.

      Nice blog - I really like the examples.


      Author's profile photo Nabheet Madan
      Nabheet Madan
      Blog Post Author

      Thank for the feedback. What i realized while coding my second unit class it does not much long. It looks like the more we o it the less time it takes and more value it adds.

      Author's profile photo Mark Wagener
      Mark Wagener

      If you try to use the test driven development approach, as introduce in unit 1 of week 2, maybe you could force yourself to write the test cases, hopefihop the timely effort is not so big.

      I am also curious on how I will be able to integrate this into my daily business...


      Wish you a lot of success.. . 

      Author's profile photo Sandra Rossi
      Sandra Rossi

      Maybe SAP was waiting for a more powerful library of Test Doubles, like the amazing Open SQL Test Double Framework ! ->

      Author's profile photo Nabheet Madan
      Nabheet Madan
      Blog Post Author

      Agree:) Benefit of sharing views i did not know about this let me understand. Thanks Sandra Rossi

      Author's profile photo Smriti Gupta
      Smriti Gupta

      What a perfect timing for introducing this Blog series! An icing on the cake:)





      Author's profile photo Mark Wagener
      Mark Wagener

      Nice point of view and idea to compare the coding and the approaches kin ECC and those who do not have access to an S4 system a nice insight...

      Moreover it makes the whole thing more authentic to see that SAP sticks to its own rules and recommendations...


      Cheers, Mark

      Author's profile photo Nabheet Madan
      Nabheet Madan
      Blog Post Author

      Thanks for the feedback. It is good to see  what SAP preach they  practice it before:)

      Author's profile photo Markus Greutter
      Markus Greutter

      Some weeks ago I wanted to call a standard API but was not sure how to use it. So I was pretty happy to find a test class in the standard class.

      But then reality came around the corner. The test class contains one method testing the instantiation of the API. And the complete code was commented out.

      Maybe it comes with 1709 🙂

      Author's profile photo Nabheet Madan
      Nabheet Madan
      Blog Post Author

      Yes 1709 i can see has better usage of Unit test classes?