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.
  typessx_addr_type  type sx_addrtyp"R/3 Addresstype
        sx_addr       type so_rec_ext "Address in plain string

  typesbegin of sx_address,           "SAPconnect general addr
         type        type sx_addr_type,
         address     type sx_addr,
       end of sx_address.

  constantscx_t_int    type sx_addr_type value `INT`.  "SMTP address

  datals_addr_unst      type sx_address.
  datals_addr           type sx_address.
  datalv_address_normal type sx_address.
  datalv_local          type sx_addr.
  datalv_domain         type sx_addr.
  datalv_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 .
    chn_ok `X`.
  endif.


endform.                    "f_validate_email