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

How to Populate Sender Id in FM SO_NEW_DOCUMENT_SEND_API1

Hi Friends,

I am using FM SO_NEW_DOCUMENT_SEND_API1 for sending an email to the users. Though everything is working fine but I want to set the sender id.

For example any user may run the report but in sender name it should come accountspayable at the rate abc dot com

How and where I can set the sender id.

I have tried populating it in receiver list but of no use.

code of the program

-


wa_recv_list-receiver = wa_data-email. (receiver mail id)

wa_recv_list-rec_type = 'U'.

wa_recv_list-express = 'X'.

APPEND wa_recv_list TO recv_list.

CLEAR wa_recv_list.

wa_recv_list-receiver = sender.

wa_recv_list-rec_type = 'U'.

APPEND wa_recv_list TO recv_list.

CLEAR wa_recv_list.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = doc_data

document_type = 'RAW'

commit_work = 'X'

TABLES

object_content = objtxt

receivers = recv_list

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.

Kindly help.

Pradeep

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

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

    Hi,

    Refer to the given below thread

    sodocumentsendapi1---sender-mail-address

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2008 at 10:42 AM

    Hello,

    I think it will be helpfull for you please check it....

    DATA receiver LIKE somlreci1 OCCURS 1 WITH HEADER LINE.

    DATA object_id LIKE soodk.

    MOVE: sy-uname TO receiver-receiver,

    'X' TO receiver-express,

    'B' TO receiver-rec_type.

    APPEND receiver.

    • insert mail description

    WRITE 'Sending a mail through abap'

    TO doc_data-obj_descr.

    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

    EXPORTING

    document_data = doc_data

    IMPORTING

    new_object_id = object_id

    TABLES

    object_content = objcont

    receivers = receiver

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2008 at 10:43 AM

    Hi,

    You can use 'SO_DOCUMENT_SEND_API1' FM

    In this you can sene the Sender Id as well

    ****************************

    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

    EXPORTING

    document_data = lv_doc_data

    put_in_outbox = 'X'

    sender_address = lv_sender_address

    sender_address_type = lv_sender_address_type

    commit_work = 'X'

    IMPORTING

    sent_to_all = lv_sent_all

    new_object_id = new_object_id

    • SENDER_ID =

    TABLES

    packing_list = it_packing_list

    • OBJECT_HEADER =

    • CONTENTS_BIN =

    contents_txt = it_message

    • CONTENTS_HEX =

    • OBJECT_PARA =

    • OBJECT_PARB =

    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

    .

    **********************

    Regards,

    Syed

    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.