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

Using SO_DOCUMENT_SEND_API1

Former Member
0 Likes
351

Hi ,

I am using this FM(SO_DOCUMENT_SEND_API1) for sending mail as attachment to mail recepient .

code:

FORM send_email .

data : l_date type datum,

l_date1 type datum.

perform get_email_recepient.

if v_flag IS initial.

  • Selecting PARM2 Data from database which holds the all Mail-id's

PERFORM HEADING.

**********Email Size

DESCRIBE TABLE it_final LINES w_fsize.

**********Email Text

write s_audat-low to l_date mm/dd/yy.

write s_audat-high to l_date1 mm/dd/yy.

CLEAR wa_mailtext.

REFRESH it_mailtext.

CONCATENATE 'Pl. find attached Credit Fraud report from ' l_date 'to' l_date1

INTO wa_mailtext SEPARATED BY space.

APPEND wa_mailtext TO it_mailtext.

IF s_audat-high IS INITIAL.

write s_audat-low to l_date mm/dd/yy.

CLEAR wa_mailtext.

REFRESH it_mailtext.

CONCATENATE 'Pl. find attached Credit Fraud report for ' l_date

INTO wa_mailtext SEPARATED BY space.

APPEND wa_mailtext TO it_mailtext.

ENDIF.

DESCRIBE TABLE it_mailtext LINES w_text_sz.

    • Fill the document data.

READ TABLE it_mailtext INTO WA_mailtext INDEX w_text_sz.

wa_doc_chng-obj_name = text-003.

wa_doc_chng-obj_descr = text-003.

wa_doc_chng-sensitivty = 'O'.

wa_doc_chng-doc_size = ( w_text_sz - 1 ) * 255 + STRLEN( WA_mailtext ).

  • APPEND WA_DOC_CHNG TO IT_DOC_CHNG.

wa_objpack-head_start = 1.

wa_objpack-head_num = 1.

wa_objpack-body_start = 1.

  • wa_objpack-body_num = 10.

wa_objpack-body_num = w_text_sz.

wa_objpack-doc_type = 'RAW'.

APPEND wa_objpack TO it_objpack.

    • Describe the body of the message

CLEAR wa_objpack.

DESCRIBE TABLE it_objbin LINES w_tab_lines.

    • Fill the document data and get size of attachment

wa_objpack-transf_bin = 'X'.

wa_objpack-head_start = 1.

wa_objpack-head_num = 1.

wa_objpack-body_start = 1.

wa_objpack-body_num = w_tab_lines.

wa_objpack-doc_type = 'XLS'.

wa_objpack-obj_name = wa_doc_chng-obj_name.

wa_objpack-obj_descr = wa_doc_chng-obj_descr.

wa_objpack-doc_size = w_tab_lines * 255.

APPEND wa_objpack TO it_objpack.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = wa_doc_chng

put_in_outbox = 'X'

commit_work = 'X'

IMPORTING

sent_to_all = w_sent

TABLES

packing_list = it_objpack

contents_bin = it_objbin

contents_txt = it_mailtext

receivers = it_receiver

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.

IF sy-subrc <> 0.

message 'No Email are sent' type 'I'.

ENDIF.

/endcode.

in mailtext i am getting text as

'Pl. find attached Credit Fraud report from 01/21/08 in first line

but

i want 4 lines to skip.

its urgent.

Thanks

Aruna.

2 REPLIES 2
Read only

Former Member
0 Likes
317

Hi aruna,

have u tried giving like this.

APPEND wa_mailtext TO it_mailtext.

ENDIF.

skip 4.

DESCRIBE TABLE it_mailtext LINES w_text_sz.

check it may work...

if u have tried like that then let me know whts the problem ur getting

regards,

karan

Edited by: karan kakkad on Feb 4, 2008 4:47 PM

Read only

Former Member
0 Likes
317

I think you can append 4 blank lines and then populate the mail text.

Thanks,

Vamshi.