‎2012 Mar 15 6:32 AM
Hi Experts,
How do I Display an error message when the value entered for a FIELD in the SCREEN is not of the same Data type as assigned to the field????
‎2012 Mar 15 7:15 AM
Hi,
Those are handled by default. You need not worry
for example, execute this
parameters:pa type i. "Try entering a alphabet here
parameters:pa2 type p. "Try entering a symbol here
parameters:pa3 type sy-datum. "Try entering a symbol or alphabet here
‎2012 Mar 15 6:55 AM
Provide more details.
Your question is wrong as of now because the value is provided as input by the user in the screen and how does the value have a data type ?
‎2012 Mar 15 7:04 AM
Hi Kesavadas,
I have designed a screen and I have dragged and dropped fields from the Dictionary, To be specific the fields from the tables which I have CUSTOM CREATED..The Fields by default have the dictionary data type mapping from the tables.
For me, from the End- User Point of View, if the user enters a value that is not supposed to be entered in that field, LIKE SAY FOR EXAMPLE For a NAME ,I enter a NUMBER by MISTAKE.
For this kind of a scenario i need to throw an error message.
How Can I go Forward with it?
‎2012 Mar 16 1:49 PM
Well, numbers are a subset of characters, so I'm not sure what you want.
For example, if the screen field is an address, you would want to allow users to enter something like "123 Main St."
Rob
‎2012 Mar 21 8:44 AM
Hi Bharath,
You can use,
FIELD <fieldname> MODULE <modulename>. "for single field check
CHAIN .... ENDCHAIN construct "for multiple fields in PAI
and write logic in <modulename> to check whether the input is correct format or not like
if fieldname co '0123456789' "syntax for checking if a field value contains only numbers
Hope this helps,
Regards,
Ravi
‎2012 Mar 15 7:15 AM
Hi,
Those are handled by default. You need not worry
for example, execute this
parameters:pa type i. "Try entering a alphabet here
parameters:pa2 type p. "Try entering a symbol here
parameters:pa3 type sy-datum. "Try entering a symbol or alphabet here
‎2012 Mar 20 11:31 AM
Hi,
For data types I, P and D and some others you will get a standard message,
to handle the Char type data validation use
Ex: CA contains any, NA contains not any...
if the screen field is v_matnr and supposed enter only character and type of Char....
If v-matnr CA 'numbers'.
i hope you may try the logic with existing classes like CL_ABAP_CHAR_UTILITIES.
Hope the info would help you..