|
How To Convert Base Units Into Target
Units In BW Reports
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.
Tips by : Sujith Nair
Fast Links:
Get help for your SAP BW problems
Do you have
a SAP BW Question?
SAP Books
SAP Certification, Interview
Questions, Functional, Basis Administration and ABAP Programming Reference
Books
SAP BW Tips
SAP BW Tips and Business Information
Warehouse Discussion Forum
Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com
All the site contents are Copyright © www.sap-img.com
and the content authors. All rights reserved.
All product names are trademarks of their respective
companies. The site www.sap-img.com is in no way affiliated with
SAP AG.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
The content on this site may not be reproduced
or redistributed without the express written permission of
www.sap-img.com or the content authors.
|