14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Computer science departments have always considered “user interface”

research to be sissy work.

—Nicholas Negroponte, founder and director of the Massachusetts

Institute of Technology’s Media Laboratory

10 ALV SALV Reporting Framework

To start Part III, which focuses on the us er interface (UI) layer, this chapter

explains how to make best use of the SALV framework to code reports that run

inside the SAP GUI. Although the SAP GUI is not particularly futuristic (quite the

opposite), the SALV framework within the SAP GUI replaced the traditional ALV

reporting framework and is still widely unfamiliar to many ABAP developers. The

good news is that the SALV framework is a technology that old-school ABAPers

find easy to get their heads around; it could be compared to Henry Ford’s “faster

horse.”

A lot of programmers hate writing reports.They feel they are boring compared to

cutting-edge new programs, and if they do have to write a report they want the

pain of doing so over as quickly as possible. The first and most obvious way of

doing this is to have a template program: When a new report is needed, you copy

the template and then insert the report-spe cific tables and retrieval logic. In the

days of procedural programming, you could isolate all repetitive ALV code in an

INCLUDE program. You could have an INCLUDE program for all the data declarations,

such as the definitions for the field catalog and sort catalog tables and so on,

and another INCLUDE for the routines, such as adding a new line to the field catalog—that

is, the routines that would alwa ys be identical if you created each program

normally. As time went on, you also started to see ALV robot types of programs

on the Internet that you could download. You ran the program and said

what your internal table would look like, and the whole program was generated

for you using the ability of SAP to use a program to create another program.

You’d think that would be the ideal so lution—but generated code tends to be

lengthy due to (for example) not encapsulating repetitive code in a routine.

407

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

Saved successfully!

Ooh no, something went wrong!