Skip to Content

SAPmvc is an Open Source framework created to introduce the MVC design pattern to the ABAP Classical Dynpro using the pure ABAP Objects.

 

I’m not the only one who spent time to create and share a OO Dynpro solution. Thomas Jung created your first prototype in 2005 as we can see in your blog OO ABAP Dynpro Programming.

 

SAPmvc will be released in few weeks with:

  • Examples; 
  • Documentation;
  • Main Project Page;
  • Download repository;
  • Bug report;

 

I hope that all ABAPer’s fans contribute with suggestions, criticisms, Bug reporting and improvements !

 

What’s MVC ? 

Model-view-controller (MVC) is a classic design pattern often used by applications that need the ability to maintain multiple views of the same data. The MVC pattern hinges on a clean separation of objects into one of three categories:’

  • Model – The model represents data and the rules that govern access to and updates of this data. In enterprise software, a model often serves as a software approximation of a real-world process.
  • View – The view renders the contents of a model. It specifies exactly how the model data should be presented. If the model data changes, the view must update its presentation as needed. This can be achieved by using a push model, in which the view registers itself with the model for change notifications, or a pull model, in which the view is responsible for calling the model when it needs to retrieve the most current data.
  • Controller – The controller translates the user’s interactions with the view into actions that the model will perform. Depending on the context, a controller may also select a new view.

 The controller represents system input, the model represents processing and the view represents the output of the system.

By decoupling models and views, MVC helps to reduce the complexity in architectural design, and to increase flexibility and reuse. Because of this separation, multiple views and controllers can interface with the same model. Even new types of views and controllers that never existed before can interface with a model without forcing a change in the model design.

 

Interaction Between SAPmvc Components

 

Once the model, view and controller objects are instantiated, the following occurs:

SAPmvc

The view is registered as a Model’s listener. Any changes in model’s data result immediately in a broadcast change notification( Optional ), which the view receives.

Note that the model is not aware of the view or the controller, it simply broadcasts change notifications to all views interested listeners or just allows controllers and/or view to access its data.

The controller is bound to the view. This typically means that any user actions that are performed on the view will invoke a registered listener method in the controller class. The controller is given a reference to the underlying model.

 

Interaction between SAPmvc Components and User

 

Once a user interacts with the view, the following actions occur:

SAPmvc

The view recognizes the Dynpro action (e.g. pushing a button, request match code or request field help) in PAI and trigger the appropriate event, thus all event handler in controller that is listening this event is executed.

The controller access/update the model and call next view if it’s necessary. If the model has been modified, it notifies interested views of the change. During the PBO the view trigger the appropriate events and all event handlers in controller that is listening this event is executed. In this moment the controller update the Dynpro accessing the data in the model.

 

SAPmvc has three classes:

 

ZSAPMVC_MODEL – It contain the data and the application rules.

 

SAPmvc supports nested and compound Models. A compound Model contains one or more Models as component Models. These may contain further Models as components. A number of levels of nesting are therefore possible.
Models that do not contain other Models are referred to as simple Models.

Model

ZSAPMVC_VIEW – It’s responsible to controls the Dynpro.

 

 

Through the View is possible to take control to PF-Status, Table control, Tab Strip, Sub screen, modal screen, ALV’s, etc….

View

View Dynpro

 

Through the View is possible to handle the events like AT-EXIT COMMAND, USER-COMMAND, POV ( ON-VALUE-REQUEST ), POV (ON-VALUE-HELP), etc….

Dynpro

ZSAPMVC_CONTROLLER – It’s responsible to handler the user’s interactions with the view that the model will perform.

Controller

 SAPmvc can be used for application in the ABAP Platform up to release SAP Netweaver 7.0.

To report this post you need to login first.

11 Comments

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

      1. Marcelo Ramos Post author
        Hellow Blag,

        “I think we need to innovate more, create more projects ! I believe this encourages others to participate more !

        The result is, a community more vibrant and participatory !”

        I’m counting with you for this, OK ?

        Greetings,

        Marcelo Ramos

        (0) 
        1. Alvaro Tejada Galindo
          Of course! You can count with me on anything SCN related -:)

          I have posted a blog The specified item was not found. asking for more participation in the ABAP Games world…

          You Chess Game is really inspiring for anyone! -:D

          Greetings,

          Blag.

          (0) 
    1. Marcelo Ramos Post author
      Hi Ignacio,

      Thanks for comment.

      I hope all ABAPer’s Funs like we enjoy and participate in the project when the 1st version(beta) is available !

      I think we need to innovate more, create more projects ! I believe this encourages others to participate more !

      The result is, a community more vibrant and participatory !

      Kind Regards.

      Marcelo Ramos

      (0) 
    1. Marcelo Ramos Post author
      Hi Sivakumar,

      I’ve already finished SAPmvc framework developments, but I’m not able to install it through the SAPLink. I’m working in this issue.

      But I’m releasing SAPmvc as soon I resolve this issue !

      Greetings.

      Marcelo Ramos

      (0) 

Leave a Reply