Hi All,
I want to be able to find all the contacts by using a wildcard search on eamil addresses.
When I look at ADR6, the field SMTP_ADDR is 241 long but is case sensitive.
There is a second field called SMTP_SEARCH which is upper case but is only 20 long.
At the moment I can either search using the first option but, obviously, I have the matching case issue. Or I can search on the first 20 characters on the email address, which is a bit restictive.
For example. Andy.Nother@BigCompany.co.uk will have ANDY.NOTHER@BIGCOMPA in the search field. If I search for bigcompany this will not be found using either field because the case doesn't match and it the pattern doesn't exist in the search field.
Has anyone done this and found a way around it ???
Cherers
James
Hi James ,
i'd create my own search help
to the field adr6-SMTP_ADDR
-> http://10.243.51.62/helpdata/EN/cf/21ee2b446011d189700000e8322d00/frameset.htm
regards Andreas
Hi James,
It is not clear from your description whether you want to code a SELECT statement in your program or whether your are talking about the SE16 transaction (Data Browser).
If it is SE16 that you are referring to, then I'm able to do a case-sensitive search for this field.
If it is a SELECT statement, then give the one that you are using.
All the best...
Regards,
Aand Mandalika.
I am using a select statement.
Basically it's
Data : w_smtp_addr type AD_SMTPADR. w_smtp_addr = '%bigcompany%'. select * into table my_tab from adr6 where smtp_addr like w_smtp_addr. check : sy-subrc eq 0. translate w_smtp_addr to upper case. select * into table my_tab from adr6 where smtp_srch like w_smtp_addr.
As I say, both searches return no data because of the way the fields are set up.
Cheers
James
Hi JamesMacdonald,
you can't find JamesMacdonald
with search string %jamesmacdonald% or its
translation in upper case %JAMESMACDONALD%
-> you firstly must translate mail_adr from db
to upper case ( in internal table )
2. translate search string to upper case
3. read table itab ...with search string
regards Andreas
I think you are all missing the problem.
Create an email address exaclty like this;
myFirstName.mySurName@ThisIsMyCompany.Com
This email address is 41 characters long. It is important you enter it in the same case as above.
Now try to search for mycompany.com. using SQL.
Hi Subramanian,
Sorry, I didn't spot your solution last time.
I think this may work, the only issue would performance. I need to search from around 750,000 records !
I have tried to understand why the user would want to search on the middle part of an email address. As yet they haven't given me a good reason. The search help this is part of allows them a multitude of other parameters to search on.
Add a comment