Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

sending excel attachment to the distribution list

Madhurivs23
Participant
0 Kudos

Hi ,

I am sending an Excel file attachment in XLS format to the distrubution list using FM :SO_NEW_DOCUMENT_ATT_SEND_API1

I have passed the parameters as follows:

reclist-REC_TYPE = 'C'.

reclist-COM_TYPE = 'INT'.

reclist-NOTIF_DEL = 'X'.

reclist-NOTIF_NDEL = 'X'.

reclist-RECEIVER = p_DLIST.

APPEND reclist.

but i am receiving error message :

Exception from the class CX_SEND_REQ_BCS was caught

when I am passing the receiver as email address, its working fine.

Please let me know what is the issue?

Tjhanks and regards,

Madhuri

7 REPLIES 7

Former Member
0 Kudos

Hi,

Try

RECLIST-REC_TYPE = 'U'. "internet users

RECLIST-RECEIVER = '<name>@address.com'. " try one like youe first address
RECLIST-REC_TYPE = 'U'. 
APPEND RECLIST. 
RECLIST-RECEIVER = p_DLIST.  " put the list 
RECLIST-REC_TYPE = 'P'. 
APPEND RECLIST. 

Also check this wiki [http://wiki.sdn.sap.com/wiki/display/Snippets/Howtosendmailtoadistributionlistoragroup+ID]

Ben

0 Kudos

hi Benson,

If I mention as above , its still not sending any email to any of the distribution list id.

Edited by: madhuri sonawane on Mar 3, 2012 1:29 PM

0 Kudos

Hi,

RECLIST-RECEIVER = 'p_DLIST'.  " distributor in SAP Mail
RECLIST-REC_TYPE = 'C'. " put it as C .
APPEND RECLIST. 

Please check the distributor list in SAP Mail - TR 'SO23' that it is properly maintained or not.

'P' for Private distribution list

'C' for Shared distribution list

0 Kudos

Dear Madhuri,

Try to use a loop at internal table which contains the email address and append it to the receivers list.

LOOP AT IT_ZLTCBMAIL INTO WA_ZLTCBMAIL.
     T_RECEIVERS-RECEIVER = WA_ZLTCBMAIL-MLIDUSER.
     T_RECEIVERS-REC_TYPE = 'U'.
     T_RECEIVERS-COM_TYPE = 'INT'.
     T_RECEIVERS-NOTIF_DEL = 'X'.
     T_RECEIVERS-NOTIF_NDEL = 'X'.
     APPEND T_RECEIVERS.
    ENDLOOP.

Harsh_Bansal
Contributor
0 Kudos

Hi,

Refer this -

Set shared_dli as per your DL..shared or Private.


DATA: i_distlist TYPE STANDARD TABLE OF SODLIENTI1.

call function 'SO_DLI_READ_API1'
 exporting
 dli_name = 'ZDISTR_LIST'
 shared_dli = ' '
 tables
 dli_entries = i_distlist
 exceptions
 dli_not_exist = 1
 operation_no_authorization = 2
 parameter_error = 3
 x_error = 4
 others = 5.

After you get the receivers in i_distlist, loot at it and append all the email addresses in i_receivers which will be of type as in SO_NEW_DOCUMENT_ATT_SEND_API1

Regards,

Harsh Bansal

Madhurivs23
Participant
0 Kudos

Thanks Harsh,

Resolved with your suggestion.

But don't know what was the problem with mentioning the distribution list directly with type 'C'. Do you have idea on this?

regards,

Madhuri

Edited by: madhuri sonawane on Mar 5, 2012 1:35 PM

Harsh_Bansal
Contributor
0 Kudos

Hi,

Haven't tried that so can't say.

Regards,

Harsh Bansal