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

send mail help

Former Member
0 Likes
377

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 = &#1492;&#1504;&#1493;&#1513;&#1488;

  • 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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
359

Please populate the recipent by appending the recipent name in structure declared for recipent(this should be similar to recipent structure in method).

2 REPLIES 2
Read only

Former Member
0 Likes
360

Please populate the recipent by appending the recipent name in structure declared for recipent(this should be similar to recipent structure in method).

Read only

Former Member
0 Likes
359

antonio,

Please Search in the Forum, and get the help from existing one's

Best Regards

Vijay