Skip to Content
0
Jan 11, 2012 at 08:44 AM

Email not in inbox using SO_DOCUMENT_SEND_API1

1008 Views

Hi all,

I am using the FM shown below to send an email to my external yahoo inbox. When I run the program the sy-subrc = 0 and I will get a pop up box showing SAPConnect Send Process:List of Send Objects.

It shows Document title: Send Mail from ABAP Program

Rec: 1

SAP office Object ID : RAW37000000000027

Type: M

and a sign look like a thunder.

I clicked on the green check on the pop up box to continue.

When I checked my yahoo inbox, I did not receive any mail. May I know what is going on?

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = gd_doc_data

put_in_outbox = 'X'

sender_address = 'my yahoo email address'

sender_address_type = 'INT'

commit_work = 'X'

IMPORTING

sent_to_all = gd_sent_all

TABLES

packing_list = it_packing_list

contents_bin = lt_attachment

contents_txt = it_message

receivers = it_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.

  • Store function module return code

gd_error = sy-subrc.

  • Get it_receivers return code

LOOP AT it_receivers.

ENDLOOP.

  • Instructs mail send program for SAPCONNECT to send email(rsconn01)

WAIT UP TO 2 SECONDS.

IF gd_error EQ 0.

SUBMIT rsconn01 WITH mode = 'INT'

WITH output = 'X'

AND RETURN.

ENDIF.

Edited by: Siong Chao on Jan 11, 2012 9:44 AM