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.

Designing a Report Interface 10.2

왘 Whether the column is to be displayed as an icon (technically, this is a push button,

because you “push” it by clicking it, and something happens as a result).

왘 Whether the contents of the column can be subtotaled. Obviously, this only

makes sense for numeric fields, but you don’t want it active for all numeric

fields by default. Some numeric fields should not be subtotaled (e.g., averages,

unit rates, etc.).

왘 Whether the column is to have a different column heading than the one that

the SAP system would normally propose based upon the data element used in

the definition of the field in question. In later technologies, you also have a

tooltip, which is a little box that appears when the user hovers their cursor over

the column heading to give a lengthier explanation of what the column contents

represent.

Figure 10.7 Set Column Attributes Method Parameters

Listing 10.8 called the SET_COLUMN_ATTRIBUTES method several times, exporting

the name of each report output column whose nature needed to be modified in

some way. For each call, in addition to the column name, the code also exported

one or more of the optional parameters , depending on what exactly it was that

needed to be changed. Tech nically, the way the SALV class modifies report columns

is quite different, depending on what’s being changed, but the calling

report doesn’t need to know or worry about that.

Listing 10.9 shows the entire code of the SET_COLUMN_ATTRIBUTES method. You

will see that this doesn’t do anything dramatic; it just delegates the various types

of requested tasks to helper methods. (The helper methods are discussed next, so

you can see how exactly the SALV class accomplishes each task.)

427

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

Saved successfully!

Ooh no, something went wrong!