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

UNIT_CONVERSION_SIMPLE FM

Former Member
0 Likes
3,427


Hi Gurus,

I am working on something and need to validate a above mentioned FM.

I don't know what values should I pass to test it in SE37.

Can someone please help?

Regards

Shirley

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
2,235

The quantity in KG

4 REPLIES 4
Read only

FredericGirod
Active Contributor
0 Likes
2,236

The quantity in KG

Read only

0 Likes
2,235

I did that but did not get any values...I am assuming that If I enter '1' in INPUT and  KG in UNIT_IN and LB in UNIT_OUT, I should get 2.20462 when I hit Test..am I wrong somewhere?

Read only

0 Likes
2,235

Hi Shirley,

There is an interesting reason for this issue - as INPUT parameter is un-typed, SE37 creates and processes it as a character-like value.

Inside the function module there is a call of 'UNIT_CONVERSION_SIMPLE_OLD' FM. It contains the following code:


DESCRIBE FIELD input   TYPE lv_type       DECIMALS lv_decimals.

  IF  lv_type <> 'F'                                      

AND lv_type <> 'P'  

  AND lv_type <> 'I'. 

MESSAGE e310 WITH 'INPUT' RAISING input_invalid.

ENDIF.

Since a determined type is 'C' (because of SE37!), you are unlikely to get any result from this function module.

So I suggest to create a simple test program which passes a correctly typed input parameter to check the unit conversion.

Cheers,
Kirill

Read only

0 Likes
2,235

There are many function, maybe try this one : MD_CONVERT_MATERIAL_UNIT

regards

Fred