2005 Sep 20 10:23 PM
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.
2005 Sep 20 10:38 PM
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
2005 Sep 20 10:38 PM
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
2005 Sep 20 11:13 PM
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.
2005 Sep 21 8:11 PM
Hi Rob,
Thanks very much, my problem was solved.
Thanks,
Sriram.
2005 Sep 21 8:26 PM
2008 Oct 21 3:26 AM
Hi,
The field contains value "Sap" and I entered "sap" in the parameter. It's not displaying the result.
2005 Sep 20 11:19 PM
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
2005 Sep 21 4:41 AM
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
2005 Sep 21 5:25 AM
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
2005 Sep 21 5:57 AM