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

Send E-Mail HTM Type

former_member212713
Contributor
0 Likes
4,643

Hello Experts;

I want to send e-mail from SAP via Exch for HTML Type.

I researched and looked at internet for this subject. Some Experts say "You must insert HTM type to TSOTD table." I tried HTM type insert to it. But It give insert error. "No function can be used with the selected object type"

Maybe before insert to TSOTD, I must insert to different tables. But I dont know these tables or process.

We are using still SAP 4.6c. I'm using FM SO_NEW_DOCUMENT_SEND_API1.

Mr. Rich Heilman say "HTM mail send possible at 4.6c"

However Now I am sending RAW etc. types email from SAP to Outlook Via Exch. I haven't problem this process. I have only problem "send HTM Type mails".

What should I do at SAP for send HTM mails ?

Thanks.

3 REPLIES 3
Read only

Former Member
0 Likes
3,654

data : wa_doc_data TYPE SODOCCHGI1 .

data : lt_content TYPE STANDARD TABLE OF SOLISTI1,

wa_content TYPE SOLISTI1.

data : lt_receivers TYPE STANDARD TABLE OF SOMLRECI1,

wa_receivers TYPE SOMLRECI1.

**For filling content.

wa_content-LINE = '<p> <span style="color:green">different text color</span> </p>'.

APPEND wa_content to lt_content.

clear : wa_content.

wa_content-LINE = '<p style="background-color:yellow"> Thirukumaran </p>'.

APPEND wa_content to lt_content.

clear : wa_content.

wa_content-LINE = '<B><U>Test Program for Send Mail.</U></B> <BR>' ."'The out put data & & & reRegards Vivek Deshpande'.

APPEND wa_content to lt_content.

clear : wa_content.

*for receivers email id.

wa_receivers-receiver = ''.

wa_receivers-rec_type = 'U'.

APPEND wa_receivers to lt_receivers.

wa_doc_data-OBJ_DESCR = 'This is test mail subject'.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = wa_doc_data

DOCUMENT_TYPE = 'HTM'

COMMIT_WORK = 'X'

  • IMPORTING

  • SENT_TO_ALL =

  • NEW_OBJECT_ID =

tables

  • OBJECT_HEADER =

OBJECT_CONTENT = lt_content

  • CONTENTS_HEX =

  • OBJECT_PARA =

  • OBJECT_PARB =

receivers = lt_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

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

Former Member
0 Likes
3,654

Hi,

Are you sending abap list as an attachment if so check whether note 211973 will be helpful to you.

Also some more note is there, just check at market place.

Thanks & Regards,

Jayanth

Read only

former_member212713
Contributor
0 Likes
3,654

I solved my problem.

I have been using FM "SO_NEW_DOCUMENT_SEND_API1". But It's unsuccessfull for send HTM mail.

Now I'm using FM "SO_DOCUMENT_SEND_API1". It's great and result is successfull for send HTM mail.

But I don't understand Why is FM "SO_NEW_DOCUMENT_SEND_API1" unsuccessfull or What is difference between two FMs?

Thanks.