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

Problems testing/using UNIT_CONVERSION_SIMPLE

Former Member
0 Likes
13,588

I am trying to use UNIT_CONVERSION_SIMPLE to convert units. The units I have tested all belong to the VOLUME Dimension. I have tried the following:

Input = 100.00

No_type_check = 'X'

round_Sign = ' '

unit_in = '4G'

unit_out = 'CCM'

When I execute that it gives me an error saying: "Specify at least 1 unit".

I then debugged and found that it is, for some reason, clearing the unit_in and unit_out parameters as soon as you execute. If I debug and reenter the units it says that my input (100.00) is of type C.

I have no idea why either of these things are happening. I am using the FM test tool.

Any ideas?

Regards,

Davis

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
5,794

Hi

CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
        EXPORTING
          input                = ekpo-ntgew   " input amount
          unit_in              = ekpo-meins  " unit in which it is now 
          unit_out             = 'KG'            " unit u want to change
        IMPORTING
          output               = ekpo-ntgew   " result in new unit
        EXCEPTIONS 
          conversion_not_found = 01
          overflow             = 02
          OTHERS               = 03.
      menge_floating = ekpo-ntgew * h_menge.

6 REPLIES 6
Read only

former_member156446
Active Contributor
0 Likes
5,795

Hi

CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
        EXPORTING
          input                = ekpo-ntgew   " input amount
          unit_in              = ekpo-meins  " unit in which it is now 
          unit_out             = 'KG'            " unit u want to change
        IMPORTING
          output               = ekpo-ntgew   " result in new unit
        EXCEPTIONS 
          conversion_not_found = 01
          overflow             = 02
          OTHERS               = 03.
      menge_floating = ekpo-ntgew * h_menge.

Read only

0 Likes
5,794

J@y, I misspoke. Here is the updated issue. I realized that the first issue was because I wasn't using the technical names. it is, however, still thinking that any value is of type C.

I am trying to use UNIT_CONVERSION_SIMPLE to convert units. The units I have tested all belong to the VOLUME Dimension. I have tried the following:

Input = 100.00

No_type_check = 'X'

round_Sign = ' '

unit_in = 'M3'

unit_out = 'CM3'

If I debug and reenter the units it says that my input (100.00) is of type C.

I have no idea why this is happening. I am using the FM test tool.

Any ideas?

Regards,

Davis

Read only

0 Likes
5,794

Hi Davis

when I check in ECC6.0 unit CM3 is not created in EN is the error I am getting in table T006. Check may be thats the reason you are unable to convert the value

Read only

0 Likes
5,794

CM3 is the technical name (CCM is in T006). You can see CM3 by using table T006a or T006b.

Regards,

Davis

Read only

0 Likes
5,794

The easiest way to avoid this is to not use the test tool for import fields that are numeric.

You need to write a quick sample program and pass a numeric (type i, f, p) value to the parameter.

Read only

0 Likes
5,794

Bryan,

Thanks, I just did that and tested it. I have never seen an instance where the test tool couldn't be used so I wasn't sure if it was the tool or not.

Thanks,

Davis