E-Posta Adresi Geçerlilik Kontrolü
SX_INTERNET_ADDRESS_TO_NORMAL fonksiyonu ile eposta adresinin geçerliliği kontrol edilebilir.
Kullanımı :
form f_validate_email using prm_ad_smtpadr type ad_smtpadr
CHANGING chn_ok type c.
types: sx_addr_type type sx_addrtyp, "R/3 Addresstype
sx_addr type so_rec_ext . "Address in plain string
types: begin of sx_address, "SAPconnect general addr
type type sx_addr_type,
address type sx_addr,
end of sx_address.
constants: cx_t_int type sx_addr_type value `INT`. "SMTP address
data: ls_addr_unst type sx_address.
data: ls_addr type sx_address.
data: lv_address_normal type sx_address.
data: lv_local type sx_addr.
data: lv_domain type sx_addr.
data: lv_comment type sx_addr.
ls_addr_unst-type = cx_t_int.
ls_addr_unst-address = prm_ad_smtpadr.
clear chn_ok.
call function `SX_INTERNET_ADDRESS_TO_NORMAL`
exporting
address_unstruct = ls_addr_unst
importing
address_normal = lv_address_normal
local = lv_local
domain = lv_domain
comment = lv_comment
addr_normal_no_upper = ls_addr
exceptions
error_address_type = 1
error_address = 2
error_group_address = 3
others = 4.
if sy-subrc eq 0 .
chn_ok = `X`.
endif.
endform. "f_validate_email