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

Email sometimes does not send

Former Member
0 Likes
1,089

Hi Gurus,

I am sending email and using the FM SO_NEW_DOCUMENT_ATT_SEND_API1.

Why is it sometimes I can receive the email and sometimes I don't?

Is there a configuration that filters the sending of emails?

In transaction SOST, it the status is SENT (with green light), but I do not receive it.

Also, why is the RECIPIENT and the STATUS_TEXT not the same? (in SOST). The recipient is my email address and the STATUS_TEXT has different email address.

Thanks in advance.

Benedict

7 REPLIES 7
Read only

Former Member
0 Likes
950

Hi,

Such behaviour doesn't happen in SAP. May be your e-mail server is filtering them.

Regards,

Atish

Read only

0 Likes
950

Hi Atish,

Thanks for the immediate response.

Another question:

Whenever I can receive the email, I am receiving 2 attachments,

MESSAGE.DAT

FILENAME.DAT.

The expected attachment is the FILENAME.DAT. Why is it that it is sending 2 files? Where did the MESSAGE.DAT came from?

BTW, MESSAGE.DAT and FILENAME.DAT has the same content.

Thank you.

Benedict

Read only

0 Likes
950

Anyone?

Read only

0 Likes
950

Just paste your code if possible.

Read only

0 Likes
950

Hi Atish,

Here is my code.

wa_objbin = 'salem_marcial'.

APPEND wa_objbin TO it_objbin.

  • Creation of email subject

CONCATENATE text-003 p_gjahr p_rpmax p_bukrs INTO lv_title

SEPARATED BY c_unsc.

wa_doc_data-obj_descr = lv_title.

wa_doc_data-obj_langu = sy-langu.

  • wa_doc_data-skip_scren = c_x.

DESCRIBE TABLE it_objbin LINES gv_tab_lines.

READ TABLE it_objbin INTO wa_objbin INDEX gv_tab_lines.

wa_objhead = text-005. "2007_016_FR10_HFM_SFeRE

APPEND wa_objhead TO it_objhead.

  • Creating the entry for the compressed attachment

wa_objpack-transf_bin = c_x.

wa_objpack-head_start = 1.

wa_objpack-head_num = 1.

wa_objpack-body_start = 1.

wa_objpack-body_num = gv_tab_lines.

wa_objpack-obj_langu = sy-langu.

wa_objpack-doc_type = c_dat.

wa_objpack-obj_name = c_att.

wa_objpack-obj_descr = lv_title.

wa_objpack-doc_size = gv_tab_lines * 250.

APPEND wa_objpack TO it_objpack.

IF gv_flag2 IS INITIAL.

APPEND wa_objpack TO it_objpack.

gv_flag2 = c_x.

ELSE.

IF wa_objpack-doc_size > lv_doctemp.

REFRESH it_objpack.

APPEND wa_objpack TO it_objpack.

ENDIF.

lv_doctemp = wa_objpack-doc_size.

ENDIF.

lv_size = wa_objpack-doc_size.

  • Converts string to ftext format

CALL FUNCTION 'SCMS_STRING_TO_FTEXT'

EXPORTING

text = space

TABLES

ftext_tab = it_objbin.

  • Converts ftext to binary format

CALL FUNCTION 'SCMS_FTEXT_TO_BINARY'

EXPORTING

input_length = lv_size

TABLES

ftext_tab = it_objbin

binary_tab = it_objbin2

EXCEPTIONS

failed = 1

OTHERS = 2.

IF sy-subrc <> 0.

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

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

ENDIF.

  • Entering names in the distribution list

wa_reclist-receiver = 'EMAIL@YAHOO.COM'.

wa_reclist-express = c_x.

wa_reclist-rec_type = c_u.

APPEND wa_reclist TO it_reclist.

  • Sending the document

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = wa_doc_data

put_in_outbox = c_x

commit_work = c_x

TABLES

packing_list = it_objpack

object_header = it_objhead

contents_bin = it_objbin2

receivers = it_reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

Just to clarify, in the outbox (SAP), I can see only 1 attachment is attached. But when I emailed it to my email, I can see 2 attachments (with the MESSAGE.DAT that is not supposed to be emailed). I also used my yahoo account. It also received the MESSAGE.DAT.

Is the message.dat done by SAP standard because I did not use any content_txt? ==> I don't need to write any texts in the email. Only an attachment is needed.

Do I need to use the contents_txt so that SAP will understand that I don't need to use the body of the email?

Thanks in advance.

Benedict

Read only

0 Likes
950

Hi,

Anyone familiar with my concern?

Just to clarify, in the outbox (SAP), I can see only 1 attachment is attached. But when I emailed it to my email, I can see 2 attachments (with the MESSAGE.DAT that is not supposed to be emailed). I also used my yahoo account. It also received the MESSAGE.DAT.

Is the message.dat done by SAP standard because I did not use any content_txt? ==> I don't need to write any texts in the email. Only an attachment is needed.

Do I need to use the contents_txt so that SAP will understand that I don't need to use the body of the email?

Thanks in advance.

Benedict

Read only

Former Member
0 Likes
950

don't know what solved the problem.