04-11-2006 11:28 AM
Hello !
i have one question:
does anybody know, if there is a function or something else, where i can check, if an entered email-adress is correct.
i couldn't find anything in the function builder.
thanks a lot
Greets Helmut
04-11-2006 12:54 PM
hello !
i just wanted to check, if an entered string is a valid email adress (in general).
for example:
abc@def@xy.de is not correct
abc.def@xy.de is correct
acd.def@ is not correct
and so on...
just a formal check of an entered value.
Thanks
Helmut
04-11-2006 11:32 AM
04-11-2006 11:34 AM
Hi Helmut,
I think there is no standard function module to check the correctness of an email.
If you know that all the valid emails (That are relavent to your company) are stored in a data base table, you can verify the correctness by comparing with those values
Another way is to cook your own logic to check for the occurances of '@' symbol etc using search statement in abap.
Regards,
ravi
04-11-2006 11:34 AM
Hai Helmut,
I will send you some function modules
REPORT Z_SENDITAB_EMAIL_SREE_13424 .
tables : mara.
DATA IT_MAIL(200) TYPE C OCCURS 0 WITH HEADER LINE.
message body:
IT_MAIL = '1st line.'. APPEND IT_MAIL.
IT_MAIL = '2nd line.'. APPEND IT_MAIL.
IT_MAIL = '3rd line.'. APPEND IT_MAIL.
IT_MAIL = '4th line.'. APPEND IT_MAIL.
to view the following function (cannot be viewed in se37):
go to sm59, select 'TCP/IP connections',
select and open 'SERVER_EXEC' or 'LOCAL_EXEC',
look on the pull down menu SYSTEM INFORMATION->FUNCTION LIST
data : begin of itab occurs 0,
matnr like mara-matnr,
mtart like mara-mtart,
mbrsh like mara-mbrsh,
meins like mara-meins,
end of itab.
select
matnr
mtart
mbrsh
meins
from mara
into table itab.
if sy-subrc = 0.
CALL FUNCTION 'RFC_MAIL' DESTINATION 'LOCAL_EXEC'
EXPORTING USER = 'sreenivasulup@intelligroup.com'
EXPORTING USER = 'venkatarama@intelligroup.com'
TABLES MAIL = IT_MAIL.
TABLES MAIL = ITAB.
endif.
CASE SY-SUBRC.
WHEN 0. WRITE 'E-mail sent successfully.'.
WHEN OTHERS. WRITE 'Error sending E-mail!'.
ENDCASE.
************************************************************************
Thanks & regards
Sreenivasulu P
04-11-2006 11:35 AM
Helmut,
What do you want to check it against?
1. E-mail address in the user profile?
2. E-mail address in Mail server?
From user profile, you can get the e-mail address by calling BAPI_USER_GETDETAIL, then you can validate against that.
Against the Mail server one, I am not sure if we can do that.
Regards,
Ravi
Note : Please mark the helpful answers
04-11-2006 11:47 AM
Hi,
if you are talking about users e-mail address then you can validate the same using the table ADR6.
get the addressnumber and goto table adr6 and check the e-mail .
Regards
vijay
04-11-2006 12:54 PM
hello !
i just wanted to check, if an entered string is a valid email adress (in general).
for example:
abc@def@xy.de is not correct
abc.def@xy.de is correct
acd.def@ is not correct
and so on...
just a formal check of an entered value.
Thanks
Helmut
04-11-2006 12:59 PM
if v_email np '@.*'.
write:/ 'invalid'.
endif.
This code means that any pattern with a @ and . without following the same order is invalid.
But things are not so straight forward.
I think the effort you put to validate the email is not worth it because, even if it is a valid e mail address by your rules, it may not exist in the real world.
Regards,
Ravi Kanth
04-11-2006 1:01 PM
Hello,
check the function module:
'SX_INTERNET_ADDRESS_TO_NORMAL'
This is used in SAP office to check the address.
Regards,
Dezso
04-11-2006 1:37 PM