We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

Re: [sap-abap] How to Send Mail to Multiple Users

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from USER_2493307 on Feb 4 at 11:20 PM
Dear Jyotsn,

This the sample code to send the multiple SMS it will be similar way for
the mail also try this.


DATA: FV_FNAME TYPE EMNAM.
IMPORT FV_FNAME TO FV_FNAME FROM MEMORY ID 'FV_FNAME'.
*DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
DATA: RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
OBJHEAD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
P_REC LIKE RECEIVERS-RECEIVER,
P_TYPE LIKE RECEIVERS-REC_TYPE.
data: msg(50),
code TYPE STRING,
msge type string.
data: DOC_CHNG LIKE SODOCCHGI1,
OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE,
P_COUNT(5).




DATA: IT_BUT020 TYPE STANDARD TABLE OF BUT020 with header line,
WA_BUT020 like it_BUT020.


DATA: IT_BUT000 TYPE STANDARD TABLE OF BUT000 with header line,
WA_BUT000 like it_BUT000.
DATA: PARTNER TYPE BUT020-PARTNER.


DATA: IT_ADR2 TYPE TABLE OF ADR2,
WA_ADR2 TYPE ADR2.
DATA: ENTRIES LIKE SY-TABIX.
TYPES: BEGIN OF TY_FINAL,
PARTNER TYPE BUT020-PARTNER,
ADDRNUMBER TYPE BUT020-ADDRNUMBER,
TEL_NUMBER TYPE ADR2-TEL_NUMBER,
TELNR_LONG type ADR2-TELNR_LONG,
END OF TY_FINAL.


DATA: IT_FINAL TYPE TY_FINAL OCCURS 0,
WA_FINAL LIKE LINE OF IT_FINAL.



PARTNER = GV_REPORTER.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = PARTNER "GV_REPORTER
IMPORTING
OUTPUT = PARTNER "GV_REPORTER
.
select * from BUT000 into corresponding fields of table it_BUT000
where PARTNER = PARTNER.

SELECT *
FROM BUT020
INTO CORRESPONDING FIELDS OF TABLE IT_BUT020
for all entries in it_BUT000
WHERE PARTNER = it_BUT000-PARTNER."GV_IBASE.

IF IT_BUT020[] IS NOT INITIAL.
SELECT ADDRNUMBER TEL_NUMBER TELNR_LONG
FROM ADR2
INTO CORRESPONDING FIELDS OF TABLE IT_ADR2
FOR ALL ENTRIES IN IT_BUT020
WHERE ADDRNUMBER = IT_BUT020-ADDRNUMBER.
ENDIF.



LOOP AT IT_BUT020 INTO WA_BUT020.
WA_FINAL-PARTNER = WA_BUT020-PARTNER.

LOOP AT IT_ADR2 INTO WA_ADR2 WHERE ADDRNUMBER = WA_BUT020-ADDRNUMBER.
WA_FINAL-TEL_NUMBER = WA_ADR2-TEL_NUMBER.
WA_FINAL-TELNR_LONG = WA_ADR2-TELNR_LONG.
APPEND WA_FINAL TO IT_FINAL.
ENDLOOP.
CLEAR: WA_FINAL, WA_ADR2, WA_BUT020.
ENDLOOP.

refresh : RECEIVERS.

LOOP AT IT_FINAL INTO WA_FINAL.
RECEIVERS-RECEIVER+13 = WA_FINAL-TEL_NUMBER.
RECEIVERS-REC_TYPE = 'U'.
RECEIVERS-COM_TYPE = 'PAG'.
RECEIVERS-NOTIF_DEL = 'X'.
RECEIVERS-NOTIF_NDEL = 'X'.
MOVE 'K' TO RECEIVERS-REC_TYPE.
APPEND RECEIVERS TO RECEIVERS.
CLEAR : WA_FINAL-TEL_NUMBER.
ENDLOOP.


MSG = GS_NOTIF-SUBJECT."'Created ID Successfully'.

code = gv_refnum."'8000007418'

CONCATENATE code '-''Subject:-' MSG INTO msge.
DOC_CHNG-OBJ_DESCR = msge.
OBJCONT = 'Ticket Created in SolMon '.
APPEND OBJCONT.

DESCRIBE TABLE OBJCONT LINES ENTRIES.
READ TABLE OBJCONT INDEX ENTRIES.
DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
*************************************************************************
** (RFC) Function Module for SMS& MAIL
*************************************************************************

IF RECEIVERS[] IS NOT INITIAL.
* BREAK-POINT.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
COMMIT_WORK = 'X'
PUT_IN_OUTBOX = 'X'
TABLES
OBJECT_HEADER = OBJHEAD
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECEIVERS
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
endif.

Best Regards,
Maruthi .M
--
SAP Tech Consultant

---------------Original Message---------------
From: jyotsna kumbhare
Sent: Monday, February 03, 2014 10:56 PM
Subject: How to Send Mail to Multiple Users

Dear friends,
Please tell me how can I send SAP mail to multiple user IDs in their SAP inbox?
The requirement is just sending SAP mail to multiple users IDs.

Thanks,
Jyotsn



******************************************************************************************************************************************************************************************************************

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2014 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
USER_2493307  
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Have a technical question? Need to find IT solutions? Ask your peers in the Toolbox for IT community.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language