Fwd: RE: Distribution lists for send e-mail task
Susan R. Keohan
skeohan at mit.edu
Wed Feb 6 12:37:28 EST 2002
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 independant 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