Application Development 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: 

How to Populate Sender Id in FM SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

Hi,

Refer to the given below thread

Former Member
0 Kudos

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.

0 Kudos

Hi,

where r u populating recepient id and sender's id.

and what is object id and what do we need to populate in it?

thanks,

pradeep

Former Member
0 Kudos

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