10 | Working with the SAP List Viewer
control, a control for embedding a web browser on a screen, and many others. It
is also possible to use the SAP Control Framework to design your own custom
controls based on ActiveX components, JavaBeans, or even .NET controls.
10.2 Overview of the ALV Object Model
Before we get started with our example report program, it will help to become
familiar with some of the more common elements of the ALV Object Model that
you will be working with. The example in this chapter will be using class
CL_SALV_TABLE
to represent the flight query results. This class is used to render a
simple two-dimensional table in a classical ABAP list, a GUI container on a Web
Dynpro screen, or as a full screen table display. To keep things simple, we will
accept the default full screen table display type as we design our report.
Ifyou look closely at the properties of
class
CL_SALV_TABLE,
you will notice that it
is configured with the private instantiation type. As you will recall from Chapter
4, Object Initialization and Cleanup, private instantiation implies that we cannot
create instances of class
CL_SALV_TABLE
directly using the
CREATE OBJECT
state-
ment. Instead, SAP has provided a special class method called
FACTORY
that can be
used to obtain an instance of the ALV tool. Factory methods are provided to sim-
plify the creation of objects. In the case of class
CL.SALV.TABLE,
the
FACTORY
method takes care of initializing the surrounding GUI environment, populating
data in the grid. and. perhaps most importantly, dynamically deriving the meta-
data the ALV tool needs to render the report. In the past, this metadata had to be
built by hand in a special internal table variable called a Jield catalog.
The ALV table object returned by the
FACTORY
method is fully functional and can
be displayed on the screen using the
01 SPLAY
method. However, you will usually
want to tweak various aspects of the table before you hand it over to the users. In
the ALV Object Model, these settings have been encapsulated into distinct ABAP
Objects classes. These classes mostly contain getter and setter methods that you
can use to configure various settings that affect how the table is displayed or
interacted with. The UML class diagram shown in Figure 10.2 shows some of the
common getter methods provided in class
CL_SALV_TABLE
for accessing instances
of these properly classes. For more information about the details of an individual
property class, consult the SAP online help documentation
(http://help.sap.com).
260