Application Development 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: 

Function module to sen mail

Former Member
0 Kudos

Hi,

Does anyone know a function module to send a mail with an attached file when SAP Connect is active ?

Thanks,

Paulo Sousa

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Fm SO_NEW_DOCUMENT_ATT_SEND_API1

Thank U,

Jay....

9 REPLIES 9

Former Member
0 Kudos

Hi,

Fm SO_NEW_DOCUMENT_ATT_SEND_API1

Thank U,

Jay....

GauthamV
Active Contributor
0 Kudos

SEARCH in SCN you will get so many posts with this fm.

SO_NEW_DOCUMENT_ATT_SEND_API1

Former Member
0 Kudos

Hi

try at erpgenie at com/sap/abap/code/abap25.htm

Regards

Shashi

former_member386202
Active Contributor
0 Kudos

Hi,

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = ls_doc_chng

put_in_outbox = gc_x

commit_work = gc_x

TABLES

packing_list = lt_objpack

object_header = lt_objhead

contents_txt = gt_objtxt

receivers = lt_reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 3

OTHERS = 99.

Regards,

Prashant

Former Member
0 Kudos

Hi,

USe the following FM..

SO_NEW_DOCUMENT_ATT_SEND_API1 - Sends emails with texts and attachments

REgards

Kiran

Former Member
0 Kudos

DATA: loc_maildata LIKE sodocchgi1.

DATA: loc_mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.

DATA: loc_mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.

DATA: loc_list TYPE TABLE OF abaplist WITH HEADER LINE.

DATA: loc_ascilines(1024) TYPE c OCCURS 0 WITH HEADER LINE.

DATA: loc_htmllines TYPE TABLE OF w3html WITH HEADER LINE.

DATA: loc_spool_number TYPE tsp01-rqident.

DATA: loc_spool_key TYPE tsp01-rqtitle.

DATA: loc_itab TYPE TABLE OF string.

DATA: loc_line LIKE loc_mailtxt-line.

CLEAR: loc_maildata, loc_mailtxt, loc_mailrec.

REFRESH: loc_mailtxt, loc_mailrec.

loc_maildata-obj_name = 'TEST'.

loc_maildata-obj_descr = 'Test Subject'.

loc_mailtxt-line = wf_line.

APPEND loc_mailtxt.

loc_mailrec-receiver = wf_email.

loc_mailrec-rec_type = 'U'.

APPEND loc_mailrec.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = loc_maildata

document_type = 'RAW'

put_in_outbox = 'X'

TABLES

object_header = loc_mailtxt

object_content = loc_mailtxt

receivers = loc_mailrec

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 = 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

COMMIT WORK.

WAIT UP TO 2 SECONDS.

SUBMIT rsconn01 WITH mode = 'INT'

WITH output = 'X'

AND RETURN.

Former Member

Former Member
0 Kudos

SEARCH SCN BEFORE POSTING !!

Former Member
0 Kudos

Hi

Check with the following

SO_DOCUMENT_SEND_API1

so_new_document_send_api1

Check the following link

[Send mail|]

Hope this helps you

Regards,

Rajani