Skip to Content
0
Former Member
Jun 29, 2007 at 02:53 PM

Lines Display when sending E-Mail using SO_NEW_DOCUMENT_ATT_SEND_API1

14 Views

Good Afternoon,

I'm using the following code to send e-Mails:

  LOOP AT t_z3emailusr INTO w_z3emailusr.

    t_receivers-receiver = w_z3emailusr-email.
    t_receivers-rec_type = 'U'.
    t_receivers-express  = 'X'.

    APPEND t_receivers.

  ENDLOOP.

  MOVE text-003 TO t_mailtxt-line.
  APPEND t_mailtxt.

  CLEAR t_mailtxt-line.
  APPEND t_mailtxt.

  MOVE text-001 TO t_mailtxt-line.
  APPEND t_mailtxt.

  CLEAR t_mailtxt-line.
  APPEND t_mailtxt.

  LOOP AT t_apqi INTO w_apqi.
    MOVE w_apqi-groupid TO t_mailtxt-line.
    APPEND t_mailtxt.
  ENDLOOP.

  MOVE text-002 TO t_mailtxt-line.
  APPEND t_mailtxt.

  CLEAR t_mailtxt-line.
  APPEND t_mailtxt.

  MOVE text-003 TO t_mailtxt-line.
  APPEND t_mailtxt.

  MOVE text-004 TO t_mailtxt-line.
  APPEND t_mailtxt.

  CLEAR t_mailtxt.

  DESCRIBE TABLE t_mailtxt LINES mailtxt_size.

  MOVE text-000 TO t_doc_att-obj_descr.
  MOVE sy-langu TO t_doc_att-obj_langu.
  MOVE 'O'      TO t_doc_att-sensitivty.

  t_doc_att-doc_size = mailtxt_size * 255.

  CLEAR t_mailpack-transf_bin.

  MOVE 1 TO t_mailpack-head_start.

  CLEAR t_mailpack-head_num.

  MOVE 1            TO t_mailpack-body_start.
  MOVE mailtxt_size TO t_mailpack-body_num.
  MOVE 'HTM'        TO t_mailpack-doc_type.
  MOVE sy-langu     TO t_mailpack-obj_langu.

  APPEND t_mailpack.

  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = t_doc_att
      put_in_outbox              = 'X'
    TABLES
      packing_list               = t_mailpack
      contents_txt               = t_mailtxt
      receivers                  = t_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.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Everything is ok except for the text...

Although i'm appending lines in t_mailtxt the text of the e-mail is continuous...

How to display text with "line breaks"? Do i need to change the doc_type of t_mailpack?

Regards,

Pedro Gaspar