My client has a requirement to convert the base units of measurements into target units of measurements in BW reports. How to write the conversion routine and otherwise pls refer conversion routine used so that the characteristic value(key) of an infoobject can be displayed or used in a different format to how they are stored in the database.
Have a look at the how to document "HOWTO_ALTERNATE_UOM2"
or
You can use the function module 'UNIT_CONVERSION_SIMPLE'
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = ACTUAL QUANTITY
* NO_TYPE_CHECK = 'X'
* ROUND_SIGN = ' '
unit_in = ACTUAL UOM
unit_out = 'KG' ( UOM YOU WANT TO CONVERY )
IMPORTING
* ADD_CONST =
* DECIMALS =
* DENOMINATOR =
* NUMERATOR =
output = w_output-h_qtyin_kg
* 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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
No comments:
Post a Comment