05-12-2006 7:02 AM
hi,
for a database field CHAR(18), if i fill wild card character i.e *, or placeholders i.e +'s will i have any problem while reading the table
thanks in advance
05-12-2006 7:13 AM
i THINK YOU HAVE TO CONVERT THE SAP WILDCARD (*) to the sql wildcard (%) if you are using the 'like' comparison with a character CONSTANT, variable or parameter.
eg, select SINGLE * from mara where matnr like 'ABC%'.
But if the variable holding the "*" is a select-option or 'range' you do not need to convert as long as you use 'IN' for the compariosn.
EG, select SINGLE * from mara where matnr IN S_MATNR.
05-12-2006 7:05 AM
Hi surendra,
if you are using wild card in your select statement then you have to add 'like' keyword in place of = then it will work fine
Regards
Sumit Bhutani
<b>Ps reward points if helpful</b>
05-12-2006 7:13 AM
i have tried using LIKE in select query. but it doesnt fetch any records for '*'. actually * should replace any characters and fetch me all the records. am i right ?
but a '%' works well.
what do u say ?
05-12-2006 7:06 AM
I don't think you will have a issue as such.
If you have a WHERE the data is WILD char's, you might have to use the ESCAPE SEQ char.
Regards,
Ravi
Note : Please mark the helpful answers
05-12-2006 7:13 AM
i THINK YOU HAVE TO CONVERT THE SAP WILDCARD (*) to the sql wildcard (%) if you are using the 'like' comparison with a character CONSTANT, variable or parameter.
eg, select SINGLE * from mara where matnr like 'ABC%'.
But if the variable holding the "*" is a select-option or 'range' you do not need to convert as long as you use 'IN' for the compariosn.
EG, select SINGLE * from mara where matnr IN S_MATNR.
05-12-2006 7:23 AM
05-12-2006 7:34 AM
hi,
replace all occurrences of '*' in field with '%'.
replace all occurrences of '+' in field with '_'.
so you get the wildcard for like...
regards,
Stefan Huemer
05-12-2006 7:40 AM
05-12-2006 7:42 AM
05-12-2006 7:14 AM
Hi Surendra,
There wont be any issue in using wildcard characters from the table. You have to use LIKE instead of '=' while doing retrieveing data based on wildcard character from the table. You can also use wild card character for pattern based search using CP (Contain Pattern)in the table.
Cheers,
Vikram
Pls reward helpful replies!!
05-12-2006 7:17 AM
HI
GOOD
AS YOU HAVE MENTIONED WHERE DO YOU WANT TO USE THE WILD CARD CHARACTERS ACTUALLY IN THE SELECT STATEMENT OR IN THE DECLARITION OF FIELD TYPE.
IF YOU R ACCESSING THE DATABASE TABLE THROUGH QUERY USING THE WILD CARD CHARACTER LIKE * THAN VERY MUCH YOU CAN DO THIS BUT NOT LIKE + AND IF YOU WANT TO DECLARE THE FIELD LIKE CHAR(*) THAN IT WILL GIVE YOU A ERROR.
THANKS
MRUTYUN
05-12-2006 7:20 AM