Output of Exceptions 
Exceptions are a graphical means to indicate that a threshold value in a list line has been exceeded. For example, as far as the flight model is concerned, you would use the red traffic light to indicate that a flight is full. The different colors help the user to quickly understand what the data displayed means. You can use three different statuses:
Display |
Internal value |
Indicates (for example) |
|---|---|---|
|
3 |
Low occupancy |
|
2 |
Medium to high occupancy (critical: flight almost full) |
|
1 |
High occupancy (no seats available) |
Application developers must both determine the threshold values and adapt the value of an exception to the threshold.
Note
See also: Sample report BCALV_GRID_04 in development class SLIS.
Define the layout structure of type LVC_S_LAYO:
Syntax
DATA gs_layout TYPE LVC_S_LAYO.
Add a variable of type C to your output table, as shown in the following example:
Syntax
DATA: BEGIN OF GT_OUTTAB OCCURS 0. INCLUDE STRUCTURE <DDIC-Struktur>. DATA: light TYPE C. "to display exceptions DATA: END OF GT_OUTTAB.
Set field EXCP_FNAME of the layout structure to the field name of the exception:
Syntax
gs_layout-excp_fname = 'LIGHT'.
If you want to display the exception as an LED, you must set field EXCP_LED of the layout structure.
Read one row of the output table at a time in a loop, and query the fields that are related to the exception. Set your variable for the exception display format (which is LIGHT in our example) to '1', '2' or '3' (see above), depending on the threshold value you have chosen.
Pass the layout structure and the output table with method set_table_for_first_display.
Note
If you have changed the values for an exception in the output table, refresh the output using method refresh_table_display.
The ALV Grid Control contains an exception column at the beginning of the list:
