2014 Mar 25 7:50 AM
What is the function module for converting weight unit to another unit.
I want to convert LB to KG.
Tried with fm UNIT_CONVERSION_SIMPLE.
INPUT 100
NO_TYPE_CHECK
ROUND_SIGN X
UNIT_IN LB
UNIT_OUT KG
But there is no output.
Can some one help.
2014 Mar 25 8:04 AM
This code is working fine for me..
DATA: a TYPE i VALUE 10,
b type i.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = a
UNIT_IN = 'LB'
UNIT_OUT = 'KG'
IMPORTING
OUTPUT = b
.
WRITE b.
2014 Mar 25 8:04 AM
This code is working fine for me..
DATA: a TYPE i VALUE 10,
b type i.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = a
UNIT_IN = 'LB'
UNIT_OUT = 'KG'
IMPORTING
OUTPUT = b
.
WRITE b.
2014 Mar 25 8:06 AM
The trick here is we need decalre input output with non-character data type like VBPLK-BRGEW.
We can test using normal SE37.
I tested and this program worked fine:
data: UNIT_IN LIKE T006-MSEHI,
UNIT_OUT LIKE T006-MSEHI,
output LIKE VBPLK-BRGEW,
input LIKE VBPLK-BRGEW.
input = 10.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = INPUT
UNIT_IN = 'LB' "UNIT_IN
UNIT_OUT = 'KG' "UNIT_OUT
IMPORTING
OUTPUT = OUTPUT.
write: output.
2014 Mar 25 8:10 AM
2014 Mar 25 8:11 AM
hi suresh,
yes , this is strange while executing in se37 there is no output but while executing in report the values are comming correctly.
2014 Mar 25 8:14 AM
This is not strange actually if you look closely in your program you are passing typed parameters to the FM which you are not doing in Se37
Nabheet
2014 Mar 25 8:17 AM