Application Development and Automation 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: 
Read only

Tcode SCOT

Former Member
0 Likes
1,015

Hello!

I am about to configure the Email sending via Tcode SCOT.

How can I test (send a dummy message in order to test the Mail Server settings)?

Thank you very much!

regards!

8 REPLIES 8
Read only

Former Member
0 Likes
875

Hi,

I think you can use the utility program <b>RSRA_MAIL</b> to send a test email to check if your settings are correct.

Hope this helps

Cheers

VJ

Read only

Former Member
0 Likes
875

You can use FM <b>SO_DOCUMENT_SEND_API1</b>

Greetings,

Blag.

Read only

Former Member
0 Likes
875

Try this, youll have to make a few changes

&----


*& Form SEND_EMAIL

&----


  • send t_output as an email to an internet address

----


FORM send_email.

IF p_esend EQ 'X'.

DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.

DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.

DATA: objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.

DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.

DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.

DATA: doc_chng LIKE sodocchgi1.

DATA: tab_lines LIKE sy-tabix.

*-- Creation of the document text/comments to be sent

doc_chng-obj_name = 'SENDFILE'.

doc_chng-obj_descr = 'HOF Email Notification.'.

objtxt = 'The HOF csv file was sent on:'.

APPEND objtxt.

objtxt = sy-datum.

APPEND objtxt.

objtxt = 'at'.

APPEND objtxt.

objtxt = sy-uzeit.

APPEND objtxt.

objtxt = ' '.

APPEND objtxt.

objtxt = 'for the following invoices:'.

APPEND objtxt.

objtxt = ' '.

APPEND objtxt.

CLEAR wa_data.

LOOP AT t_data INTO wa_data.

CONCATENATE wa_data-vbeln wa_data-posnr INTO objtxt.

APPEND objtxt.

ENDLOOP.

objtxt = ' '.

APPEND objtxt.

objtxt = 'I apologize for not personalizing this e-mail.'.

APPEND objtxt.

DESCRIBE TABLE objtxt LINES tab_lines.

READ TABLE objtxt INDEX tab_lines.

doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).

*-- creation of the entry for the compressed document

*-- we need to to let the FM work correctly i.e. it expect an attachment

CLEAR objpack-transf_bin.

objpack-head_start = 1.

objpack-head_num = 0.

objpack-body_start = 1.

objpack-body_num = tab_lines.

objpack-doc_type = 'RAW'.

APPEND objpack.

*-- creation of the document attachment (details)

*-- we only need this if we want to fill details into attachment

  • CLEAR wa_data.

  • LOOP AT t_data INTO wa_data.

  • objbin = wa_data.

  • APPEND objbin.

  • ENDLOOP.

  • DESCRIBE TABLE objbin LINES tab_lines.

*

*

  • objhead = 'filename.csv'.

  • APPEND objhead.

*-- creation of the entry for the compressed attachment

*-- include this if we want an attachment

  • objpack-transf_bin = ' '.

  • objpack-head_start = 1.

  • objpack-head_num = 1.

  • objpack-body_start = 1.

  • objpack-body_num = tab_lines.

  • objpack-doc_type = 'CSV'.

  • objpack-obj_name = 'HOF'.

  • objpack-obj_descr = 'filename.csv'.

  • objpack-doc_size = tab_lines * 255.

    • objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).

  • APPEND objpack.

  • completing the recipient list for email

CLEAR reclist.

reclist-receiver = p_email.

reclist-rec_type = 'U'.

APPEND reclist.

reclist-receiver = p_copy.

reclist-rec_type = 'U'.

reclist-com_type = 'INT'.

reclist-copy = 'X'.

APPEND reclist.

  • send the document

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = doc_chng

put_in_outbox = 'X'

TABLES

packing_list = objpack

  • object_header = objhead

  • contents_bin = objbin

contents_txt = objtxt

receivers = reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

  • error processing

CASE sy-subrc.

WHEN 0.

WRITE: / 'Result of the send process:'.

  • LOOP AT reclist.

IF reclist-retrn_code = 0.

WRITE / .

WRITE: 'The document was sent to: . . .'.

WRITE: /.

WRITE: p_email.

WRITE: /.

WRITE: p_copy.

ELSE.

WRITE 'The document could not be sent.'.

ENDIF.

  • ENDLOOP.

WHEN 1.

WRITE: / 'No authorization to send to that number of recipients.'.

WHEN 2.

WRITE: / 'Document could not be sent to any recipient.'.

WHEN 4.

WRITE: / 'No send authorization.'.

WHEN OTHERS.

WRITE: / 'Error occurred while sending.'.

ENDCASE.

ENDIF.

ENDFORM. " SEND_EMAIL

Read only

RaymondGiuseppi
Active Contributor
0 Likes
875

Just start the SAP Business Workplace via SBWP and send a message to an internet address.

SBWP - New message - Recip. type : U internet Address

Regards

Read only

0 Likes
875

Hi!

Thank you very much!

The Tcode SBWP is very helpful.

I have maintened my Email accout in Tcode SU01 and have send the Email via SBWP.

Unfortunately I do not received any message.

Is there some general SMTP (Mail Host settints)?

Or what is here the error?

Thank you!

regards

Read only

0 Likes
875

Hi thom,

1. The email does not go immediately.

2. U have to manually execute button, in SCOT, so that it is sent immedately.

3. Usually basis team, schedule this.

regards,

amit m.

Read only

0 Likes
875

Once you customize the email sending in SCOT (method, routes, etc.), you have to plan a job

SCOT -> Job -> Icon create -> Give a name to job, choose a variant (e.g. SAP&CONNECTALL) and (schedule job) choose periodically and put a period like 1-5 mn or so.

Regards

Read only

Former Member
0 Likes
875

<a href="http://www.tamboly.com/SAPEmailConfiguration.html">have a look into this link</a>

<a href="http://sap.ittoolbox.com/groups/technical-functional/sap-basis/mail-configuration-in-sap-967299?cv=expanded#">also have a look into this one</a>

regards,

srinivas