‎2007 Apr 18 8:39 AM
Hallow here I have code that send mail and its working,
I wont to now where I put the <b>message</b> of mail here and where I put the mail <b>adress</b> of the person I wont to send the mail for him
regards
-------- Create And Set Document -------------------------------
CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4)
INTO p_date SEPARATED BY '/'.
CONCATENATE sy-uzeit0(2) sy-uzeit2(2) sy-uzeit+4(2)
INTO p_time SEPARATED BY ':'.
CONCATENATE text-002 p_date p_time
INTO p_line1 SEPARATED BY space.
APPEND p_line1 TO text.
p_line1 = '=========================================='.
APPEND p_line1 TO text.
CONCATENATE text-003 counter
INTO p_line1 SEPARATED BY space.
APPEND p_line1 TO text.
CONCATENATE text-004 red_rec
INTO p_line1 SEPARATED BY space.
APPEND p_line1 TO text.
CONCATENATE text-005 yellow_rec
INTO p_line1 SEPARATED BY space.
APPEND p_line1 TO text.
CONCATENATE text-006 green_rec
INTO p_line1 SEPARATED BY space.
APPEND p_line1 TO text.
p_line1 = '=========================================='.
APPEND p_line1 TO text.
p_line1 = text-007.
APPEND p_line1 TO text.
p_line1 = '=========================================='.
APPEND p_line1 TO text.
******************************************************
SELECT SINGLE value
FROM yhr_parameters
INTO wa_mail_addr
WHERE title = 'YHR'
AND subtitle = 'MMSK_LOMED'
AND name = 'SEND_MAIL'.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = text-001 ).
text-001 = הנושא
add document to send request
CALL METHOD send_request->set_document( document ).
set sender
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
add recipient (e-mail address)
recipient = cl_cam_address_bcs=>create_internet_address( wa_mail_addr ).
add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDSELECT.
send document
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
COMMIT WORK.
‎2007 Apr 18 8:54 AM
Please populate the recipent by appending the recipent name in structure declared for recipent(this should be similar to recipent structure in method).
‎2007 Apr 18 8:54 AM
Please populate the recipent by appending the recipent name in structure declared for recipent(this should be similar to recipent structure in method).
‎2007 Apr 18 9:04 AM