GRC
HR
SCM
CRM
BI


Article

 

Modeling ABAP Objects in Rational Rose with the New Rose ABAP Link

by Karl Kessler | SAPinsider

July 1, 2002

by Karl Kessler, SAP AG SAPinsider - 2002 (Volume 3), July (Issue 3)
 

Before any developer actually starts writing code — no matter what the platform or programming language — they should have in mind a clear design, one that they can follow through to final development. Of course, you can sketch your design informally anywhere, even on a napkin. However, if you want to present your ideas to your team (or ensure that your design isn’t thrown away as you finish your lunch), a more formal, consistent way to express your initial software design and implementation model already exists: UML (Unified Modeling Language).

UML is a well-known industry standard for creating modeling diagrams that describe your software system’s behavior. UML diagrams help you understand and communicate complex software structures. It is typically used in the early design phase, but is also tremendously helpful for reengineering projects where large pieces of software need to be maintained, extended, or modified — in other words, almost any typical SAP customer’s project!

Modeling Tools for SAP: Some Background

Modeling tools for SAP systems have been available for some time now. One of the precursors of today’s modeling tools was SAP’s Data Modeler, which helped display entity types and relationships in both a graphical and hierarchical way. Entity types can be mapped to database tables or database views.

However, while the Data Modeler focuses on the dependencies of the underlying relational model, it tells nothing about the system’s behavior. The Data Modeler was primarily used to model the overall system landscape, to better understand and speed up the implementation phase in conjunction with other tools, such as ASAP. If you wanted to represent the system’s behavior, it was preferable to think in more abstract units like packages and classes, which allow you to encapsulate many of the internal implementation details, such as data storage in flat tables.

Then came the advent of ABAP Objects and the success of UML as an industry standard for visual modeling. SAP decided that rather than further enhancing the Data Modeler, it would open up the ABAP Objects Repository to external, PC-based development tools via a well-defined, RFC-enabled ABAP class API.

As a result, third-party modeling tools now can connect to the ABAP Objects Repository, and can read or change its contents as if they were working from within the Development Workbench. (Although modeling tools can connect to the ABAP Objects Repository, in order to prevent inconsistencies, changes to ABAP classes are only allowed under the full control of the Workbench Organizer. The ABAP Objects Repository is always stored in the database, and changes in the model must always be propagated back to the Repository to become valid for the ABAP Workbench.)

The first modeling tool to support SAP’s class API is Rational Rose from Rational Software. It can connect to the ABAP Objects Repository via the Rose ABAP Link, which is available from Ensemble Systems.

For those of you who are unfamiliar with UML and Rational Rose, I’ve asked Ralf Bucksch of Rational Software to give a brief introduction to the functions of the Rational Rose modeling solution (see below). In the following sections, Ron Williams of Ensemble Systems provides a quick guide to the functionality of the Rose ABAP Link, and demonstrates how it gives ABAP developers access to the modeling functions of Rational Rose.

Rose ABAP Link: Making Rational Rose Available to Your SAP Systems

The new Rose ABAP Link from Ensemble Systems Inc. is a solution that takes the scalable object modeling capabilities of Rational Rose and integrates them with SAP’s ABAP Objects Development Workbench.

Working from a model in Rational Rose, the Rose ABAP Link allows ABAP developers to automaticallyvalidate their Rose model to ensure that the model conforms to ABAP conventions and standards. With its round-trip engineering capabilities, the Link allows users to update and write information from the ABAP Repository to the Rose model and vice versa.

Using the Link, developers can generate a UML diagram view of the relationships between new and preexisting ABAP Objects, making it easier to understand how they interact with each other and more quickly grasp the relationships and dependencies between ABAP Objects.

The Rose ABAP Link provides the following key capabilities:

  • Rapid creation of a visual model of your ABAP Objects Repository
  • Synchronization of ABAP Objects Repository and Rose models
  • Automatic highlighting of differences between UML models and ABAP Objects
  • Application of ABAP-specific object properties to an existing UML model to make it compliant with the correct ABAP properties
  • Selection of individual model/ABAP Objects items or the entire model/ABAP Objects in order to perform updates in either direction
  • Multiple selection of development classes within the browser tree
  • ABAP-specific Class Specification for viewing and editing ABAP Objects in Rose

