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

hi need to send email with msg pls suggest a code to do so

hi

i want to send email to users with a simple message like for eg shipment shipped

please suggest some code for it how to do it

regards

Nishant

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Nov 16, 2007 at 04:58 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 16, 2007 at 04:56 PM
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Naimesh Patel

      hi Patel

      its not working as i already tested it did it works for u pls comment

      also the code in the link has lots of errros in it and its difficult for me to update on all withouth understanding on it?

      Please suggset some workable code if u can ...

      regards

      nishant

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2007 at 07:01 PM

    Here is a simple macro to do this. Obviously this is not generic enough, but it is very easy to tweak this to do whatever you want.

    define send_mail.

    data : header_text(40).

    object_hd_change-objla = sy-langu.

    read textpool sy-repid into text_tab language sy-langu.

    read table text_tab with key id = 'R'.

    move text_tab-entry to object_hd_change-objnam.

    concatenate text_tab-entry ' Error ' into

    object_hd_change-objdes separated by space.

    object_hd_change-objsns = 'C'. "SENSITIVITY

    objcont-line = 'The following messages were received:'.

    append objcont.

    clear objcont.

    objcont-line = ' '.

    append objcont.

    clear objcont.

    objcont-line = &1.

    append objcont.

    receivers-recesc = 'B'. "SAPmail to SAP user

    receivers-recextnam = sy-uname.

    receivers-recnam = sy-uname.

    receivers-sndex = 'X'.

    receivers-rcdat = sy-datum.

    receivers-rctim = sy-uzeit.

    append receivers.

    call function 'SO_OBJECT_SEND'

    exporting

    object_hd_change = object_hd_change

    object_type = object_type

    tables

    objcont = objcont

    objhead = objhead

    objpara = objpara

    objparb = objparb

    receivers = receivers

    exceptions

    active_user_not_exist = 1

    communication_failure = 2

    component_not_available = 3

    folder_not_exist = 4

    folder_no_authorization = 5

    forwarder_not_exist = 6

    note_not_exist = 7

    object_not_exist = 8

    object_not_sent = 9

    object_no_authorization = 10

    object_type_not_exist = 11

    operation_no_authorization = 12

    owner_not_exist = 13

    parameter_error = 14

    substitute_not_active = 15

    substitute_not_defined = 16

    system_failure = 17

    too_much_receivers = 18

    user_not_exist = 19

    x_error = 20

    others = 21.

    if sy-subrc <> 0.

    write :/ 'Error Sending the Object', sy-subrc.

    else.

    Commit work.

    endif.

    end-of-definition.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2007 at 07:27 PM

    Check out in the forum...you can find suitable stuff for your requirement.

    Thanks,

    Srinivas

    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.