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

Function Module to convert Grams into KG

0 Likes
7,734

Hi All,

I need function Module which converts Grams into KG.

Kindly Help me if any one knows abt this funcion module.

Regards

Bhaskar

5 REPLIES 5
Read only

Former Member
0 Likes
3,697

Hi Bhaskar,

Do you think you need a FM for that?

you can simply divide by 1000 .

wt_in_kg = wt_in_gms / 1000.

If you still need an FM use this FM: UNIT_CONVERSION_SIMPLE

Sampe Usage:

Regards,

ravi

Edited by: Ravi Kanth Talagana on Feb 7, 2008 4:58 PM

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,697

If your question is not "generic", divide by 1000,

Else if you have a material number use MD_CONVERT_MATERIAL_UNIT function module.

Else use other modules like UNIT_CONVERSION_SIMPLE.

Regards

Read only

Former Member
0 Likes
3,697

U can write a simple statement ..

KG = grams/1000.

say if U have 2500 grams

KG = 2500/1000

so KG will have 2.5 ...

Read only

Former Member
0 Likes
3,697

Hi,

Divide it by 1000, abviously it will be in KGs.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
3,697

hi

good

Just use the following FM :

code 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[/code]

Hope this helps,

thanks

mrutyun^