Skip to Content
0
Oct 20, 2004 at 07:04 AM

Sending E-Mails : database error

32 Views

Hi all !

I've write a program which sends information by e-mail, with several recipients. I use the function "SO_NEW_DOCUMENT_ATT_SEND_API1" like this :

CLEAR: document_data, wa_packing_list.

REFRESH packing_list.

MOVE 'David.Cerati@email.com' TO wa_receivers-receiver.

MOVE 'U' TO wa_receivers-rec_type.

MOVE 'INT' TO wa_receivers-com_type.

MOVE 'X' TO wa_receivers-notif_del.

MOVE 'X' TO wa_receivers-notif_ndel.

APPEND wa_receivers TO receivers.

document_data-obj_name = 'EMAIL'.

document_data-obj_descr = descr.

document_data-obj_langu = 'DE'.

document_data-obj_expdat = sy-datum.

document_data-sensitivty = 'F'.

document_data-obj_prio = '9'.

document_data-no_change = ' '.

document_data-priority = '9'.

document_data-expiry_dat = sy-datum.

DESCRIBE TABLE contents LINES nblines.

MOVE 1 TO wa_packing_list-head_start.

MOVE 0 TO wa_packing_list-head_num.

MOVE 1 TO wa_packing_list-body_start.

MOVE nblines TO wa_packing_list-body_num.

MOVE 'TXT' TO wa_packing_list-doc_type.

wa_packing_list-doc_size = 255 * nblines.

CLEAR wa_packing_list-transf_bin.

APPEND wa_packing_list TO packing_list.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = document_data

put_in_outbox = 'X'

commit_work = 'X'

TABLES

packing_list = packing_list

contents_txt = contents

receivers = receivers

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.

This programm run like a Job everyday. But I obtain this error "Databse Error : <ADDR_PERS_COMP_COMM_GET> <0>".

Thanks for your help.

David.