Dynamic determination of e-mail Recipient

Van der Burg, Jeroen JA SSI-GRFE-3 Jeroen.J.vanderBurg at si.shell.com
Mon Apr 23 02:47:18 EDT 2001


Lola,
 
Not sure if this is the most efficient method, but to make sure we do not
have to maintain email addresses and office settings (the silly forwarding
bit) at user level I just created a little method which retrieves the email
addresses for all relevant personel numbers from IT0105 at runtime and then
uses the resulting multiline element to send email(s) in the next step.
 
See below, code is not live yet and needs optimising and exception handling
(when no address is found):
------
BEGIN_METHOD GETEMAILADRESS CHANGING CONTAINER.
DATA: begin of Personnelnumber occurs 0,
         personnelnumber like p0001-pernr,
      end of PERSONNELNUMBER.
 
data: begin of EMAILADDRESS occurs 0,
            emailaddress LIKE SOXNA-FULLNAME,
      end of emailaddress.
 
Data  P_0105 type PA0105.
Tables: pa0105.
 
 
  SWC_GET_TABLE CONTAINER 'PersonnelNumber' PERSONNELNUMBER.
 
* Get email addresses
loop at personnelnumber.
 select single * from pa0105 into p_0105 where
    subty eq '0010' and
    pernr eq personnelnumber-personnelnumber and
    begda le sy-datum and
    endda ge sy-datum.
 
 
 if sy-subrc eq 0.
    emailaddress = p_0105-usrid_long.
    append emailaddress.
 endif.
endloop.
 
 
* Set receivers for email
  SWC_SET_TABLE CONTAINER 'EMailAddress' Emailaddress.
 
END_METHOD.
 
 
 
 
 
-----Original Message-----
From: Lola Oluwa [mailto:lola.oluwa at nokia.com]
Sent: 22 April 2001 20:11
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Dynamic determination of e-mail Recipient
 
 
Hi W.f.'s,
 
I would like to be able to dynamically determine the internet address of a
mail notification recipient at runtime (mail sending is background task).
Can anyone tell me if this is feasible and how? The system is 45B and
internet address is maintained for all users.
 
Thanks in advance,
Lola.
 


More information about the SAP-WUG mailing list