Skip to Content

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:)

To report this post you need to login first.

10 Comments

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

  1. 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.

    Michelle

    (2) 
    1. nabheet madan 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.

      (1) 
    2. 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.. . 

      (1) 
  2. Mark Wagener

    Nice point of view and idea to compare the coding and the approaches kin ECC and S4HANA…gives 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

    (2) 
  3. 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 🙂

    (1) 

Leave a Reply