2008 Nov 07 7:33 PM
Hi Gurus,
Can anybody please tell me the table or FM in which we can get the covertions from one UOM to other.
Thanks & Regards,
Vijaya.
2008 Nov 07 9:24 PM
Hi Gurus,
please dont feel that i am expecting spoon feeding,
i have tried with below code but i am unable to get the
convertions,please advice me...
DATA: VALUE_IN TYPE F VALUE '10.000',
VALUE_OUT TYPE F,
UNIT_IN LIKE T006-MSEHI VALUE 'GLL',
UNIT_OUT LIKE T006-MSEHI VALUE 'LB'.
...----
CLEAR VALUE_OUT.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = VALUE_IN
UNIT_IN = UNIT_IN
UNIT_OUT = UNIT_OUT
IMPORTING
OUTPUT = VALUE_OUT
EXCEPTIONS
CONVERSION_NOT_FOUND = 01
DIVISION_BY_ZERO = 02
INPUT_INVALID = 03
OVERFLOW = 04
OUTPUT_INVALID = 05
UNITS_MISSING = 06
UNIT_IN_NOT_FOUND = 07
UNIT_OUT_NOT_FOUND = 08.
IF SY-SUBRC = 0.
WRITE:/ VALUE_OUT.
ENDIF.
-
Thanks & Regards,
Vijaya.
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.
Example
2008 Nov 07 7:38 PM
2008 Nov 07 7:52 PM
Hi Senthil,
Thank you,but could you please show me the output with any one example (any conversion),since i have tried this but i am unable to do convertions,
below is the input req for respective FM
Import parameters Value
INPUT
NO_TYPE_CHECK X
ROUND_SIGN
UNIT_IN
UNIT_OUT
2008 Nov 07 7:45 PM
Hi Vijaya,
Check out the Function Module:
CIF_GEN_CONVERT_BASE_UOM
Thanks,
Chidanand
2008 Nov 07 7:51 PM
2008 Nov 07 7:54 PM
Hi, the conversion should not be material specific..
please advice me
Thanks & Regards,
Vijaya.
2008 Nov 08 5:18 AM
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.
Example
2008 Nov 07 7:54 PM
[You can use the function module 'UNIT_CONVERSION_SIMPLE' |http://www.sap-img.com/business/how-to-convert-base-units-into-target-units-in-bw-reports.htm]
2008 Nov 07 8:01 PM
jay....
could you please provide me a simple example..
Thanks & Regards,
Vijaya.
2008 Nov 07 8:04 PM
Hi Vijaya,
Jay has given you a link for example. Moreover the FM is self explanatory and very easy to understand. Jus see the parameters
EXPORTING
input
unit_in
unit_out
IMPORTING
output
Would you unable to make it out from this ?
2008 Nov 07 8:05 PM
in the link above its clearly explained in words..
anyways check this
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = L_KBEDM
UNIT_IN = T_ZCKA-KAPEH
UNIT_OUT = CON-MEINS_TIM
IMPORTING
OUTPUT = L_KBEDM
EXCEPTIONS
OTHERS = 1.CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = L_MENGE
UNIT_IN = L_MEINS
UNIT_OUT = ZCBS-VOLEH
IMPORTING
OUTPUT = L_MENGE
EXCEPTIONS
OTHERS = 1.
2008 Nov 07 9:24 PM
Hi Gurus,
please dont feel that i am expecting spoon feeding,
i have tried with below code but i am unable to get the
convertions,please advice me...
DATA: VALUE_IN TYPE F VALUE '10.000',
VALUE_OUT TYPE F,
UNIT_IN LIKE T006-MSEHI VALUE 'GLL',
UNIT_OUT LIKE T006-MSEHI VALUE 'LB'.
...----
CLEAR VALUE_OUT.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = VALUE_IN
UNIT_IN = UNIT_IN
UNIT_OUT = UNIT_OUT
IMPORTING
OUTPUT = VALUE_OUT
EXCEPTIONS
CONVERSION_NOT_FOUND = 01
DIVISION_BY_ZERO = 02
INPUT_INVALID = 03
OVERFLOW = 04
OUTPUT_INVALID = 05
UNITS_MISSING = 06
UNIT_IN_NOT_FOUND = 07
UNIT_OUT_NOT_FOUND = 08.
IF SY-SUBRC = 0.
WRITE:/ VALUE_OUT.
ENDIF.
-
Thanks & Regards,
Vijaya.
2008 Nov 07 9:32 PM
DATA: VALUE_IN TYPE F VALUE '10.000',
VALUE_OUT TYPE F,
UNIT_IN LIKE T006-MSEHI VALUE 'GLL', " change it to KG
UNIT_OUT LIKE T006-MSEHI VALUE 'LB'.convertion can be done from same unit type weight to weight ... length to lenght etc..
are you sure you want to use type F for input amount? you can find some FM's which change the Floating type values to normal format.
2008 Nov 07 9:41 PM
Jay..
i have done that i mean changed to KG but still the same..
no o/p and regarding Floating type values,plz read the FM
documentation it is expecting a floating point...
please advice me...
Thanks & Regards,
Vijaya.
2008 Nov 07 9:46 PM
In Ecc 5.0 the input is of format blank.. so you can use any type.
I executed the code and it works fine for me:
DATA: value_in TYPE p VALUE '1',
value_out TYPE p DECIMALS 3,
unit_in LIKE t006-msehi VALUE 'KG',
unit_out LIKE t006-msehi VALUE 'LB'.
CLEAR value_out.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = value_in
unit_in = unit_in
unit_out = unit_out
IMPORTING
output = value_out
EXCEPTIONS
conversion_not_found = 01
division_by_zero = 02
input_invalid = 03
overflow = 04
output_invalid = 05
units_missing = 06
unit_in_not_found = 07
unit_out_not_found = 08.output: 2.205I used http://www.convertunits.com/from/kg/to/lb to check...
2008 Nov 07 10:13 PM
my VPN disconnected, any way i will try this,
but i am working in version 4.7 lets see does it workout or not?
but anyway thankyou..... very much... jay...
i will update you on the same...
Thanks & Regards,
Vijaya.
2008 Nov 07 10:29 PM
Jay's code works well in 4.7 (but gives a slightly different answer: 2.200).
Rob
2008 Nov 08 10:52 AM
Jay...
Its Working thankyou verymuch.
Thanks & Regards,
Vijaya.
2008 Nov 08 5:35 AM
hi,
you can go through MM03->basic view .On the application tool bar "additional data" button will be there. click on this, you will see a new screen with different tabs. select "Units of Measure".
here you can see the alternative UOM for each material.
You can also check MARM table.
the same values are stored in MARM table.
Cheers,
JP
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |