cancel
Showing results for 
Search instead for 
Did you mean: 

so_object_send

Former Member
0 Kudos

Guy's

i am not able to send mail using above function module,

sy-subrc is 0,when above function module get trigger,

but no mail is there in sost tcode,is something to do

with configuration

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member184619
Active Contributor
0 Kudos

Hi sanju,

U might have some configration problem but if not u may check for Tx. code SCOT which list all the pending mails if not sent properly or there r some errors..

to send the mail automatically...use following code

if sy-subrc eq 0.

SUBMIT 'RSCONN01'

WITH MODE EQ 'INT'

AND RETURN.

endif.

this is a report program use to automatically send mails..

Ask for clarification..

Regards

-


Sachin Dhingra

Former Member
0 Kudos

Hai Sanju

Go through the following Link that will be very useful to your requirement

http://www.sapgenie.com/abap/code/abap25.htm

http://www.sapgenie.com/abap/code/abap15.htm

Thanks & Regards

Sreenivasulu P

Former Member
0 Kudos

check your own profile in the system in that profile if ur id is added u can send the mail.

for that goto system -> userprofile -> owndata -> check for email address

Hope this will help u

Regards,

Suresh

Former Member
0 Kudos

refer..

Former Member
0 Kudos

after calling the FM write this code

if sy-subrc eq 0.
SUBMIT 'RSCONN01'
WITH MODE EQ 'INT'
AND RETURN.
endif.

i am not sure whether this works with ur FM , but it works with the other FM for sending mails

Former Member
0 Kudos

Hi Sanju,

Check this code it will work.

DATA: T_DOC TYPE TYPE_T_SODOCCHGI1, "#EC NEEDED

T_CONTENT TYPE TYPE_T_SOLISTI1,

T_PACK TYPE TYPE_T_SOPCKLSTI1,

T_REC TYPE TYPE_T_SOMLRECI1.

CONSTANTS :C_SEN TYPE SO_OBJ_SNS VALUE 'F',

C_REC TYPE SO_ESCAPE VALUE 'U',

C_TYPE TYPE SO_OBJ_TP VALUE 'RAW',

C_COMTYPE TYPE SO_RECNAME VALUE 'INT'.

DATA: S_DOC TYPE SODOCCHGI1,

S_REC TYPE SOMLRECI1,

S_CONTENT TYPE SOLISTI1,

S_PACK TYPE SOPCKLSTI1,

S_FILE TYPE STRING.

DATA : V_STRING TYPE STRING.

IF RB_PRES = 'X'.

MOVE RP_PERFILE TO S_FILE.

ELSE.

MOVE RP_AERFILE TO S_FILE.

ENDIF.

*Get the Object name and Subject Description of the Mail

  • Fill the document data and get size of attachment

CLEAR S_DOC.

S_DOC-OBJ_LANGU = SY-LANGU.

S_DOC-OBJ_NAME = 'PTS_INT306'(022).

CONCATENATE SY-SYSID'List of error rec.'(021)

INTO S_DOC-OBJ_DESCR SEPARATED BY SPACE.

S_DOC-SENSITIVTY = C_SEN.

APPEND S_DOC TO T_DOC.

CLEAR S_DOC.

*Build the Receivers List

S_REC-REC_TYPE = C_REC.

S_REC-RECEIVER = RP_DLIST.

S_REC-COM_TYPE = C_COMTYPE.

APPEND S_REC TO T_REC.

CLEAR S_REC.

*Build Contents of the mail (Body)

CONCATENATE 'File'(019) S_FILE 'downloaded with error records:'(018)

INTO V_STRING.

S_CONTENT-LINE = V_STRING.

APPEND S_CONTENT TO T_CONTENT.

CLEAR S_CONTENT.

S_CONTENT-LINE = V_ERROR_REC.

APPEND S_CONTENT TO T_CONTENT.

CLEAR S_CONTENT.

*Send contents as BODY

S_PACK-HEAD_START = 1.

S_PACK-HEAD_NUM = 1.

S_PACK-BODY_START = 1.

DESCRIBE TABLE T_CONTENT LINES S_PACK-BODY_NUM.

S_PACK-DOC_SIZE = S_PACK-BODY_NUM * 255.

S_PACK-DOC_TYPE = C_TYPE.

APPEND S_PACK TO T_PACK.

CLEAR S_PACK.

*FM for sending mail to the External E-Mail Address

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

DOCUMENT_DATA = S_DOC

PUT_IN_OUTBOX = 'X'

COMMIT_WORK = 'X'

TABLES

PACKING_LIST = T_PACK

CONTENTS_TXT = T_CONTENT

RECEIVERS = T_REC

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

DOCUMENT_TYPE_NOT_EXIST = 3

OPERATION_NO_AUTHORIZATION = 4

PARAMETER_ERROR = 5

X_ERROR = 6

ENQUEUE_ERROR = 7

OTHERS = 8.

IF SY-SUBRC NE 0.

WRITE: /'Email Failed .'(020).

ELSE.

SKIP 2.

WRITE : 'Error List Send to'(026),RP_DLIST.

ENDIF.

Reward points if it works.

Regards,

Suresh

FredericGirod
Active Contributor
0 Kudos

Hi Joseph,

please use the search option of the forum, this problem have been view.

Did you have check your transaction SCOT ?

Rgd

Frédéric

former_member188685
Active Contributor
0 Kudos

Hi sanju,

that might be in queue, so go to SCOT transaction try to send manually, press Start Send Process(Ctrl+F7).

then you can see that in SOST.

Regards

vijay