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

SENDING PDF FORMS VAI MAILS

Former Member
0 Kudos
396

Dear friends,

I have to developed one object through which i can send

my invoice print in pdf format to the respected users email id.

Can this be also done via using attachment.

We are taking Print using va02 and out put type zsin.

Please help me out.

Thanks and Regards

vivek

4 REPLIES 4
Read only

Former Member
0 Kudos
372

Hello,

Use this FM modules SO_DOCUMENT_SEND_API1 and CONVERT_OTF_2_PDF.

Thank u ,

santhsoh

Edited by: santhosh kumar on Nov 26, 2008 6:52 AM

Read only

Former Member
0 Kudos
372

Hello,

Search in the SAP Forms you will find the solution.

Go through this link

Read only

former_member195383
Active Contributor
0 Kudos
372

convert the otf data to pdf data using

CONVERT_OTF_2_PDF

Collect the pdf data in tb_lines.

then use ...Here tb_attach should contain the data from tb_lines formatted properly.

wa_doc_data-obj_langu = 'EN'.

wa_doc_data-obj_name = 'SAPRPT'.

wa_doc_data-sensitivty = 'F'.

tb_packing_list-transf_bin = space.

tb_packing_list-head_start = 1.

tb_packing_list-head_num = 0.

tb_packing_list-body_start = 1.

DESCRIBE TABLE tb_message LINES tb_packing_list-body_num.

tb_packing_list-doc_type = 'RAW'.

APPEND tb_packing_list.

tb_packing_list-transf_bin = 'X'.

tb_packing_list-head_start = 1.

tb_packing_list-head_num = 1.

tb_packing_list-body_start = 1.

DESCRIBE TABLE tb_attach LINES tb_packing_list-body_num.

tb_packing_list-doc_type = '.PDF'.

tb_packing_list-obj_descr = wf_msg_file.

tb_packing_list-obj_name = wa_doc_data-obj_descr.

tb_packing_list-doc_size = tb_packing_list-body_num * 255.

tb_packing_list-obj_langu = 'EN'.

APPEND tb_packing_list.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = wa_doc_data

put_in_outbox = co_x

IMPORTING

sent_to_all = wf_sent_all

TABLES

packing_list = tb_packing_list

contents_bin = tb_attach

contents_txt = tb_message

receivers = tb_receivers

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.

hope the above helps u out

Read only

Former Member
0 Kudos
372

thanks