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: 

select-options

Former Member
0 Kudos
358

Hi,

Can anybody tell me how to do the program using select-options or parameters for following scenario.

I want to search for all Vendor name's which starts with A or any alphabet using select-options and parameters dynamically. Please provide me code also.

I have written something like this : -

<b>select-options name for lfa1-name1.

select * from lfa1 where name1 in name.

write : /lfa1-lifnr, lfa1-name1.

endselect</b>.

In the selection screen (In select-options) if i enter something like a% (low range) and h% (high range). It is not displaying any names.

I don't know whether the code given by me correct or wrong. Please help me.

Thanks,

Sriram.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
180

On the selection screen enter a. Press the right arrow beside this and enter b below the first entry.

LFA1-NAME1 is case sensitive. It would be better to select against LFA1-MCOD1, which is LFA1-NAME1 shortened from 35 to 25 characters and translated to upper case.

Rob

Message was edited by: Rob Burbank

9 REPLIES 9

Former Member
0 Kudos
181

On the selection screen enter a. Press the right arrow beside this and enter b below the first entry.

LFA1-NAME1 is case sensitive. It would be better to select against LFA1-MCOD1, which is LFA1-NAME1 shortened from 35 to 25 characters and translated to upper case.

Rob

Message was edited by: Rob Burbank

0 Kudos
180

Sriram,

I see that the SELECT statement you have coded has IN keyword instead of LIKE.

Try entering a% and then do a SELECT * from lfa1 where lifne like name.

Hope this helps. If not get back to me I will give you another solution.

0 Kudos
180

Hi Rob,

Thanks very much, my problem was solved.

Thanks,

Sriram.

0 Kudos
180

You're welcome Sriram. Glad to help.

Rob

0 Kudos
180

Hi,

The field contains value "Sap" and I entered "sap" in the parameter. It's not displaying the result.

Former Member
0 Kudos
180

Name1 is a text field and the reason why it is failing is that the text should match exactly, if you entered some name in the selection screen. Also check if the domain of lfa-name1 is case-sensitive or not. If it is case sensitive, then you should match the case also.

Srinivas

Former Member
0 Kudos
180

Hi Sri,

I thonk Rob is right, lfa1-name1 is case sensitive so you must enter the values in accordance with the values in the DB.

Instead of this you may use translate command to chnage the case of entered values in lfa1-name1 to upper case this will give flexibility to user to enter in any case.

Hope this wil sort out the problem.

Cheers

Amit

Former Member
0 Kudos
180

hi,

try with this

define one ranges r1 like lfa1-name1

data : l1 type c,

l2 type c.

r1[] = name[].

loop at r1.

l1 = r1-low+0(1).

l2 = r1-high+0(1).

if l1 <> 'a'

r1-low = ''.

endif.

if l2 <> 'a'

r1-high = ''.

endif.

if r1-low = '' and r1-high = ''.

delete r1.

else

modify r1.

endif.

endloop.

select * from lfa1 where name1 in r1

cheers,

sasi

jayanthi_jayaraman
Active Contributor
0 Kudos
180

Hi,

Check this.It also discusses similar issue.

Kindly reward points by clicking the star on the left of reply,if it is useful.