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.

Designing a Report Interface 10.2

Figure 10.10 User Command Received Event Parameters

However, the more common situation is that the user double-clicks a specific cell

in the report. In this case, parameters ED_ROW and ED_COLUMN will be filled with the

coordinates of the cell that was clicked on and ED_USER_COMMAND will be filled with

a system generated constant; it’s the wittily named &IC1, which is the value the

SAP system automatically sets when a user double-clicks something. In this case,

the row number and column number become vitally important so that the part of

the program that deals with the user action can know exactly what the user wants

dealt with (e.g., which sales order—or monster—to display).

Note that this is not about responding to what the user has done; this is just about

broadcasting the fact that the user ha s done something. The problem of how to

respond to that something is the responsibility of another part of the program.

The view is ideally placed to recogniz e such an event, because only the view

knows exactly what the screen looks like and what technology is being used to

interact with the user. Once the view has raised such an event, its work here is

done.

As mentioned earlier, it’s not the job of the view to respond to any commands the

user makes; its job is to pass the inform ation about what the user just did on to

the parts of the program best suited to deciding what the proper response should

be. Half the articles on MV C say the view should talk directly to the model, and

half say the view and the model should know nothing about each other and only

communicate via the controller. In the latter case, it becomes easy to replace the

view without affecting the model (e.g., when a new user interface technology

comes along) and likewise to use the same view for various similar models (e.g.,

you have lots of different models for approving various things, like leave requests

and purchase orders, and you want them all to have the same look and feel, so

you use the same view each time).

437

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

Saved successfully!

Ooh no, something went wrong!