cancel
Showing results for 
Search instead for 
Did you mean: 

SCOT

Former Member
0 Kudos

dEAR FRIENDS

PLEASE TEL ME WHERE TO GIVE EMAIL ADDRESS WHEN I CALL FUNCTION

SO_NEW_DOCUMENT_ATT_SEND_API1

WHAT EXACTLY I WILL HAVE TO DO WITH SCOT TRANSACTION

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

ask basis people to do scot configuration

and we write code like below

DATA: ld_error TYPE sy-subrc,

ld_reciever TYPE sy-subrc,

ld_mtitle LIKE sodocchgi1-obj_descr,

ld_email LIKE somlreci1-receiver,

ld_email2 LIKE somlreci1-receiver,

ld_email3 LIKE somlreci1-receiver,

ld_format TYPE so_obj_tp ,

ld_attdescription TYPE so_obj_nam ,

ld_attfilename TYPE so_obj_des ,

ld_sender_address LIKE soextreci1-receiver,

ld_sender_address_type LIKE soextreci1-adr_typ,

ld_receiver LIKE sy-subrc.

data: t_packing_list like sopcklsti1 occurs 0 with header line,

t_contents like solisti1 occurs 0 with header line,

t_receivers like somlreci1 occurs 0 with header line,

t_attachment like solisti1 occurs 0 with header line,

t_object_header like solisti1 occurs 0 with header line,

w_cnt type i,

w_sent_all(1) type c,

w_doc_data like sodocchgi1.

ld_email = p_email.

ld_email2 = p_email2.

ld_email3 = p_email3.

ld_mtitle = p_mtitle.

ld_format = p_format.

ld_attdescription = p_attdescription.

ld_attfilename = p_filename.

ld_sender_address = p_sender_address.

ld_sender_address_type = p_sender_addres_type.

  • Fill the document data.

w_doc_data-doc_size = 1.

  • Populate the subject/generic message attributes

w_doc_data-obj_langu = sy-langu.

w_doc_data-obj_name = 'SAPRPT'.

w_doc_data-obj_descr = ld_mtitle .

w_doc_data-sensitivty = 'F'.

  • Fill the document data and get size of attachment

CLEAR w_doc_data.

READ TABLE it_attach INDEX w_cnt.

w_doc_data-doc_size =

( w_cnt - 1 ) * 255 + STRLEN( it_attach ).

w_doc_data-obj_langu = sy-langu.

w_doc_data-obj_name = 'SAPRPT'.

w_doc_data-obj_descr = ld_mtitle.

w_doc_data-sensitivty = 'F'.

CLEAR t_attachment.

REFRESH t_attachment.

t_attachment[] = it_attach[].

  • Describe the body of the message

CLEAR t_packing_list.

REFRESH t_packing_list.

t_packing_list-transf_bin = space.

t_packing_list-head_start = 1.

t_packing_list-head_num = 0.

t_packing_list-body_start = 1.

DESCRIBE TABLE it_message LINES t_packing_list-body_num.

t_packing_list-doc_type = 'RAW'.

APPEND t_packing_list.

  • Create attachment notification

t_packing_list-transf_bin = 'X'.

t_packing_list-head_start = 1.

t_packing_list-head_num = 1.

t_packing_list-body_start = 1.

DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.

t_packing_list-doc_type = ld_format.

t_packing_list-obj_descr = ld_attdescription.

t_packing_list-obj_name = ld_attfilename.

t_packing_list-doc_size = t_packing_list-body_num * 255.

APPEND t_packing_list.

  • Add the recipients email address

CLEAR t_receivers.

REFRESH t_receivers.

t_receivers-receiver = ld_email.

t_receivers-rec_type = 'U'.

t_receivers-com_type = 'INT'.

t_receivers-notif_del = 'X'.

t_receivers-notif_ndel = 'X'.

APPEND t_receivers.

CLEAR t_receivers.

t_receivers-receiver = ld_email2.

t_receivers-rec_type = 'U'.

t_receivers-com_type = 'INT'.

t_receivers-notif_del = 'X'.

t_receivers-notif_ndel = 'X'.

APPEND t_receivers.

CLEAR t_receivers.

t_receivers-receiver = ld_email3.

t_receivers-rec_type = 'U'.

t_receivers-com_type = 'INT'.

t_receivers-notif_del = 'X'.

t_receivers-notif_ndel = 'X'.

APPEND t_receivers.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = w_doc_data

put_in_outbox = 'X'

sender_address = ld_sender_address

sender_address_type = ld_sender_address_type

commit_work = 'X'

IMPORTING

sent_to_all = w_sent_all

TABLES

packing_list = t_packing_list

contents_bin = t_attachment

contents_txt = it_message

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

submit rstxpdft4

with spoolno = rspool_id

and return.

Former Member
0 Kudos

HI FRIEND

ld_email = p_email.

ld_email2 = p_email2.

ld_email3 = p_email3.

ld_mtitle = p_mtitle.

ld_format = p_format.

ld_attdescription = p_attdescription.

ld_attfilename = p_filename.

ld_sender_address = p_sender_address.

ld_sender_address_type = p_sender_addres_type.

IN THE ABOVE CODING....WHETHER I WILL HAVE TO PLACE THE email aDDRESS IN PALACE OF 'ID' OR I WILL JUST HAVE TO KEEP IT LIKE THIS ONLY...

Former Member
0 Kudos

hi

can you send me the same coding bye feeling each data like ...so it would be helpful for me...

regards

rohan

Former Member
0 Kudos

hi i have sent u coding and screenshots in the mail

please check it

Answers (5)

Answers (5)

Former Member
0 Kudos

1. Run transaction SCOT.

Double click on SMTP node which inside node INT.

In SAPconnect: General node data, click on 'SET' button which is in front of Internet option.

In next window, maintain desired email address in Address Area.

2. Also, you have to maintain email address using suitable transaction, depending on whose email address it is. For example, if you are trying to send email to Vendor, maintain email ID using FK02 transaction. email address is maintained in communication block of basic data screen.

Edited by: Ashwin Sonkusare on Aug 28, 2008 8:33 AM

former_member181995
Active Contributor
0 Kudos

Reciever address must me in Table parameter RECEIVERS-RECEIVER.

Former Member
0 Kudos

you need to pass your mail address

like

P_email = e-mail address

First you need to check with your requirement, whether you want to send this mail to sap inbox or external mail.

if this is the case you just ask your basis people to configure.

Former Member
0 Kudos

hi some "RISE EXCEPTION" ERROR HAS OCCURED

Former Member
0 Kudos

See the above code is not for copy, paste & Execute

You need to write code according to your requirement

this is an example

Former Member
0 Kudos

Hi Rohan,

Check out this link. This will definitely help you.

Regards,

Chandra Sekhar

Former Member
0 Kudos

hi,

In RECLIST-RECEIVER field.

check th documentation of the FM. It has a demo report code.

Regards,

Anirban