Skip to Content
author's profile photo Former Member
Former Member

mail sending - how to restrict from SAP inbox,

I am passing my internal table gt_message in the below FM code .

It is working fine.

1). HOWEVER I AM GETTING MAIL TO MY SAP INBOX.

*My functional consultant don't want this.*

How can I send only to mail id with out saving SAP mail.

2).

I am not able to send mails to other mails ids other than our outlook. We need to send mail to our customer.
How to do this . Please help / or just below coding is sufficient to send mail to external mailis like our customers ?

FORM send_email_message.

wa_doc_data-doc_size = 1.

wa_doc_data-obj_langu = sy-langu.

wa_doc_data-obj_name = 'SAPRPT'.

wa_doc_data-obj_descr = text-017. " 'Results of EDI 869 and 870'. " psubject.

wa_doc_data-sensitivty = 'F'.

CLEAR wa_packing_list.

REFRESH gt_packing_list.

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 gt_message LINES wa_packing_list-body_num.

wa_packing_list-doc_type = 'RAW'.

APPEND wa_packing_list TO gt_packing_list.

wa_receivers-receiver = 'mahesh.bagel at the rate cadi.com'.

wa_receivers-rec_type = 'U'.

wa_receivers-express = ' '.

wa_receivers-com_type = 'INT'.

wa_receivers-notif_del = 'X'.

wa_receivers-notif_ndel = 'X'.

APPEND wa_receivers TO gt_receivers.

CLEAR wa_receivers.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = wa_doc_data

put_in_outbox = 'X'

IMPORTING

sent_to_all = v_sent_all

TABLES

packing_list = gt_packing_list

contents_txt = gt_message

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

IF sy-subrc EQ 0.

COMMIT WORK.

ENDIF.

v_error = sy-subrc.

LOOP AT gt_receivers INTO wa_receivers.

ENDLOOP.

ENDFORM. " SEND_EMAIL_MESSAGE

Edited by: Sam Kumar on Oct 9, 2008 9:40 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2008 at 10:19 PM

    Nimesh,

    Sorry , it is not working. they are still going to SAP BOX.

    .....

    And one more problem is after output of the program when I press back button , I am getting pop up says

    title as

    'SAP office express info'
    'Express document "Cannot be sent : Results of EDI "  received from author "XXXXXX"'

    is coming ....

    HOW TO AVOID THIS POP UP ?

    THAN Q.

    Edited by: Sam Kumar on Oct 10, 2008 12:22 AM

    Add a comment
    10|10000 characters needed characters exceeded

    • wa_receivers-rec_type = 'U'.
      wa_receivers-express = ' '.   "here you are not specifying any thing 
      wa_receivers-com_type = 'INT'.

      even if you don't specify that option why are you getting the express option. are you using the same which you pasted above.

  • Posted on Oct 10, 2008 at 01:59 AM

    Hi,

    Make the rec_type as 'C'... this will be for the internet mail id...

    And then you can create a distribution list (SO23) and then create a dist. list for mass mailing...

    regards,

    Madan...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 09, 2008 at 09:53 PM

    In your call don't pass put_in_outbox = 'X'.

    Don't pass the Transmission Medium in the Receiver

    Like:

    
    wa_receivers-receiver = 'mahesh.bagel at the rate cadi.com'. 
    wa_receivers-rec_type = 'U'.
    wa_receivers-notif_del = 'X'.
    wa_receivers-notif_ndel = 'X'.
    APPEND wa_receivers TO gt_receivers.
    CLEAR wa_receivers.
    
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = wa_doc_data
    put_in_outbox = space   " <<
    IMPORTING
    sent_to_all = v_sent_all
    TABLES
    packing_list = gt_packing_list
    contents_txt = gt_message
    receivers = gt_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.
    IF sy-subrc EQ 0.
    COMMIT WORK.
    ENDIF.
    

    Regards,

    Naimesh Patel

    Edited by: Naimesh Patel on Oct 9, 2008 4:54 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2008 at 03:36 PM

    Iam sorry.

    I am using external mail id xxxxx at ya hoo.com

    because of which above error is populating .

    I have removed xxxxx at ya hoo.com, now the error not

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.