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

Need an E-mail related Function Module

Former Member
0 Likes
648

Hi,

I need to send some kind of information or rather some notifications to the clients via e-mail. Thew information is in TEXT format. I have used FM"SO_OBJECT_SEND" but didnt helped me.

This E-mail function would be triggered if there's any kind of failure in the transaction and the same has to be notified to the clients.

Please suggest.

Thanks & Regards,

5 REPLIES 5
Read only

Former Member
0 Likes
624

Hi,

Try 'SO_NEW_DOCUMENT_ATT_SEND_API1' Fn module.

Regards,

Gayathri

Read only

ferry_lianto
Active Contributor
0 Likes
624

Hi Rajesh,

Please check this links for sample code.

http://www.sapgenie.com/abap/code/abap31.htm

http://www.sapgenie.com/abap/code/abap25.htm

http://www.sapgenie.com/abap/code/abap15.htm

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
624

hai rajesh,

here this link describes step by step procedure for sending e-mails in sap.

http://www.sap-basis-abap.com/sapbs035.htm

this is weblog which discuss sending mails using smart forms.

/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp

hope this is helpful.

regards,

praba.

Read only

vinod_gunaware2
Active Contributor
0 Likes
624

This abap mail sending program demonstrate how you can send a mail to the user SAP Office mailbox.

REPORT ZSEND .

TABLES: KNA1.

  • data for send function

DATA DOC_DATA LIKE SODOCCHGI1.

DATA OBJECT_ID LIKE SOODK.

DATA OBJCONT LIKE SOLI OCCURS 10 WITH HEADER LINE.

DATA RECEIVER LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.

SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.

WRITE:/ KNA1-KUNNR, KNA1-ANRED.

  • send data internal table

CONCATENATE KNA1-KUNNR KNA1-ANRED

INTO OBJCONT-LINE SEPARATED BY SPACE.

APPEND OBJCONT.

ENDSELECT.

  • insert receiver (sap name)

REFRESH RECEIVER.

CLEAR RECEIVER.

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.

regards

vinod

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
624

Hi,

Check these links for sample code.

http://www.sap-img.com/fu016.htm

http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html

http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp

Kindly reward points by clicking the star on the left of reply,if it helps.