Practical Use of OOPs ABAP – Model View Controller (MVC). Part III

Benefits of OOPs

In Part I, we covered the concept of Model View Controller in OOPs ABAP. In Part II, we added another class to add more feature to the User Interface. Now in this concluding part is the final real time requirement, when the user needs only specific fields and additional information from multiple tables to be displayed.

This is a practical project scenario, where there is a change request for an already delivered object. In the initial development there was some business logic, but now the flow has changed and hence the business logic has changed. We need to enhance the old OOPs program and update our Model.

You have guessed it right. In this part, we will be changing only our MODEL i.e. our class CL_FETCH

We are selecting our data from multiple tables and eventually, we will be displaying the data using our final table.


We have three methods here including CONSTRUCTOR.

FETCH_DATA: will return the respective data from different tables.

ARRANGE_DATA:  will append our data from the respective table into our final table.

ABAP Objects

So we have final table IT_FINAL which we will pass to our factory method.

Now if you observe our all scenarios we have changed the classes independently without disturbing the other classes.

The logic behind decoupling is simple. When we change our View (CL_ALV) we don’t have to bother about the MODEL i.e. our data class (CL_FETCH) and vice-versa.

Also ReadJust 4 Versions of the same program to understand OOPs ABAP

Final Program:

Do you Know? How to convert an existing ABAP Report to OOPs ABAP?

Here is the output of the program.

SAP Objects

OOPs Programming

Hope we were able to explain the Model View Controller concept and now you can use this in your real project. In these short 3 Parts series, we tried to showcase the benefits of OOPs and how we can decouple the Model, View, and Controller. ABAP mentors always say that OOPs if used correctly would make every ABAPer’s life easier. It is easier to maintain and support. But, until and unless we implement OOPs in real projects, we cannot learn enough.

So, dare to come out of the procedural programming language and venture into OOPs ABAP.

Did you find these 3 Parts series on MVC useful?

In either case, please leave a quick comment and let us know if you have something to share with our SAP enthusiasts.

Till next time. Happy learning.

OOPs ABAP series on MVC Concept

Part I – Model View Controller (MVC) in SAP ABAP – Introduction

Part II – Model View Controller (MVC) in SAP ABAP – Enhance the View

Part III – Model View Controller (MVC) in SAP ABAP – Enhance the Model

Please Subscribe, Like and Share our Page.


  1. Hi,
    this short tutorial of MVC in ABAP is good. But what about the BUS_SCREEN Framework? In my opinion it is easier to use and less work. What’s the advantage of this doing?

    • Sorry Bastian – We do not have much experience working in BUS-Screen framework. Would you like to share some tutorial in our portal about BUS-SCREEN? Please let us know, if you would be interested.

      Team SAPYard.


Please enter your comment!
Please enter your name here