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

error in fm using SO_DOCUMENT_SEND_API1

Former Member
0 Likes
697

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

5 REPLIES 5
Read only

jaideepsharma
Active Contributor
0 Likes
663

Hi,

What is the return value in subrc?

KR Jaideep,

Read only

0 Likes
663

sy-subrc is 2

Read only

0 Likes
663

Hi,

Check in SCOT or SOST transaction ? Can you see the mail there ??

KR Jaideep,

Read only

Former Member
0 Likes
663

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

Read only

Former Member
0 Likes
663

thanks