Value Display with Currency/Quantity Unit
Use
Certain values of output fields may refer to units (such as kilogram) or currencies (such as Euro). To display these values in the correct unit-specific format (with the correct number of digits after the comma, for example), you must assign these fields to a currency or unit. There are three ways how you can do this in the field catalog:
- Assign a value field to an associated currency or unit field
- Explicitly specify a currency or unit for the entire column
- Format the value field manually (see: Formatting Column Contents)
Reference to a Currency or Unit Field
You use fields CFIELDNAME and QFIELDNAME (see below) to assign value fields to a currency or unit field. This ensures that when totals are calculated for this column, these are displayed separately by unit.
The field catalog also contains an entry for the unit field. If you do not want to display the unit as a column in the list and do not want to allow users to interactively show it as a column, you can mark the field catalog entry for the unit field as a technical field by setting field TECH . This makes sense, for example, if the unit is always unique and therefore explicitly output in the list header by the caller.
For initial value or currency fields, you must consider the following points:
Totals calculation and display of value fields
Value of unit field | |||
not initial | initial | ||
Value of value field | not initial | Unit-specific display of digits after the comma in the list and in the totals | For such cells, ALV introduces the unit SPACE . In the totals display, this unit is given as a separate unit. |
initial | Unit-specific output as '0' (provided field NO_ZERO of the field catalog is initial). When calculating totals, the ALV uses the value '0' and the unit specified. | Output as SPACE . The value field is ignored when the totals are calculated. |
Value or Unit for the Entire Column
For fields that use the same quantity or currency unit for all column values, the field catalog contains fields CURRENCY and QUANTITY (see below). You use these fields to determine a unit for your value field (such as USD or KG ). This makes sense, for example, if there is only one unit or currency for the entire column (which has been entered by the user, for example). In this case, the output table does not need any additional fields.
Prerequisites
For the value field, you must consider the following points:
- The field is of ABAP data type P (see also INTTYPE in Parameters for Fields Without DDIC Reference).
- There is one field in the internal output table that contains the associated unit.
Relevant Fields in the Field Catalog
Field name | Comp. type | Dtype(length) | Value range |
Use | |||
CFIELDNAME | LVC_CFNAME | Char(30) | SPACE, name of a field in the output tablee |
Defining a reference to currency units. The ALV links the field specified in FIELDNAME to the field for currency units specified in CFIELDNAME . The field specified in CFIELDNAME must have a separate entry in the field catalog. | |||
CURRENCY | LVC_CURR | Char(5) | SPACE, name of a currency |
Explicitly specifying a currency (such as DEM , USD ). The ALV displays the values for the column specified in FIELDNAME according to the conventions for this currency. | |||
QFIELDNAME | LVC_QFNAME | Char(30) | SPACE, name of a field in the output table |
Defining a reference to quantity units. The ALV links the field specified in FIELDNAME to the field for quantity units specified in QFIELDNAME . The field specified in QFIELDNAME must have a separate entry in the field catalog. | |||
QUANTITY | LVC_QUAN | Char(3) | SPACE, name of a unit |
Explicitly specifying a unit (such as KG ). The ALV displays the values for the column specified in FIELDNAME according to the conventions for this unit. |
Comments
<a href="http://newandusedcateringequipment.com.au/cake-displays.html>Display Units</a>
Cold Food Displays