Application Development 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: 

validation on i/o box

Former Member
0 Kudos

Dear all,

I have one i/o box in module pool pro.,

And user should be allowed to enter ALPHABETs ( A to Z)

but not the NUMBERs ( 0 to 9 ).

For this I defined the field's format as STRG in screen attributes.

But as soon as i execute the Tcode for this module pool , it gives runtime error as CONVERSION_FAILED_ERROR..

Could anybody suggest me the solution...

<<< REMOVED BY MODERATOR >>>

Please see the [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] for more informations.

Edited by: Marcelo Ramos on Nov 21, 2008 11:48 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try this.

Let it be declared as CHAR, but when writing the validation code, chk whether it contains any numbers in it.

If your i/o box name is var1.

if var1 CA '0123456789'.

<display ur msg>

endif.

Sharin.

7 REPLIES 7

Former Member
0 Kudos

Hi,

Define the field format as CHAR type

Regards,

Raju.

Former Member
0 Kudos

defining CHAR format allows Alphabets and Numbers as well.

I only want to allow Alphabets BUT NOT NUMBERS...

Former Member
0 Kudos

You can write a validation code for that problem to handle.When we use the datatypes almost all type support either character or numbet other \wise both ....so it wil be better than u can check for the presence of numbers in that entry.

Former Member
0 Kudos

Hi,

Try this.

Let it be declared as CHAR, but when writing the validation code, chk whether it contains any numbers in it.

If your i/o box name is var1.

if var1 CA '0123456789'.

<display ur msg>

endif.

Sharin.

0 Kudos

Dear Sharin,

thanks for reply..

But the solution you suggest will allow user to enter any character...( i.e. both ALPHABETS and NUMBERS )...

and then we validate in PAI...

But my requirement is " NOT ALLOWING to enter Alphabets"

Could you suggest me further soln...........

Thanks

0 Kudos

Hi,

It is not possible to restrict the user while entering the values in the i/o field itself because there is no option for that to do ....the only way we can do is to validate after user enter the values in that field....

Regards,

Rohan.

Former Member
0 Kudos

ok