Example 1 — Reverse-Engineering Existing Packages

The Rose ABAP Link can be used to reverse-engineer existing ABAP packages, rapidly creating a UML view of classes, interfaces, and their relations.

As an example, let’s look at the steps required to reverse engineer the Workbench Manager package (SWBM):

1. From Rational Rose, load the Rose ABAP Link, and connect to an SAP system. When prompted for a package to download, enter “SWBM”.
2. After the package has been downloaded, click the “Synchronize to Rose” arrow to populate the Rose model.
3. The Rose ABAP Link browser will appear as shown in Figure 1, indicating that both the Rose model and the ABAP Objects Repository are in synch. Minimize the Rose ABAP Link browser window.
4. From the Rational Rose model browser, drag the CL_WB_MANAGER class onto a class diagram.
5. Select the CL_WB_MANAGER class within the diagram, and from the Rose “Query” menu, select “Expand Selected Elements”. When prompted for the criteria, use the default settings and click “OK”.
6. The class diagram will now be populated with the classes related to CL_WB_MANAGER, to one level of depth.
7. To lay out the diagram more clearly, from the Rose “Format” menu, select “Layout Diagram”.
8. The Rose class diagram will now appear as in Figure 2, allowing users to see the core aspects of the SWBM package with minimal effort.

 


Figure 1 Synchronizing the ABAP Objects Repository and a Rose Model via the Rose ABAP Link

 


Figure 2 Generated Model of Existing ABAP Workbench Manager

Example 2 — Creating and Modifying ABAP Objects

Combined with Rational Rose, the Rose ABAP Link can be used to quickly create and modify ABAP classes and objects. Attributes, methods, events, exceptions, and inter-object relations can all be created and modified visually, and then batch-synchronized to an SAP system. Models created with the Rose ABAP Link can be validated based on ABAP Objects rules before synchronization, thereby reducing the load on the SAP system. Additionally, models from multiple SAP systems can be accessed simultaneously, allowing the user to view and modify remote packages side-by-side.

As an example, the steps required to create an ABAP Class with a method and relation are outlined here. First, you create the new class:

1. From Rose, download a package from an SAP system and synchronize to Rose, as in the previous example.
2. Right-click on the Rose representation of the package, and select “New” --> “Class” to create a new class.
3. Expand the “Component View” and drag the “ABAP” component onto the newly created class, to specify that this is an ABAP Object.
4. Double-click on the class to bring up the ABAP Class Specification (see Figure 3).

 


Figure 3 Creating a New Class and Specification

Then add the method:

5. Within the ABAP Class Specification, click the “Add New Method” button on the toolbar shown in Figure 3.
6. Name the method and close the ABAP Class Specification window; the method has been created.

Create the relation to other objects:

7. From the Rose model browser, drag the class onto a Rose class diagram, and drag another class from the package onto the diagram as well.
8. From the Rose class diagram toolbox (the vertical toolbar in the center), click on the “Generalization” button.
9. Click on your class, and drag the line to another class; this creates an inheritance relationship between the two classes.
10. Inheritance, and some other relation types, can be seen in Figure 4.

 


Figure 4 Class Inheritance and Other Relationships

Finally, apply these changes and synchronize them, in order to add these changes to the ABAP Objects Repository:

11. To apply these changes to the SAP system, open the Rose ABAP Link browser window, and click “Reload Rose” to update the browser with the changed model. Note that if the option “Check model for consistency before updating” is enabled (under the Options menu for the Link), then the model is validated using ABAP Objects rules.
12. Click the “Synchronize to ABAP” arrow to store the changes in the Repository. Your changes have now been added to the SAP system.

Prerequisites for Implementing the Rose ABAP Link

A free 30-day trial version of the Rose ABAP Link can be downloaded from Ensemble Systems at www.ensemble-systems.com/RoseABAP.html.

