Tuesday, October 16, 2012

How to use Function Module ‘UNIT_CONVERSION_SIMPLE’ for conversions

 ‘UNIT_CONVERSION_SIMPLE’ is a useful function module for doing simple unit conversions. The simple units are ones we use in modern date measurements. The function module comes under the function group SCVO and has documentation attached for help.

The function module makes use of the function module UNIT_CONVERSION_SIMPLE_OLD.

There are 3 important things that one should remember before using this function module
1. The units that needs to be converted needs to be maintained in Table T006.Usually most of them are provided in same by SAP
2. The Measurement that needs to be converted should be either float, packed decimal or integer. If not error would be passed.
 3. If you test the function module from SE37, you are likely to receive the following error as shown. This is because the input field is recognized as character instead of integer. This is one error that for some reason, SAP has not done any correction yet. But for testing the function module, you can make use of the sample program provided in the function module documentation .You need to declare the input and output variables as float, packed decimal or integer. The Rounding sign is used if needed.

You can also see the sample program as shown in below link for same.

1 comment:

  1. Very nice blog! Just a hint: take out some of these ads,man. It scares people away (Specially the ones between page transitions).