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

How to specify size for a parameter variable with user-command? Help!

gopalkrishna_baliga
Participant
0 Likes
484

Hi Experts,

I have a selection screen where I want to display a dropdown. On change of this dropdown I have to perform certain actions.

I have declared the dropdown as:

PARAMETERS: p_soldto as listbox VISIBLE LENGTH 30 user-command chg

But with the above declaration the p_soldto has always 1 character value. In other words if my dropdown has 10 items, where Each item has a key like 1, 2...upto 10.

On selection of last item (key 10), the p_soldto shows 1 instead of 10. This is because the p_soldto has been declared without any size.

If I try to give size as:

PARAMETERS: p_soldto(20) as listbox VISIBLE LENGTH 30 user-command chg

Then, this gives error saying size cannot be specified when user-command is used.

What shall I do? How do specify size along with user-command? Please help! I am really lost. This is really ridiculous of SAP.

Kindly help

Thanks

Gopal

Message was edited by: gopalkrishna baliga

3 REPLIES 3
Read only

Former Member
0 Likes
410

why dont you declare it as

p_soldto type char30 as listbox VISIBLE LENGTH 30 user-command chg

this should solve your problem

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
410

You can use the length specification, but you need to use the TYPE C also.

PARAMETERS: p_soldto<b>(20) type c</b> as listbox VISIBLE LENGTH 30 user-command chg.

Regards,

Rich Heilman

Read only

anversha_s
Active Contributor
0 Likes
410

hi,

try this

PARAMETERS: p_soldto(10) type c as listbox VISIBLE LENGTH 30 user-command chg

rgds

anver