05-29-2008 10:31 PM
HI all,
Is there any function module to convert from
grams to kg and
milligrams to kg and
kg to grams etc.
05-29-2008 10:42 PM
05-29-2008 10:45 PM
Hi,
Check this
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = slk-btgew " Weight in LB
unit_in = slk-gewei " LB
unit_out = vttkvb-dtmeg " KG
IMPORTING
output = slk-btgew. " Output : Weight in KG
05-29-2008 10:57 PM
HI Raj,
I have tried this logic. but not working. can you please check it once and let me know.. please
data: begin of itab occurs 0,
matnr like marm-matnr,
gewei like marm-gewei,
end of itab.
select matnr
gewei
from marm
into table itab
where matnr = '8435448'.
data: v_meins type c.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = '102345.6'
NO_TYPE_CHECK = 'X'
ROUND_SIGN = ' '
UNIT_IN = itab-gewei
UNIT_OUT = vttkvb-dtmeg
IMPORTING
ADD_CONST =
DECIMALS =
DENOMINATOR =
NUMERATOR =
OUTPUT = v_meins
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.
write: v_meins.
Iam very thank full to you..
05-29-2008 11:43 PM
Hi Mahaboob,
Try this
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
I_MATNR = MATNRIAL
I_IN_ME = IN_MEINS
I_OUT_ME = OUT_MEINS
I_MENGE = IN_MENGE
IMPORTING
E_MENGE = OUT_MENGE
EXCEPTIONS
ERROR_IN_APPLICATION = 1
ERROR = 2
OTHERS = 3.
05-29-2008 11:50 PM
here is a solution for ur problem
try this function module.....and ur problem /..................solved
MATERIAL_UNIT_CONVERSION
08-19-2008 5:31 PM