송신자 지정 메일

*&---------------------------------------------------------------------*
*& Report  ZEXCELEMAILTEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ztestmail.
CONSTANTS:  con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
DATA:    w_doc_data     LIKE    sodocchgi1,
             t_packing_list   LIKE    sopcklsti1 OCCURS 0 WITH HEADER
LINE,
             t_attachment    LIKE    solisti1 OCCURS 0 WITH HEADER LINE,

             it_message      LIKE    solisti1 OCCURS 0 WITH HEADER LINE,

             t_receivers       LIKE    somlreci1 OCCURS 0 WITH HEADER
LINE.
DATA:    BEGIN OF itab OCCURS 0, "Excel로 될 Internal Table
             name(10) TYPE c,
             sex(4)      TYPE c,
             END OF itab.
itab-name = 'Yuanhailin'.itab-sex = 'Boy'.APPEND itab.
itab-name = 'Wondergirl'.itab-sex = 'Girl'.APPEND itab.
CONCATENATE 'MANE' 'SEX ' INTO t_attachment SEPARATED BY ','.
APPEND t_attachment.
LOOP AT itab.
  CONCATENATE itab-name itab-sex INTO t_attachment SEPARATED BY ','.
  CONCATENATE con_cret t_attachment INTO t_attachment.
  APPEND t_attachment.
ENDLOOP.
it_message = '안녕하세요?'.
APPEND it_message.
it_message = '본문 내용 입니다'.
APPEND it_message.
w_doc_data-doc_size = STRLEN( t_attachment ).
w_doc_data-obj_langu  = sy-langu.
w_doc_data-obj_name   = 'SAPRPT'.
w_doc_data-obj_descr  = '메일 제목 이다. '.
w_doc_data-sensitivty = 'F'.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type   =  'CSV'.
t_packing_list-obj_descr  =  '첨부파일 이름 입니다'.
t_packing_list-doc_size   =  t_packing_list-body_num * 255.
APPEND t_packing_list.
t_receivers-receiver = 'hongbo@aspnc.com'.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
DATA : sender_type TYPE  soextreci1-adr_typ.
sender_type = 'INT'.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
  EXPORTING
    document_data       = w_doc_data   "메일 속성에관한 Structure
    put_in_outbox       = 'X'                 "발신함 저장여부
    commit_work         = 'X'                 "Process 진행여부
    sender_address      = 'hongbo@aspnc.com'
    sender_address_type = sender_type
  TABLES
    packing_list        = t_packing_list "파일 속성에관한 Internal Table
    contents_bin        = t_attachment  "첨부파일 내용으로 되는
    contents_txt        = it_message    "메일 본문 내용
    receivers           = t_receivers.    "수신자 속성에관한 Internal

by saper | 2008/08/01 13:24 | Report | 트랙백 | 핑백(2) | 덧글(0)

트랙백 주소 : http://saper.egloos.com/tb/650154
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
Linked at Roundtable Round.. at 2008/08/05 02:12

... ... more

Linked at Rumblings: Sunda.. at 2008/08/05 14:17

... ... more

:         :

:

비공개 덧글

◀ 이전 페이지 다음 페이지 ▶