Fwd: RE: Distribution lists for send e-mail task

Lisa Hasenbohler lhasenbo at agrium.com
Tue Feb 19 13:33:42 EST 2002


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 =3D 0.
  AgentsNumber =3D 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 =3D 'X'
      DLI_ID =3D SPACE
      DLI_NAME =3D DLINAME
    IMPORTING
      DLI_DATA =3D DLIDATA
    TABLES
      DLI_ENTRIES =3D DLIENTRIES
    EXCEPTIONS
      DLI_NOT_EXIST =3D 9001
      OPERATION_NO_AUTHORIZATION =3D 9002
      PARAMETER_ERROR =3D 9003
      X_ERROR =3D 9004
      OTHERS =3D 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 =3D ' '.
* This is the a user
               agent1(2) =3D 'US' .
               agent1+2(12) =3D dlientries-MEMBER_NAM.
               AgentsNumber =3D AgentsNumber + 1.
               append agent1 to agents.
        endif.
* This is an email address -( SMTP external )
        if dlientries-MEMBER_typ =3D 'A' or dlientries-MEMBER_typ =3D 'U'.
               AgentsEmailNumber =3D 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]=20
> Sent: Wednesday, February 06, 2002 3:50 AM
> To:   SAP-WUG at MITVMA.MIT.EDU=20
> 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