2008 Jan 03 9:37 AM
i have scenario like.
i want to send out put of an report through email .
ex: output of a sales/purchase order is sent automatically to
a receipent through email.( sap logan client is enough).
can any on help me in this plzz.
explain the procedure completely, and where i write code to genarate sales order.
i have scenario like.
i want to send out put of an report through email .
ex: output of a sales/purchase order is sent automatically to
a receipent through email.( sap logan client is enough).
can any on help me in this plzz.
explain the procedure completely, and where i write code to genarate sales order.
2008 Jan 03 9:43 AM
Hi ChandraSekhar,
Check this link..
http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
2008 Jan 03 9:44 AM
HI,
EXECUTE THE PGM IN MENU THERE IS A OPTION LIST-----
SAVE/SEND--
2008 Jan 03 9:45 AM
in alv there is button for mail receipient (ctrl+F7)
and send mail
& if u want through program then
pls check
Check the FM's.
use the fun module
SX_OBJECT_CONVERT_OTF_PDF
to convert to PDF and use SO_NEW_DOCUMENT_ATT_SEND_API1 fun module
to send mail
Check this
data: maildata type sodocchgi1.
data: mailtxt type table of solisti1 with header line.
data: mailrec type table of somlrec90 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'This is a test'.
append mailtxt.
mailrec-receiver = 'your mail id'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
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.
Start the send process with this code or go to transaction SCOT
submit rsconn01 with mode = 'INT' and return.
Check these links too
http://www.sap-img.com/abap/sending-email-with-attachment.htm
http://www.erpgenie.com/abap/code/abap20.htm
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
Thanks,
Reward If Helpful.
2008 Jan 03 9:49 AM
hi,
&----
*& Form validate_mail
&----
Validates Email entered
----
-->P_P_MAIL text
----
FORM validate_mail USING P_P_MAIL.
data: lv_search type sy-fdpos,
lv_length type i,
lv_len_name type i,
lv_len_domain type i,
lv_name(100) type c,
lv_domain(100) type c.
clear indicator for mail validation which is used to raise error msg
clear: wf_mail,
lv_Search,
lv_length,
lv_len_name,
lv_len_domain,
lv_name,
lv_domain.
Calculate the length of the email field.
lv_length = strlen( p_gv_email ) - 1.
If the first or last letter is '@' or '.', terminate the subroutine.
if p_gv_email(1) = co_attherateof or p_gv_email(1) = co_dot.
wf_mail = 1.
exit.
elseif p_gv_email+lv_length(1) = co_attherateof
or p_gv_email+lv_length(1) = co_dot.
wf_mail = 1.
exit.
endif.
Check if '@', and '.' exists or not.
if p_gv_email np '@' or p_gv_email np '.'.
wf_mail = 1.
exit.
endif.
Check for white space in email field.
if p_gv_email(lv_length) ca ' '.
wf_mail = 1.
exit.
endif.
Look for '@' and separate name, domain for validations.
search p_gv_email for co_attherateof.
if sy-subrc = 0.
lv_Search = sy-fdpos.
lv_name = p_gv_email+0(lv_Search).
lv_Search = lv_Search + 1.
lv_domain = p_gv_email+lv_Search.
endif.
Check if name or domain is empty.
if lv_name is initial or lv_domain is initial.
wf_mail = 1.
exit.
endif.
Calculate the length of each field.
lv_len_name = strlen( lv_name ).
lv_len_domain = strlen( lv_domain ).
Validate lv_name and lv_domain for second '@'.
if lv_name cp '@' or lv_domain cp '@'.
wf_mail = 1.
exit.
endif.
Validate for min. one dot and max. two dots in domain field.
if lv_domain cp '.'.
clear lv_search.
lv_Search = sy-fdpos.
if lv_search = 0.
wf_mail = 1.
exit.
else.
lv_Search = lv_Search + 1.
if lv_domain+lv_search cp '.'.
if sy-fdpos = 0.
wf_mail = 1.
exit.
else.
lv_Search = lv_search + sy-fdpos + 1.
if lv_domain+lv_Search cp '.'.
wf_mail = 1.
exit.
endif.
endif.
endif.
endif.
else.
wf_mail = 1.
exit.
endif.
ENDFORM. " validate_mail