In the figure, the data table consists of fields (columns) of the SBOOK type and two others. You need to describe these types in the field catalog, along with the column that you want to be hidden.
Example – Adding and Changing Columns
The figure shows a semi-automatic field description. A part of the field description comes from the ABAP Dictionary structure (SBOOK) whereas another part is defined in the gt_field_cat field catalog.
Fill the field catalog (internal table) in the program and pass it on with the name of the ABAP Dictionary structure in the set_table_for_first_display method.
Ensure that the fields of the gt_bookings data table that cannot be read from the SBOOK table are also filled.
You must ensure consistency while constructing the field catalog semi automatically or manually. To perform this, press the SHIFT key and double-click with the right mouse button in an area of the ALV grid that contains no data (for example, the header).
Assignment of a Type to a Column Without Reference to a Dictionary Structure
You can use ROLLNAME to specify the data element that is used for the F1 help and the text for the column headers, selection screen, and quick information text if it is not already explicitly set.
If you have not filled the ref_field or the ref_table field, there is no adequate reference to the ABAP Dictionary. In this case, the fields allow you to format the relevant columns for output.
Formatting of Amounts for Units
Currency formatting has the following features:
Quantity formatting has the following features:
In the figure, the data table contains the price (the amount to be paid for a flight) and currency columns (currency for the contents of the price column).
Enter CURRENCY in the cfieldname field of the field catalog for the price column to ensure that contents in the price column are according to the currency specified in the currency column, for example, USD - two decimal places, JPY - no decimal places.
Output Properties of a Column
The features of different fields are as follows: