‎2007 Jul 20 7:18 PM
hi Experts,
How to validate email id in screen painter field?
‎2007 Jul 20 7:21 PM
‎2007 Jul 21 7:51 PM
after @ i want to check email validation.
like it should be yahoo, gmail, rediffmail and hotmail, msn.com
how can i do that?
‎2007 Jul 21 8:11 PM
Check the below links :
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/e-mail%2bvalidation
I am sure that the above links will help you
Thanks
Seshu
‎2007 Jul 20 7:21 PM
‎2007 Jul 20 7:22 PM
Hi,
You can use FM SX_INTERNET_ADDRESS_TO_NORMAL and pass address type as INT.
Regards,
Ferry Lianto
‎2007 Jul 21 7:02 AM
hi,
you can use this FM --SX_INTERNET_ADDRESS_TO_NORMAL
which will give you a SY-SUBRC <> 0 for invalid mail addresses.
As it checks one address only, you may define
data:
lt_mails type string,
lv_mail type string.
split p_mail at ';' into lt_mails.
loop at lt_mails into lv_mail.
CALL FUNCTION 'SX_INTERNET_ADDRESS_TO_NORMAL'
check the parameters - I'm not logged on
if sy-subrc <> 0.
error 'invalid mail address' lv_mail in p_mail
endif.
endloop.
thanks
jaideep
*reward points if useful..
‎2007 Aug 20 2:07 PM
Hi,
Please try following code.
declare c_int adn wa_address as below.
data : c_int type soextreci1-adr_typ value 'INT',
wa_address type sx_address.
wa_address-address = p_p_email.(email id entered)
wa_address-type = c_int.
call function module and pass the above parameters.
*Using FM to check if the email address entered is a valid one
call function 'SX_INTERNET_ADDRESS_TO_NORMAL'
exporting
address_unstruct = wa_address
exceptions
error_address_type = 1
error_address = 2
error_group_address = 3
others = 4.
if sy-subrc <> 0.
*Text-001 : Invalid Email ID
message e000 with text-001.(text-001 - Invalid email-id)
endif.
Reward if useful,
Thanks,
Neeraja.C