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

mail sending

Former Member
0 Likes
729

Hello experts,

How to send .CSV and PDF attachments in one mail using SO_NEW_DOCUMENT_ATT_SEND_API1.

When i try to send them .CSV is opening correctly but PDF attachments is saved as .PDF but the content is in excel format.

Please let me know what to do?

Thanks.

Ramya.

Hello experts,

How to send .CSV and PDF attachments in one mail using SO_NEW_DOCUMENT_ATT_SEND_API1.

When i try to send them .CSV is opening correctly but PDF attachments is saved as .PDF but the content is in excel format.

Please let me know what to do?

Thanks.

Ramya.

5 REPLIES 5
Read only

Former Member
0 Likes
704

Hi,

can you please show how do you fill the patameters of the FM.

Regards, Dieter

Read only

0 Likes
704

Regarding .CSV attachment

describe table it_objtxt lines l_no_lines.

w_objpack-head_start = c_1.

w_objpack-head_num = c_0.

w_objpack-body_start = c_1.

w_objpack-body_num = l_no_lines.

w_objpack-doc_type = c_doc_type.

APPEND w_objpack TO it_objpack.

DESCRIBE TABLE it_objbin LINES l_no_lines.

w_objhead = l_text1.

APPEND w_objhead TO it_objhead.

w_objpack-transf_bin = c_x.

w_objpack-head_start = c_1.

w_objpack-head_num = c_1.

w_objpack-body_start = c_1.

w_objpack-body_num = l_no_lines.

w_objpack-doc_type = c_doc_type1.

w_objpack-obj_name = l_text.

w_objpack-obj_descr = l_text .

w_objpack-obj_langu = c_eng.

w_objpack-doc_size = l_no_lines * 255.

APPEND w_objpack TO it_objpack .

Regarding .PDF attachment

DESCRIBE TABLE it_objbin LINES l_no_lines1.

l_no_lines1 = l_no_lines1 - l_no_lines.

w_objhead = l_text1.

APPEND w_objhead TO it_objhead.

w_objpack-transf_bin = c_x.

w_objpack-head_start = c_1.

w_objpack-head_num = c_1.

w_objpack-body_start = l_no_lines + c_1.

w_objpack-body_num = l_no_lines1.

w_objpack-doc_type = c_doc_type2.

w_objpack-obj_name = l_text.

w_objpack-obj_descr = l_text.

w_objpack-obj_langu = c_eng.

w_objpack-doc_size = l_no_lines1 * 255.

APPEND w_objpack TO it_objpack .

Thanks.

Ramya.

Read only

former_member203501
Active Contributor
0 Likes
704

Hi Ramya,

I have done a similar requirement for sending two different formats like excel and PDF in the same mail as attachments, here we have to use another function module afetr CONVERT_OTF

  • Convert OTF to PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = l_lines

TABLES

otf = i_otfdata

lines = i_tline

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

OTHERS = 4.

*Format OTF data

CALL FUNCTION 'QCE1_CONVERT'

TABLES

t_source_tab = i_tline

t_target_tab = i_record

EXCEPTIONS

convert_not_possible = 1

OTHERS = 2.

IF sy-subrc <> 0.

WRITE : / 'Error in conversion of pdf lines'(015).

ENDIF.

Hope it helps for you.

Regards,

Venkat Appikonda

Read only

0 Likes
704

Hi Venkat,

I used convert_otf also.

Problem is, it is creating PDF but when i try to open pdf,it is opening ad .CSV.

It is taking first attachment format ie .CSV.

Thanks.

Ramya.

Read only

Former Member
0 Likes
704

Solved myself