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

Parameters - restrict input length

Former Member
0 Likes
2,514

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.

7 REPLIES 7
Read only

sachin_mathapati
Contributor
0 Likes
1,663

HI,

Try this

PARAMETER : p_test TYPE string VISIBLE LENGTH 175.

Thanks and Regards,

Sachin M M

Read only

Former Member
0 Likes
1,663

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.

Read only

0 Likes
1,663

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.

Read only

0 Likes
1,663

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

Read only

0 Likes
1,663

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.

Read only

former_member201275
Active Contributor
0 Likes
1,663

What is the reason behind you wanting a 175 char parameter?

Read only

0 Likes
1,663

Thats a project Specific Requirement!