When you have a field that contains an amount, for example net value of an sales order, then in order to show it correctly in the grid you should fill or this field with an value of currency key (one of ...
... a type EXCHANGE_RATES.
CLASS lcl_exchange_rates DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF currency,
currency_name TYPE string,
unit TYPE string, ...
... each unit or currency separately. In other case the values will be summarized without taking in consideration differences in the units.
Figure 64 ZDEMO_AIN_CL27 DO_SUM set for DISTANCE ...
CFIELDNAME can be read as currency field name. When you have in your internal table a field that represents the currency for the amount stored in a field kept under FIELDNAME in field catalog, then you ...
QUANTITY field is very similar to CURRENCY. The difference here is that you don’t keep currency key here, but unit of measure, for example M for meters or KG for kilograms. Again to show you the difference ...
...
1400
N
CURR field produced without CURRENCY Addition
UOM_IN_MES
CL_CI_TEST_EXTENDED_CHECK
1401
N
UNIT field produced without UNIT addition
UOM_IN_MES ...
...
data: m_p(16) type p.
data: mo_type type ref to cl_abap_elemdescr.
data: m_format type cabn-atfor.
data: m_currency type rctmv-waers.
data: m_atinn type api_vali-atinn.
data: m_objectkey type bapi1003_key-object. ...
...
data: m_p(16) type p.
data: mo_type type ref to cl_abap_elemdescr.
data: m_format type cabn-atfor.
data: m_currency type rctmv-waers.
if c_data is initial.
raise no_data_to_change. ...
...
type any,
type api_vali.
data: m_p(16) type p.
data: mo_type type ref to cl_abap_elemdescr.
data: m_format type cabn-atfor.
data: m_currency type rctmv-waers. ...
... my reference data structure to bapi tables (in order to save it) - method to save characteristic value - method to convert values from standard type (date, char, number, currency) to characteristic value ...
... to get the type of the field (needed for proper conversion) and FM KKEK_CONVERT_FLOAT_TO_CURR to convert currency values stored as float on database into currency fields. Importing: i_object type bapi1003_key-object -> ...