Skip to Content
0
Nov 21, 2011 at 07:44 AM

How can I set the language when sending an e-mail with attachment - 'Html'?

50 Views

"Character Broken"

I made an ALV program, and this convert to "HTML', and send an e-mail with this.

Used Process is:

DATA: gt_abaplist LIKE TABLE OF abaplist,
      gt_html LIKE TABLE OF w3html,
      doc_chng LIKE sodocchgi1,
      objpack LIKE TABLE OF sopcklsti1 WITH HEADER LINE,
      objhead LIKE TABLE OF solisti1 WITH HEADER LINE,
      mail LIKE TABLE OF solisti1 WITH HEADER LINE,
      reclist LIKE TABLE OF somlreci1 WITH HEADER LINE,
      lv_line TYPE i.

DELETE FROM MEMORY ID '%_LIST'.

SUBMIT z_template
   AND RETURN EXPORTING LIST TO MEMORY.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = gt_abaplist
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.

CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
  TABLES
    html       = gt_html
    listobject = gt_abaplist.

doc_chng-obj_name   = 'URGENT'.
doc_chng-sensitivty = 'O'.
doc_chng-obj_descr  = ' '.
doc_chng-obj_langu  = '3'.
objhead-line        = ' '.
APPEND objhead.

mail[] = gt_html[].
DESCRIBE TABLE mail LINES lv_line.

CLEAR: objpack.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num   = 0.
objpack-body_start = 1.
objpack-body_num   = lv_line.
objpack-doc_type   = 'htm'.
objpack-obj_descr  = ' '.  
objpack-doc_size   = lv_line * 255.
objpack-obj_langu = '3'.
APPEND objpack.

CLEAR: reclist.
reclist-receiver = 'e-mail address'. 
reclist-rec_type = 'U'.
APPEND reclist.


CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    document_data              = doc_chng  
    put_in_outbox              = 'X'
    commit_work                = 'X'
  TABLES
    packing_list               = objpack
    object_header              = objhead
    contents_bin               = mail
    receivers                  = reclist
  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.

SUBMIT rsconn01 AND RETURN.

I want to show this by "Japanese".

But the character is broken.

LIke This:

u01D1u072C     	u0205|       	u0205u072C     	u0508      	QC u04B90m

How can I set the language? How can I solve "Charancter Broken" ?

Plesse, let me know.

Thank you so much.

Edited by: Jaime White 999 on Nov 21, 2011 8:45 AM

Edited by: Jaime White 999 on Nov 21, 2011 8:46 AM