Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reg: Conversion for quantity

Former Member
0 Likes
1,023

Hi All,

I need to convert the quantity to KG ,i have the two function modules 1)UNIT_CONVERSION_SIMPLE 2)CF_UT_UNIT_CONVERSION,can u guys help me out in conversion process in detail..i need to convert to this field VBRP-FKIMG ( Convert into KG using VBRP-VRKME )

with regards,

sumanth reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
791

Hi,

Check it

CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'

EXPORTING

INPUT = "enter the value to be converted eg: lv_input

UNIT_IN = ' ' "enter the unit which is at present eg. 'LB'

UNIT_OUT = ' ' "enter the unit to which you want to covert eg. 'KG'

IMPORTING

OUTPUT = "displays the converted value eg: lv_output

  • 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.

write:/ lv_output

regards,

John

4 REPLIES 4
Read only

Former Member
0 Likes
791

Hi Sumanth,

Try using FM MATERIAL_UNIT_CONVERSION.

Regards,

Suresh.D

Read only

0 Likes
791

hii suresh,

can u pass the field into the fm ,plz let me know

with regards,

sumanth reddy

Read only

Former Member
0 Likes
792

Hi,

Check it

CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'

EXPORTING

INPUT = "enter the value to be converted eg: lv_input

UNIT_IN = ' ' "enter the unit which is at present eg. 'LB'

UNIT_OUT = ' ' "enter the unit to which you want to covert eg. 'KG'

IMPORTING

OUTPUT = "displays the converted value eg: lv_output

  • 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.

write:/ lv_output

regards,

John

Read only

Former Member
0 Likes
791

Hi ,

use the FM 'CF_UT_UNIT_CONVERSION'. Below is a sample code i had used for one of my development.

V_QUANTITY = WA_RESB-BDMNG .

CALL FUNCTION 'CF_UT_UNIT_CONVERSION'

EXPORTING

MATNR_IMP = WA_RESB-MATNR "Material number

MEINS_IMP = WA_RESB-MEINS "Material base unit of measure

UNIT_NEW_IMP = WA_MARM-MEINH "New unit

UNIT_OLD_IMP = WA_RESB-MEINS "Old unit

VALUE_OLD_IMP = V_QUANTITY "Old value

IMPORTING

VALUE_NEW_EXP = V_QUANTITY "New value

EXCEPTIONS

OVERFLOW = 1

OTHERS = 2

.

hope it helps.

Regards

Amarendra