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 on string variable

Former Member
0 Likes
391

hi friends,

i have a parameter (var1) which is declared as String .now i want a function module which will not allow any other datatype otherthan number (type N) to be entered in that variable.is there any function module like that?would appreciate if u help me.

thanks and regards,

kanti

2 REPLIES 2
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
350

Hi,

You can create a function module by copying this function module and have the paramter type as you want and then you can check the type of the incoming variable using the utility method in the class

CL_ABAP_TYPEDESCR and the method is describe by data this will give you the type of the paramter then check if the type you want is the type you are getting in the FM and raise an exception if it is not.

Regards,

Sesh

Read only

uwe_schieferstein
Active Contributor
0 Likes
350

Hello Kanti

The function module you are looking for is <b>NUMERIC_CHECK</b>.

Regards

Uwe