‎2006 May 30 9:33 AM
Hi,
i'm in SAP ECC 5. When i want to send e-mail i use FM SO_NEW_DOCUMENT_SEND_API1 but it don't work, email is not send and i can't show it in SCOT. But there are few days i've tested it with successful. So, can you tell me which are the prerequis ?
Moreover, when i use solution Thomas Jung (thanks) /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface it's work fine !! but if i use this solution in PAI it DON'T work, i've posted new topic for this
So, actually i want to test to send email via FM SO_NEW_DOCUMENT_SEND_API1 but it's don't work, i don't understand.
Thanks for help.
Regards
‎2006 May 30 9:34 AM
Hello,
As of ECC5 this function module requires an additional parameter COMMIT_WORK, which should be set to 'X'.
Regards,
John.
‎2006 May 30 9:41 AM
Hi,
Can you ref the OSS note: 717265. It's all talk about the COMMIT work as John mentioned. Check it out !
Thanks,
Thomas.
‎2006 May 30 9:51 AM
Hi,
Please run this FM DB_COMMIT, after the SO_NEW_DOCUMENT_SEND_API1 FM is called.
If useful, pls award points.
Regards,
Bharadwaj
‎2006 May 30 10:01 AM
Hi,
put a explicit <b>commit work</b> statement after function call.
rgds,
latheesh
Message was edited by: Latheesh Kaduthara
‎2006 May 30 10:06 AM
Hi,
Check the SCOT Settings.
SCOT : Configure the mail settings here. Take help from BASIS Team.
Refer the following link to write the proper code.
sending mail with attachment
<a href="http://www.sap-img.com/abap/sending-email-with-attachment.htm">http://www.sap-img.com/abap/sending-email-with-attachment.htm</a>
sending mail with attachment report in background
<a href="http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm">http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm</a>
sending external mail thru SAP
<a href="http://www.sap-img.com/fu016.htm">http://www.sap-img.com/fu016.htm</a>
<b>Reward points if it helps.</b>
Regards,
Amit Mishra
‎2006 May 30 10:24 AM
Thanks for answer but i've already add parameter COMMIT_WORK and the probleme is the same.
Regards
‎2006 May 30 10:31 AM
Hi tafkap,
1. Please take help of basis team.
2. Maybe the SCOT settings might
have changed / or may require some change.
regards,
amit m.
‎2006 May 30 12:43 PM
But if i use function module from /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
it's work fine, i can show e-mail in SCOT and i receive it.
‎2006 May 30 12:48 PM
Hai
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
DATA L_NUM(3).
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Delivered Mail'.
Mail Contents
OBJTXT = 'Object text'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
LOOP AT ITAB_DATA.
CONCATENATE ITAB_DATA-PRODUCTOR
ITAB_DATA-VBELN
ITAB_DATA-POSNR
ITAB_DATA-MATNR INTO OBJBIN.
APPEND OBJBIN.
ENDLOOP.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'ORDERS'.
APPEND OBJHEAD.
Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'TXT'.
OBJPACK-OBJ_NAME = 'WEBSITE'.
OBJPACK-OBJ_DESCR = 'ORDERS.TXT'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
Completing the recipient list
target recipent
clear RECLIST.
RECLIST-RECEIVER = 'test@here.com'.
RECLIST-EXPRESS = 'X'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
copy recipents
clear RECLIST.
RECLIST-RECEIVER = 'secondtest@here.com'.
RECLIST-EXPRESS = 'X'.
RECLIST-REC_TYPE = 'U'.
RECLIST-COPY = 'X'.
APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
Thanks & regards
Sreenivasulu P
‎2006 May 30 12:50 PM
‎2006 May 30 12:59 PM
if its working using CL_BCS classes it should work with the FM as well.
and also its surprising that it doesnt work when called in PAI ? did you debug to see whether the FM is actually getting execute and with right parameters?
Raja
‎2006 Nov 17 9:58 AM
Was this resolved? I am facing similar issues. I dont see an entry in scot. I have tried everything mentioned in the above posts
‎2007 Aug 22 8:56 AM
Hi,
This function does not work in PAI, PA30 transaction. But this will work:
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
<b>STARTING NEW TASK 'task'</b>
-
-
Cheers
Keshav