‎2009 Jul 07 3:52 AM
Hi,
I have got the output from my sap script.
I want to send the output as a mail to the concerned person.
In menu there is a send mail options but it is disabled.
How to send this SAP script output in a mail (either PDF or the same as output format.
‎2009 Jul 07 6:25 AM
‎2009 Jul 07 6:25 AM
‎2009 Jul 07 6:29 AM
Hi Ramya,
You can modify the driver program.
You can create the PDF file using spool request created and then send email using function module 'SO_DOCUMENT_SEND_API1'.
Regards,
Anil Salekar
‎2009 Jul 07 8:34 AM
step1:
use the FM CONVERT_OTF to convert otf to pdf.
step 2:
use the folowing code to convert the PDF to a required format and to move the exact content in g_objbin and g_objpack
LOOP AT t_line.
TRANSLATE t_line USING ' ~'.
CONCATENATE g_buffer t_line INTO g_buffer.
ENDLOOP.
TRANSLATE g_buffer USING '~ '.
DO.
g_message1 = g_buffer.
APPEND g_message1.
SHIFT g_buffer LEFT BY 255 PLACES.
IF g_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
g_objbin [] = g_message1 [] .
DESCRIBE TABLE g_objbin LINES g_lines_bin.
READ TABLE g_objbin INDEX g_lines_bin.
g_objpack-transf_bin = 'X'.
g_objpack-head_start = 1.
g_objpack-head_num = 0.
g_objpack-body_start = 1.
g_objpack-doc_size = ( g_lines_bin - 1 ) * 255 + STRLEN( g_objbin ).
g_objpack-body_num = g_lines_bin.
g_objpack-doc_type ='PDF'.
g_objpack-obj_name = text-009.
APPEND g_objpack.
step 3:
use teh following code to attach the content in mail and send it to a recevier
g_reclist-rec_type = 'F'.
g_reclist-fax = l_faxno.
g_reclist-country = 'USA'.
APPEND g_reclist.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = g_objpack
contents_bin = g_objbin
contents_txt = g_objtxt
receivers = g_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3.
-
let me know if you need any more help
Edited by: jeevitha krishnaraj on Jul 7, 2009 9:35 AM
‎2009 Jul 08 5:24 PM
Hi
You can pass communication parameters from function module call "OPEN_FORM".
and to get commnication parameters you have to use function modules "ADDR_GET_NEXT_COMM_TYPE" and "CONVERT_COMM_TYPE_DATA"
Please refer include RVADOPFO for NAST-NACHA EQ '5'
Thanks,
Santosh