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

SAP script printout

Former Member
0 Likes
669

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
611

Hi,

You can check the link given below:

Hope you will get the solution of your problem.

Thanks & Regards,

Sarita Singh Rathour

4 REPLIES 4
Read only

Former Member
0 Likes
612

Hi,

You can check the link given below:

Hope you will get the solution of your problem.

Thanks & Regards,

Sarita Singh Rathour

Read only

Former Member
0 Likes
611

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

Read only

Former Member
0 Likes
611

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

Read only

Former Member
0 Likes
611

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