14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10

ALV SALV Reporting Framework

10.2 Designing a Report Interface

Now that you’ve defined an SALV-specifi c class and coded the program to call a

report, you’ll create an interface for the concrete class to implement. This interface

is the public API for disparate re port technologies; the calling program

knows what the report technology can give it and cares not how it’s achieved.

An interface is composed of attribute definitions and method definitions. The

attribute definition section of the interf ace contains very little (in fact, nothing)

we can include that is statically typed; each technology uses very different structures

(or objects) to get the job done. In fact, the only thing we can say for certain

is that there will always be a table of data to be displayed, and it will be defined

differently in every case.

Interface methods are supposed to be an abstract representation of tasks in a

high-level process—in this case, the pr ocess a program has to go through when

preparing and displaying a report. Therefore, in order to know what method definitions

to create, you need to think of the high-level steps (Figure 10.2) executed

by the calling program when a report is executed.

Create Container

(Optional)

Initialize

(Generic)

Application-Specific

Changes

(Specific)

Display

(Generic)

Figure 10.2 Steps in Report Execution

As you can see in Figure 10.2, there are four high-level steps executed by the program.

Once designed, the interface will re present this high-level view expressed

in SAP terms. The calling report will only know about this high-level framework.

Classes specific to each UI technology will determine how to implement each

step, thus separating the “what” from the “how to.”

Note

The designation of “Specific” or “Generic ” in parentheses in Figure 10.2 refers to

whether or not each step requires that you write unique code for an individual program.

Logically, application-specific changes must be written differently for each individual

program. All the other steps are generic, which mean they apply to every single report

you create.

414

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!