‎2009 Sep 09 1:45 PM
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = gwa_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = git_packing_list
contents_bin = git_contents_bin
contents_txt = git_body
receivers = git_send_email
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 e018(z_mm_prox).
ENDIF.
git_send_email has email address,git_body has text,
git_contents_bin is empty
git_packing_list-transf_bin = space.
git_packing_list-head_start = 1.
git_packing_list-head_num = 0.
git_packing_list-body_start = 1.
git_packing_list-doc_type = 'RAW'.
but sy-subrc is not equal to zero.pls help me in solving
‎2009 Sep 09 1:46 PM
‎2009 Sep 09 1:50 PM
‎2009 Sep 09 2:38 PM
Hi,
Check in SCOT or SOST transaction ? Can you see the mail there ??
KR Jaideep,
‎2009 Sep 09 2:44 PM
Hi,
Refer to the following code:
To get the mail ids
CLEAR: wa_message.
REFRESH : gi_messages.
wa_doc_data-priority = '1'.
Populate the subject/generic message attributes
wa_doc_data-obj_langu = sy-langu.
wa_doc_data-obj_name = lc_obj_name.
wa_doc_data-obj_descr = 'Find Inactive PU/DU'(001).
wa_doc_data-sensitivty = lc_sensitivity.
Describe the body of the message
wa_message = '<html><head>'.
APPEND wa_message TO gi_messages.
wa_packing_list-transf_bin = space.
wa_packing_list-head_start = 1.
wa_packing_list-head_num = 0.
wa_packing_list-body_start = 1.
DESCRIBE TABLE gi_messages LINES lv_tab_lines.
READ TABLE gi_messages INDEX lv_tab_lines INTO wa_message.
wa_doc_data-doc_size = ( lv_tab_lines - 1 ) * 255 + STRLEN( wa_message ).
APPEND wa_message TO gi_messages.
DESCRIBE TABLE gi_messages LINES wa_packing_list-body_num.
wa_packing_list-doc_type = 'HTM'.
wa_packing_list-doc_size = lv_tab_lines * 255.
APPEND wa_packing_list TO gi_packing_list.
CLEAR wa_packing_list.
wa_receivers-receiver = so_malid-low.
wa_receivers-rec_id = so_malid-low.
wa_receivers-rec_type = 'U'.
wa_receivers-com_type = 'INT'.
wa_receivers-notif_del = 'X'.
wa_receivers-notif_ndel = 'X'.
APPEND wa_receivers TO gi_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_doc_data
sender_address = gc_sender_address
sender_address_type = gc_sender_address_type
commit_work = 'X'
TABLES
packing_list = gi_packing_list
contents_txt = gi_messages
receivers = gi_receivers.
Hope it helps.
Regards,
Rajesh Kumar
Edited by: Rajesh Kumar on Sep 9, 2009 3:50 PM
‎2009 Sep 14 1:42 PM