ABAP--调用SAP的单位转换函数进行单位转换

report Zrsbzme10 .
parameters: p_In(10) type c,
            unit_in  like t006-msehi default 'M',
            unit_out like t006-msehi default 'MM',
            round(1) type c          default 'X'.
data: result type p decimals 3,
      input  type p decimals 3.
input   =  p_IN.
call function 'UNIT_CONVERSION_SIMPLE'
     exporting
          input                = input
          round_sign           = round
          unit_in              = unit_in
          unit_out             = unit_out
     importing
          output               = result
     exceptions
          conversion_not_found = 01
          division_by_zero     = 02
          input_invalid        = 03
          output_invalid       = 04
          overflow             = 05
          units_missing        = 06
          unit_in_not_found    = 07
          unit_out_not_found   = 08.
write: 'Result: ',result.
 

你可能感兴趣的:(ABAP--调用SAP的单位转换函数进行单位转换)