Code: Alles auswählen.
DATA: lv_out TYPE string,
lv_ntgew TYPE ntgew,
lv_sap_code_in TYPE msehi,
lv_sap_code_out TYPE msehi.
lv_ntgew = '1200'.
CALL FUNCTION:
'UNIT_OF_MEASURE_ISO_TO_SAP'
EXPORTING
iso_code = 'GRM'
IMPORTING
sap_code = lv_sap_code_in,
'UNIT_OF_MEASURE_ISO_TO_SAP'
EXPORTING
iso_code = 'KGM'
IMPORTING
sap_code = lv_sap_code_out,
'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = lv_ntgew
unit_in = lv_sap_code_in
unit_out = lv_sap_code_out
IMPORTING
output = lv_out
EXCEPTIONS
conversion_not_found = 1
division_by_zero = 2
input_invalid = 3
output_invalid = 4
overflow = 5
type_invalid = 6
units_missing = 7
unit_in_not_found = 8
unit_out_not_found = 9
OTHERS = 10.
IF sy-subrc = 0.
WRITE lv_out.
ELSE.
WRITE sy-subrc.
ENDIF.