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

E-Mail not forwardable by SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Likes
639

Hi Experts,

I am using the FM SO_NEW_DOCUMENT_SEND_API1 to send email and the emails are going thru but the emails sent my program are not forwardable.

What we need to do to make the emails sent by this FM are forwardable.

Thanks,

Praveen

Hi Experts,

I am using the FM SO_NEW_DOCUMENT_SEND_API1 to send email and the emails are going thru but the emails sent my program are not forwardable.

What we need to do to make the emails sent by this FM are forwardable.

Thanks,

Praveen

3 REPLIES 3
Read only

Former Member
0 Likes
584

Hi.

If it's Showing Subrc = 0 .

Then Goto SCOT tcode and check ur SMTP settings for mail.

After that press Excute Button (CTRL+F7) choose ALL option and press Ok.

Now it will Work If any error is there then goto menu UTILITIES -> Overview of Sender (CTRL+F12) there u can check status of mail.

Salil....

Read only

Former Member
0 Likes
584

Hi,

Please check if you are sending the following:


* Fill the document data.
  DESCRIBE TABLE gt_message LINES gv_cnt.
  READ TABLE gt_message INTO gs_message
                                INDEX gv_cnt.
  gs_doc_chng-doc_size   = ( gv_cnt - 1 ) * 255 + STRLEN( gs_message ).
  gs_doc_chng-obj_langu  = sy-langu.
  gs_doc_chng-obj_name   = 'CONJOB'.
  gs_doc_chng-obj_descr  = text-017.
  gs_doc_chng-sensitivty = 'F'.
* Fill the receiver list
  gs_reclist-rec_date    = sy-datum.
  gs_reclist-rec_type    = 'U' .         " For Internet Address
  gs_reclist-com_type    = 'INT'.
  gs_reclist-notif_ndel  = c_x.
  gs_reclist-receiver    = p_email.       "Email addr of Recip
  APPEND gs_reclist TO gt_reclist.
  CLEAR gs_reclist.
  gs_packing_list-transf_bin = space.
  gs_packing_list-head_start = 1.
  gs_packing_list-head_num   = 0.
  gs_packing_list-body_start = 1.
  DESCRIBE TABLE gt_message LINES gs_packing_list-body_num.
  gs_packing_list-doc_type   = 'RAW'.
  APPEND gs_packing_list TO gt_packing_list.
  gs_packing_list-transf_bin = c_x.
  gs_packing_list-head_start = 1.
  gs_packing_list-head_num   = 0.
  gs_packing_list-body_start = 1.
  DESCRIBE TABLE pt_attachment LINES gs_packing_list-body_num.
  gs_packing_list-doc_type   = 'RAW'.
  gs_packing_list-obj_descr  = gv_atch_name.
  gs_packing_list-obj_name   = gv_atch_name.
  gs_packing_list-doc_size   = gs_packing_list-body_num * 255.
  APPEND gs_packing_list TO gt_packing_list.
* Send the document
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       EXPORTING
            document_data              = gs_doc_chng
            put_in_outbox              = c_x
       TABLES
            packing_list               = gt_packing_list
            contents_txt               = gt_message
            contents_bin               = pt_attachment
            receivers                  = gt_reclist
       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 e138(zv) WITH text-013.
  ENDIF.

Read only

Former Member
0 Likes
584

Hi Praveen,

Check this below... lines you can understand how to solve the issue.


SOMLRECI1-NO_FORWARD --(You cannot forward this message)

DATA: LT_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.

CLEAR LT_RECEIVERS.
REFRESH LT_RECEIVERS.
LT_RECEIVERS-RECEIVER   = GV_VENDOR_EMAIL.
LT_RECEIVERS-REC_TYPE   = 'U'.
LT_RECEIVERS-COM_TYPE   = 'INT'.
LT_RECEIVERS-NOTIF_READ = 'X'.
LT_RECEIVERS-NOTIF_DEL  = 'X'.
LT_RECEIVERS-NOTIF_NDEL = 'X'.
LT_RECEIVERS-NO_FORWARD = 'X'. "Check this field for farward or no forward Emails...
APPEND LT_RECEIVERS.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
  DOCUMENT_DATA = LW_DOC_DATA
  PUT_IN_OUTBOX = 'X'
TABLES
  PACKING_LIST  = LT_PACKING_LIST
  CONTENTS_TXT  = LT_MESSAGE
  RECEIVERS     = LT_RECEIVERS.

Thanks & regards,

Dileep .C