Application Development and Automation 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: 
Read only

Problem with SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Likes
2,397

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

13 REPLIES 13
Read only

Former Member
0 Likes
1,705

Hello,

As of ECC5 this function module requires an additional parameter COMMIT_WORK, which should be set to 'X'.

Regards,

John.

Read only

Former Member
0 Likes
1,705

Hi,

Can you ref the OSS note: 717265. It's all talk about the COMMIT work as John mentioned. Check it out !

Thanks,

Thomas.

Read only

Former Member
0 Likes
1,705

Hi,

Please run this FM DB_COMMIT, after the SO_NEW_DOCUMENT_SEND_API1 FM is called.

If useful, pls award points.

Regards,

Bharadwaj

Read only

Former Member
0 Likes
1,705

Hi,

put a explicit <b>commit work</b> statement after function call.

rgds,

latheesh

Message was edited by: Latheesh Kaduthara

Read only

Former Member
0 Likes
1,705

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

Read only

0 Likes
1,705

Thanks for answer but i've already add parameter COMMIT_WORK and the probleme is the same.

Regards

Read only

Former Member
0 Likes
1,705

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.

Read only

0 Likes
1,705

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.

Read only

Former Member
0 Likes
1,705

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

Read only

Former Member
0 Likes
1,705

Hi,

Go through the following link :

www.sapgenie.com/abap/code/abap31.htm

Thanks,

Ramya Reddy.

Read only

athavanraja
Active Contributor
0 Likes
1,705

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

Read only

0 Likes
1,705

Was this resolved? I am facing similar issues. I dont see an entry in scot. I have tried everything mentioned in the above posts

Read only

former_member410382
Discoverer
0 Likes
1,705

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