Dynamic determination of e-mail Recipient

michel Tallon michel.tallon at ifrance.com
Mon Apr 23 05:47:54 EDT 2001


Sorry, I'm currently working with a 4.6C,
 
As I don't have any system 4.5B available, ADDSMTP could be new from 4.6.
 
Maybe you can use 2 others functions : SUSR_USER_READ to retrieve
information about user address.
And them use the function ADDR_PERS_COMP_GET_COMPLETE to look for user
details.
 
BAPI_USER_GET_DETAIL (4.6C) use both.
Here is the code from 4.6C
 
CALL FUNCTION 'SUSR_USER_READ'
     EXPORTING
          USER_NAME            = USERNAME_
*         WITH_TEXT            =
    IMPORTING
         USER_LOGONDATA       = LOGONDATA_
         USER_DEFAULTS        = DEFAULTS_
         USER_ADDRESS         = USER_ADDRESS
    TABLES
         USER_PARAMETERS      = PARAMETER
     EXCEPTIONS
          USER_NAME_NOT_EXISTS = 1
          INTERNAL_ERROR       = 2
          OTHERS               = 3.
 
and them
 
CALL FUNCTION 'ADDR_PERS_COMP_GET_COMPLETE'
      EXPORTING
           ADDRNUMBER        = USER_ADDRESS-ADDRNUMBER
*         ADDRHANDLE        =
           PERSNUMBER        = USER_ADDRESS-PERSNUMBER
*           pershandle        =
      IMPORTING
           ADDR3_COMPLETE    = ADDR3_COMPLETE
       EXCEPTIONS
            PARAMETER_ERROR   = 1
            ADDRESS_NOT_EXIST = 2
            PERSON_NOT_EXIST  = 3
            INTERNAL_ERROR    = 4
            OTHERS            = 5.
 
ADDR3_COMPLETE contains e-mail address.
 
I'm not sure these functions are available in a 4.5B system.
Just try!
 
 
 
-----Message d'origine-----
De : SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU]De la part de
Lola Oluwa
Envoyi : lundi 23 avril 2001 11:17
@ : SAP-WUG at MITVMA.MIT.EDU
Objet : Re: Dynamic determination of e-mail Recipient
 
 
Hi michel, I have had a look at the interface for 'BAPI_USER_GET_DETAIL',
table ADDSMTP does not appear to be one of the interface tables(at least not
in our 4.5B System). Could you confirm that it is part of the BAPI's
standard interface in your system and could you send me the reference
structure for this table.
 
Thanks,
Lola.
 
 
-----Original Message-----
From: ext michel Tallon [mailto:michel.tallon at ifrance.com]
Sent: Monday, April 23, 2001 10:23 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Dynamic determination of e-mail Recipient
 
 
Hi,
 
I have the same problem, no HR available,
We solve this using this code to retrieve the e-mail address directly from
User master data.
 
            CALL FUNCTION 'BAPI_USER_GET_DETAIL'
                 EXPORTING
                      USERNAME = l_username
                 TABLES
                      RETURN   = l_return
                      ADDSMTP  = l_addsmtp.
            read table l_addsmtp index 1.
            if sy-subrc eq 0.
              recipient_address = l_addsmtp-e_mail.
            else.
 
Hope it helps.
 
 
 
-----Message d'origine-----
De : SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU]De la part de
Lola Oluwa
Envoyi : lundi 23 avril 2001 09:11
@ : SAP-WUG at MITVMA.MIT.EDU
Objet : Re: Dynamic determination of e-mail Recipient
 
 
hmm... Unfortunately, we do not have any organisation structures/access to
HR data. We determine the agent responsible for the subsequent task at
runtime using Task: TS30001203. I am aware that this is like driving a
Ferrari with a Ford engine, but we have to live with this for now. The
email
maintanance I mentioned in my earlier mail was done for each user master
data at time of creation and this is what I have to work with.
 
Lola.
 
-----Original Message-----
From: ext Van der Burg, Jeroen JA SSI-GRFE-3
[mailto:Jeroen.J.vanderBurg at si.shell.com]
Sent: Monday, April 23, 2001 9:47 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Dynamic determination of e-mail Recipient
 
 
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.
 
 
____________________________________________________________________________
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif
 
 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif
 


More information about the SAP-WUG mailing list