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

how to send mail

Former Member
0 Likes
436

Hi experts ,

i badly need ur help .

I have an ALV report and when this report displays its output i will have to add a functionality to it .

i ill have to add a button to it called "mail" .

when we will press this button a space should com or neway i want to write the mail and by some means i want to send this text to some recipient addresses .

plz tell me how i can do it .

i dnt have ne idea bout sending a mail .

Regards

thanx

Hi experts ,

i badly need ur help .

I have an ALV report and when this report displays its output i will have to add a functionality to it .

i ill have to add a button to it called "mail" .

when we will press this button a space should com or neway i want to write the mail and by some means i want to send this text to some recipient addresses .

plz tell me how i can do it .

i dnt have ne idea bout sending a mail .

Regards

thanx

2 REPLIES 2
Read only

Former Member
0 Likes
404

hi check this report ..or u can call this report in your program...

report zrich_0003 .

data: maildata like sodocchgi1.

data: mailtxt like solisti1 occurs 10 with header line.

data: mailrec like somlrec90 occurs 0 with header line.

data: list type table of abaplist with header line.

data: ascilines(1024) type c occurs 0 with header line.

data: htmllines type table of w3html with header line.

start-of-selection.

submit <zreport> exporting list to memory and return.

call function 'LIST_FROM_MEMORY'

tables

listobject = list

exceptions

not_found = 1

others = 2.

call function 'LIST_TO_ASCI'

tables

listobject = list

listasci = ascilines

exceptions

empty_list = 1

list_index_invalid = 2

others = 3.

call function 'WWW_HTML_FROM_LISTOBJECT'

tables

html = htmllines

listobject = list.

clear: maildata, mailtxt, mailrec.

refresh: mailtxt, mailrec.

maildata-obj_name = 'TEST'.

maildata-obj_descr = 'Test Subject'.

loop at htmllines.

mailtxt = htmllines.

append mailtxt.

endloop.

mailrec-receiver = 'you@yourcompany'.

mailrec-rec_type = 'U'.

append mailrec.

call function 'SO_NEW_DOCUMENT_SEND_API1'

exporting

document_data = maildata

document_type = 'HTM'

put_in_outbox = 'X'

tables

object_header = mailtxt

object_content = mailtxt

receivers = mailrec

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.

  • This will trigger the send process in SAPconnent

  • submit rsconn01 with mode = 'INT'

  • with output = 'X'

  • and return.

regards,

venkat.