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

Doubt in SO_NEW_DOCUMENT_ATT_SEND_API1 function

Former Member
0 Likes
620

Hi all,

I tried to send mail through ABAP using the function

SO_NEW_DOCUMENT_ATT_SEND_API1. It throws an exeception

document_not_sent . I executed the same program in our training server. It worked. In Development server, it is throwing an exception.Any idea as why this is happening?

I am sure this is not due to the program because it is working fine in the other server.

TIA,

sinthu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
576

Hi sinthu,

1. Its quite possible bcos of the SCOT settings,

in the server.

2. Pls take help of your basis team.

They will maintain the SCOT settings.

regards,

amit m.

6 REPLIES 6
Read only

Former Member
0 Likes
577

Hi sinthu,

1. Its quite possible bcos of the SCOT settings,

in the server.

2. Pls take help of your basis team.

They will maintain the SCOT settings.

regards,

amit m.

Read only

0 Likes
576

<b>Check the status of the send mail in transaction SOST, if SMTP no configured, configure in SCON(or your SMTP is not configured

Go to tcode SCOT

Choose the node SMTP

There configure the relevant data

Next in INTERNET button,

enter the domains to which u can send mail)</b>

If u've used SO_NEW_DOCUMENT_SEND_API1 to send mail, make sure Commit work parameter set to X.

or one possibility is...

In many development and test ambients mail delivery is closed, becose users caould recieve mails when you are testing your programs.

Read only

Former Member
0 Likes
576

Hi,

it is definitely configuration problem. so try to contact your BASIS guy to fix it.

check this..

http://www.sapgenie.com/interfaces/sapconnect.htm

Regards

vijay

Read only

0 Likes
576

Thanks a lot for all your response. Will get back to u after contacting our basis team.

Till then bye...

sinthu

Read only

Former Member
0 Likes
576

Hi Sinthu,

Please check if both the sender and the receiver have valid email addresses in the development server (for the sender check the user master data).

Regards,

John.

Read only

Former Member
0 Likes
576

Hai

Go through the following Code

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