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.

10

ALV SALV Reporting Framework

Creating the Display Method

This method has no parameters; what you’re saying here is that when this

method is invoked, you’ve finished telling the view the specifics of how you want

the report to appear, and now is the time to show the report to the user.

Listing 10.19 is possibly the least exciting code sample in the world!

METHOD zif_bc_alv_report_view~display.

mo_alv_grid->display( ).

ENDMETHOD.

Listing 10.19 DISPLAY Method

Defining the User Command Received Event

As mentioned a few sentences ago, on ce the SALV fram ework (or whatever

framework you use) has picked up the report ball and is running with it (i.e.,

showing it to the user), the framework se nds back events to the calling program

when the user does something to the report. Your interface (which can work with

multiple UI technologies) needs to have an event of its own to pick up the event

in the form in which the given UI technology raises that event and to resend that

event in a more generic format. In this way, the calling program doesn’t need to

change when the UI technology hiding behind the interface changes.

In Figure 10.9, you can see the single event defined in the interface. The one and

possibly only event yo u can be certain of is that the user will want to click on

some part of the report output and expect something to happen in response.

Figure 10.9 View Interface: Events

The parameters that can be seen in Figure 10.10 reflect the fact that there are two

possible situations. The first situation is that the user could have clicked a button

at the top of the screen without selecting a row; in this case, parameter ED_USER_

COMMAND will be filled whereas ED_ROW and ED_COLUMN will be blank.

436

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

Saved successfully!

Ooh no, something went wrong!