Distribution lists for send e-mail task

Felix Hassine Felix.Hassine at us.pm.com
Tue Mar 12 09:22:08 EST 2002


Hi Lisa,
 
Object interfaces use object-key to handle the key of the object they are
utilized from.
In this method, there is no key reference, so that should not matter too
much. In this case you need to use a method, because the method returns you
more than 1 output (in this case the email lists and the number of items
found).
To send an email to the SMTP email addresses, just create a send step
(automatic in version 46C), and assign the list in the address field. (If I
recall correctly, in earlier versions, you need to create a
SELFITEM.SENDTASKDESCRIPTION task, and use 'U' as email address type). Put
an if-test beforehand to test if there is actually an email address, using
the 'AgentsNumber' output (otherwise there will be an error at runtime when
the list is empty).
 
Good luck,
 
FH
 
-----Original Message-----
From: Lisa Hasenbohler [mailto:lhasenbo at agrium.com]
Sent: Monday, March 04, 2002 4:46 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Distribution lists for send e-mail task
 
 
Hi Felix,
 
I was able to get this working as a new method in a subtype object I am
using within my workflow. Thanks your help!
 
Now I think I should create it as an interface but I have no experience with
creating interface objects, what do I use for the key, what are the
attributes, do I use virtual attributes or a method and how do I include the
interface in an subtype object?
 
I also have not been able to figure out how to send mail to the e-mail
addresses (internet addresses)  included in the distribution list, I am only
able to sent it to the Agents (SAP Userids) in the distribution list.
 
Thanks,
Lisa.
 
 
 
>>> Felix.Hassine at us.pm.com 02/19/02 12:20PM >>>
Hi Lisa,
 
It basically means you can stick this method on any object. When yo create
the method , tick the "instance independant" flag.
I suggest you create an interface type and assign it there. This way, using
object inheritance, you can get that method onto any object you work on.
 
Regards,
 
Felix
 
-----Original Message-----
From: Lisa Hasenbohler [mailto:lhasenbo at agrium.com]
Sent: Tuesday, February 19, 2002 1:34 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Fwd: RE: Distribution lists for send e-mail task
 
 
Hi David,
 
I also need to use Distribution lists to send e-mail tasks, so I was very
excited to see this answer, but I have one question as I have very little
experience at creating methods;
 
What Object would I use when creating the "object independent method" to
read in the DLI?
 
Thanks,
Lisa.
 
>>> skeohan at mit.edu 02/06/02 10:37AM >>>
This message was  originally submitted by FHassine at PMIANCAM.COM ...
 
 
Hi David,
 
First create your DLI using the so15 transaction.
Then read the DLI using an object independent method. I have created one
recently, I am enclosing the code below.
That method reads 2 types of addresses within the DLI, the SAP internal
addresses (to send to workplace inbox mails) and external SMTP addresses
(Type U in SAP). It also sends the number of emails found for each list, so
that you can get that in a WF container variable and make a test on it.
 
I am sure there are other options to model this, this is one of them.
 
Hope this can help,
 
Regards,
Felix
-----------------------------
BEGIN_METHOD READDISTRIBUTIONLIST CHANGING CONTAINER.
DATA:
      DLINAME LIKE SOOBJINFI1-OBJ_NAME,
      DLIDATA LIKE SODLIDATI1,
      agent1 like wfsyst-agent,
      DLIENTRIES LIKE SODLIENTI1 OCCURS 0 with header line,
      AGENTS LIKE WFSYST-AGENT OCCURS 0 with header line,
      AgentsNumber like syst-tabix,
      AgentsEmailNumber like syst-tabix,
      AgentsEmailList like BAPIADDR3-E_MAIL occurs 0.
 
  AgentsEmailNumber = 0.
  AgentsNumber = 0.
  SWC_GET_ELEMENT CONTAINER 'DliName' DLINAME.
  IF SY-SUBRC <> 0.
    MOVE SPACE TO DLINAME.
  ENDIF.
  CALL FUNCTION 'SO_DLI_READ_API1'
    EXPORTING
      SHARED_DLI = 'X'
      DLI_ID = SPACE
      DLI_NAME = DLINAME
    IMPORTING
      DLI_DATA = DLIDATA
    TABLES
      DLI_ENTRIES = DLIENTRIES
    EXCEPTIONS
      DLI_NOT_EXIST = 9001
      OPERATION_NO_AUTHORIZATION = 9002
      PARAMETER_ERROR = 9003
      X_ERROR = 9004
      OTHERS = 01.
  CASE SY-SUBRC.
    WHEN 0.            " OK
    WHEN 9001.         " DLI_NOT_EXIST
      EXIT_RETURN 9001 DLINAME Space space space.
    WHEN 9002.         " OPERATION_NO_AUTHORIZATION
      EXIT_RETURN 9002 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    WHEN 9003.         " PARAMETER_ERROR
      EXIT_RETURN 9003 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    WHEN 9004.         " X_ERROR
      EXIT_RETURN 9003 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    WHEN OTHERS.       " to be implemented
  ENDCASE.
  clear agents. refresh agents.
  clear AgentsEmailList. refresh AgentsEmailList.
  loop at DLIENTRIES.
        if dlientries-MEMBER_typ = ' '.
* This is the a user
               agent1(2) = 'US' .
               agent1+2(12) = dlientries-MEMBER_NAM.
               AgentsNumber = AgentsNumber + 1.
               append agent1 to agents.
        endif.
* This is an email address -( SMTP external )
        if dlientries-MEMBER_typ = 'A' or dlientries-MEMBER_typ = 'U'.
               AgentsEmailNumber = AgentsEmailNumber + 1.
               append dlientries-FULL_NAME to AgentsEmailList.
        endif.
  endloop.
  SWC_SET_TABLE CONTAINER 'Agents' AGENTS.
  swc_set_table container 'AgentsSAPMailList' AgentsEmailList.
  swc_set_element container 'AgentsNumber' AgentsEmailNumber.
  swc_set_element container 'AgentsSAPMailListNumber' AgentsNumber.
END_METHOD.
 
----------------------------
 
> -----Original Message-----
>> From: Durrant,David William [SMTP:DURRAND2 at apci.com]
> Sent: Wednesday, February 06, 2002 3:50 AM
> To:   SAP-WUG at MITVMA.MIT.EDU
> Subject:      Distribution lists for send e-mail task
>
> Hi there workflow experts
>
> Does anyone know if you can create a distribution list for a send e-mail
> step
>
> We are using internet addresses to create outlook e-mails, and I need to
> send the same e-mail to 20 odd recipients. We are using 4.6c
>
> Regards
>
> Dave Durrant
> Workflow Architect
> Air Products PLC
>
> +
 
----- End forwarded message -----
 
 
 
 
----------------------------------------------------------------
This mail sent using MIT WebMail. See http://web.mit.edu/webmail
 


More information about the SAP-WUG mailing list