‎2011 Jan 21 10:41 AM
Hi Experts,
Might sound very basic.
I have declared a parameter of type string.
But i want the restrict the input through screen to 175 characters only.
Is this possible?
regards,
Shawn.
‎2011 Jan 21 10:47 AM
HI,
Try this
PARAMETER : p_test TYPE string VISIBLE LENGTH 175.
Thanks and Regards,
Sachin M M
‎2011 Jan 21 10:55 AM
hi,
use
PARAMETERS : p_string type string VISIBLE LENGTH 127.
and in the at selection screen event.
check the string length the user has entered.
if strlen(p_string) > 127.
display error message.
endif.
‎2011 Jan 21 11:01 AM
There is a restriction on Characters type fields on Selection screen. It accepts only 132 Characters if declared as character.
Thats the reason for declaring it as STRING data type.
This will accept upto 255 Characters but i want to restrict it to 175 & Also i DONT WANT TO DISPLAY ERROR MEESAGE.
I Just want to restrict the input beyond 175 char.
Thanks,
Shawn.
‎2011 Jan 21 11:07 AM
Hi,
If you dont want to give the Error message then best option is to give a Hint in the selection screen by saying that it will accept only 175 characters.
Then at the at selection output
get the lenth of the parameter and then pass this to a another field of length 175.
Hope this might help you.
With Regards,
Sumodh.P
‎2011 Jan 21 11:13 AM
Hi,
I wonder how something is impossible to do!
I understand the other alternatives like giving a hint or error message but i wonder why SAP is limited to do something like this.
Anyways thanks for all who gave a thought about this.
Thanks.
Shawn.
‎2011 Jan 21 12:13 PM
‎2011 Jan 21 12:48 PM