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

EMAIL

Former Member
0 Likes
857

Moderator message: please use a meaningful subject in future - and not ALL CAPITALS

I am using following perform for messaging, It is sending mail in CSV format, but I want to send the mail written in Outlook Message Body instead of CSV format, please advise.

Thanks,

LM

FORM set_emailbody.
  CONSTANTS:
  lc_doc_type(3) TYPE c VALUE 'CSV'. " Document type

  REFRESH : t_objpack,
  t_messbody.
  CLEAR : fs_objpack,
  fs_messbody.
  MOVE:
  'Hi,'(004) TO fs_messbody-line.
  APPEND fs_messbody TO t_messbody.

  CLEAR fs_messbody.

  MOVE:
*	'The attachment contains sales order details.'(005)
  'www.google.com'
  TO fs_messbody-line.
  APPEND fs_messbody TO t_messbody.


  CLEAR w_tabln.
  DESCRIBE TABLE t_messbody LINES w_tabln.

  CLEAR fs_messbody.
  READ TABLE t_messbody INTO fs_messbody INDEX w_tabln.

  fs_docdata-doc_size = ( w_tabln - 1 ) * 255 + STRLEN( w_line ).

  MOVE:
  space TO fs_objpack-transf_bin,
  c_1 TO fs_objpack-head_start,
  c_0 TO fs_objpack-head_num,
  c_1 TO fs_objpack-body_start,
  w_tabln TO fs_objpack-body_num,
  lc_doc_type TO fs_objpack-doc_type.

  APPEND fs_objpack TO t_objpack.

ENDFORM. " Set_emailbody

Edited by: Matt on Dec 15, 2008 12:47 PM - Added tags

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
819
* SEND MAIL
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
   EXPORTING
     document_data                    = lwa_doc_data
*     put_in_outbox                    = 'X'
     commit_work                      = 'X'
 IMPORTING
     sent_to_all                      = lv_sent_to_all
*   NEW_OBJECT_ID                    =
    TABLES
      packing_list                     = t_objpack    " Pass the table of body information here
*   OBJECT_HEADER                    =
      contents_bin                     = gt_messg_att  "Pass attachment info here
      contents_txt                     = t_messbody " pass the body contents here
*   CONTENTS_HEX                     =
*   OBJECT_PARA                      =
*   OBJECT_PARB                      =
      receivers                        = lgt_receivers " pass mail ids
   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
            .
6 REPLIES 6
Read only

Former Member
0 Likes
819

use object type is 'RAW'

gc_doc_type TYPE gs_objpack-doc_type VALUE 'RAW',

Read only

matt
Active Contributor
0 Likes
819

Please use a meaningful subject in future - and not ALL CAPITALS. Also, use to surround your ABAP - it preserves formatting.

Read only

Former Member
0 Likes
819

If I use RAW, instead of CSV it send the file in attachment with RAW, which again opens in ACROBAT while I want the same in OUTLOOP message body.

Please advise.

Thanks

Read only

Former Member
0 Likes
820
* SEND MAIL
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
   EXPORTING
     document_data                    = lwa_doc_data
*     put_in_outbox                    = 'X'
     commit_work                      = 'X'
 IMPORTING
     sent_to_all                      = lv_sent_to_all
*   NEW_OBJECT_ID                    =
    TABLES
      packing_list                     = t_objpack    " Pass the table of body information here
*   OBJECT_HEADER                    =
      contents_bin                     = gt_messg_att  "Pass attachment info here
      contents_txt                     = t_messbody " pass the body contents here
*   CONTENTS_HEX                     =
*   OBJECT_PARA                      =
*   OBJECT_PARB                      =
      receivers                        = lgt_receivers " pass mail ids
   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
            .
Read only

Former Member
0 Likes
819

Can I send CC also please advise.

Thanks

LM

Read only

0 Likes
819

I guess, answer is YES, anyways, also look FM MC_SEND_MAIL.

thanq