10-16-2008 1:03 PM
Hi experts,
I am writing a Function module to get data from a table.
Import :
desc TYPE ZTABLE-DESCRIPTION.
-
Now when desc = te*
REPLACE ALL OCCURRENCES OF '*' IN
desc WITH '%' .
SELECT *
FROM ZTABLE
INTO CORRESPONDING FIELDS OF TABLE t_list WHERE DESCRIPTION LIKE desc.
-
.. With is the table fetches all records where description starts with " te " .. here te is case senstive
So if description is "Test " or " TEST " or "tE" ......... so on.. i want this like to be made case in sensitive
Coz user can search as per his/her way...
Regards,
Bijal
10-16-2008 1:11 PM
Hello,
Better you select Lowecase option is the domain of the DESCRIPTION field then u can fetch the data from Ztable.
10-16-2008 1:12 PM
using translate to upper case should help.
or you can populate a range table/ select options kind of table and so_vlaue-low = te% so_vlaue-high = TE%
10-16-2008 1:56 PM
Hi jay,
e_sel-sign = 'I'.
e_sel-option = 'BT'.
e_sel-low = 'te%'.
e_sel-high = 'TE%'.
APPEND e_sel TO i_sel .
SELECT *
FROM ztable
INTO CORRESPONDING FIELDS OF TABLE t_list
WHERE description IN i_sel.
This does not work ..:(...
how
10-16-2008 2:02 PM
e_sel-sign = 'I'.
e_sel-option = 'BT'.
e_sel-low = 'te%'.
e_sel-high = 'TE%'.
APPEND e_sel TO i_sel .clear e_sel.
e_sel-sign = 'I'.
e_sel-option = 'BT'.
e_sel-low = 'tE%'.
e_sel-high = 'Te%'.
APPEND e_sel TO i_sel .clear e_sel.
SELECT *
FROM ztable
INTO CORRESPONDING FIELDS OF TABLE t_list
WHERE description IN i_sel.
or
SELECT *
FROM ztable
INTO CORRESPONDING FIELDS OF TABLE t_list
WHERE description+0(2) in ( 'te%', 'TE%' , 'Te%', 'tE%').
10-16-2008 2:09 PM
Thanks Jay
But the serach can be any thing like Test* or traIN* ...
What will i do...?
10-16-2008 3:05 PM
>
> Thanks Jay
>
> But the serach can be any thing like Test* or traIN* ...
>
> What will i do...?
Following the suggestion of Thomas Zloch above would seem to me to be the best solution. It's what SAP does in this situation eg in table LFA1 where (in our system at least) MCOD1 holds an uppercase version of NAME1.
10-16-2008 1:14 PM
This can be done by adding another field to ZTABLE that duplicates the contents of DESCRIPTION in upper case (or lower case). Then your select could use this new field to search for the pattern, after converting it to upper case (or lower case).
Thomas
10-16-2008 3:10 PM
This can really only be done using native SQL (that is, if your database supports something like 'translate').
Rob