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

How to enter number value in SE37 when testing function module?

immanuels
Explorer
3,795

For example if I try the ROUND function module, when I input the number value somehow it doesn't recognized as a number.

Is There anyway to test it with number value ??

Thanks

1 ACCEPTED SOLUTION
Read only

michael_piesche
Active Contributor
2,817

Simple answer, you cannot in this specific case.

The reasons are:

  • The input parameter INPUT of FM ROUND does not have a data type assigned, so it is of type ANY
  • When you want to test the FM with SE37, the "Test environment interface" implicitly assigns the character type C(200) for variables of type ANY
  • The FM ROUND only expects certain numeric(!) value types, and aborts with the above mentioned error "Use a number field for the input value" when it is not numeric

So with the SE37 test environment interface, you cannot properly test this FM. You would have to create a specific Test FM with specific numeric types for input that calls the FM ROUND in the way you want to test it.

Just a side note: SAP has done better with classes in the SE24 test environment interface, where you can choose the specific type in case of generic types. However with the SE24 test environment interface, you dont have an option to save test cases. But maybe I am outdated on new SAP standard options for saving test cases for classes (?)

3 REPLIES 3
Read only

immanuels
Explorer
0 Likes
2,817

It always shows error "Use a number field for the input value".

Read only

michael_piesche
Active Contributor
2,818

Simple answer, you cannot in this specific case.

The reasons are:

  • The input parameter INPUT of FM ROUND does not have a data type assigned, so it is of type ANY
  • When you want to test the FM with SE37, the "Test environment interface" implicitly assigns the character type C(200) for variables of type ANY
  • The FM ROUND only expects certain numeric(!) value types, and aborts with the above mentioned error "Use a number field for the input value" when it is not numeric

So with the SE37 test environment interface, you cannot properly test this FM. You would have to create a specific Test FM with specific numeric types for input that calls the FM ROUND in the way you want to test it.

Just a side note: SAP has done better with classes in the SE24 test environment interface, where you can choose the specific type in case of generic types. However with the SE24 test environment interface, you dont have an option to save test cases. But maybe I am outdated on new SAP standard options for saving test cases for classes (?)

Read only

former_member1716
Active Contributor
2,817

immanuels,

Am afraid if this function Module can be tested via SE37, as an alternative i wrote a sample program to test the FM and it works fine. Below screen shot for your reference.

Regards!