Rational Rose must be installed prior to installing the Rose ABAP Link. A free trial version of Rational Rose can be downloaded from Rational Software’s site at www.rational.com/tryit/rose/index.jsp. Other requirements include SAP R/3 Release 4.6C or SAP Web Application Server 6.10. SAP customers should also review OSS note 498 299 when working with the Rose ABAP Link.

Ensemble Systems also maintains a Rose ABAP Link FAQ, which can help you troubleshoot any problems you may encounter in setting up the link. The FAQ is available at www.ensemble-systems.com/maintenance/RoseABAP_FAQ.html.

UML Modeling for ABAP Developers — What Can It Do for You?

by Ralf Bucksch, Rational Software

“Models are abstractions that portray the essentials of a complex problem or structure by filtering out nonessential details, thus making the problem easier to understand. Abstraction is a fundamental human capability that permits us to deal with complexity. Engineers, artists, and craftsmen have built models for thousands of years to try out designs before executing them. Development of software systems should be no exception. To build complex systems, the developer must abstract different views of the system, build models using precise notations, verify that the models satisfy the requirements of the system, and gradually add detail to transform the models into an implementation.”

— Terry Quatrani, Visual Modeling with Rational Rose 2000 and UML

It is very difficult for a software team to have a unified vision of a system that is only described in specification and requirement documents. That’s where visual models come in.

Models bring about understanding of the system for all involved in a software project. Different model views can highlight specific aspects of the system (e.g., system functionality, structure, composition, behavior) to meet the needs of each responsible stakeholder. Models help you visualize a system as it is, or as you want it to be. Models help a software team communicate the vision for the system being developed, or to quickly understand the existing architecture and components.

With a clear vision of how the new software relates to the rest of the system, models also allow you to quickly change or enhance the system. You can validate your design by describing the behavior of the system for a set of scenarios, and ensure that the static structure of the system (entities and relationships) supports that behavior.

Once you have a model, you can generate class specifications, including attributes and method signatures, and use these as the starting point for coding new functionality.

Class Diagrams

Class diagrams provide the “big picture” view, which allows you to identify the major elements of the system and how they relate to one another. They show the structure (attributes and relationships between classes) and behavior (operations) of each class.

In UML, classes are represented as rectangles. Four types of relationships can be documented: association, aggregation, dependency, and inheritance.

Sequence Diagrams

Sequence diagrams describe the runtime behavior of the system. They model interactions between objects for a particular scenario. These diagrams are time ordered and show objects and messages between the objects.

As Terry Quatrani remarks in her book Visual Modeling with Rational Rose 2000 and UML, “The beauty of these diagrams is their simplicity — it is very easy to see the objects, the object interactions, the messages between the objects, and the functionality captured by the scenario.” Sequence diagrams are great when you need to understand how functionality is distributed among the objects in a system. They also allow you to validate your design by looking at how the interface of your class supports the required behavior.

Class Diagram
Sequence Diagrams

Karl Kessler joined SAP in 1992. He is the Product Manager of the ABAP Workbench and is responsible for all rollout activities. You can reach him via email at karl.kessler@sap.com.

Ron Williams is president and co-founder of Ensemble Systems, a Rational Unified Partner. Ron has worked in the software industry for 18 years as a developer, project manager, and consultant. For the past seven years, Ron has provided both technical and executive guidance in the development of enterprise systems for Ensemble’s customers, and led Ensemble’s growth to more than 90 employees. Working together with Rational and SAP, Ensemble created the Rose ABAP Link as part of its suite of tools to help accelerate development of enterprise and web-based solutions. The Rose ABAP Link can be purchased from Ensemble Systems. For more information, visit www.ensemble-systems.com or send an email to info@ensemble-systems.com.

Ralf Bucksch joined Rational Software in 1998. Ralf has worked in the software industry for 12 years as a developer, consultant, and consulting manager. He is currently Technical Lead Engineer and responsible for the introduction of modern software development processes for Rational customers and leads a team of system engineers. For more information on Rational Software and Rational Rose, contact rbucksch@rational.com.

An email has been sent to:






More from SAPinsider



COMMENTS

Please log in to post a comment.

No comments have been submitted on this article. Be the first to comment!


SAPinsider
FAQ