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 With interanl table + Attachment

Former Member
0 Likes
320

Hi ,

With help from this forum i success in sending mail with internal and other program that send mail with attachment,

now the last thihng is to combin of the both,

i try do do it like this way (below) and i get 2 diifrent mail ,

Now i now that i give the mail adress twice and i write all thing twice and i not had to ,

but when i do it once it send just the : send_request , document, recipient...not with IO_....

i write it twice for the help.

i new In Abap OO how can i solve this ?

Regards

TRY.
    send_request = cl_bcs=>create_persistent( ).
    lo_send_request = cl_bcs=>create_persistent( ).

    lo_document = cl_document_bcs=>create_document( i_type = 'HTM'
                                                    i_text = lt_html[]
                                                    i_subject = 'Table' ).

    document = cl_document_bcs=>create_document( i_type    = 'RAW'
                                                 i_text    = lt_text
                                                 i_subject = 'Check this' ).
    APPEND 'Test Message' TO lt_text.

    document->add_attachment( EXPORTING i_attachment_type    =  'BIN'
                                        i_attachment_subject = mail_type
                                        i_att_content_hex    = lt_attach ).


    lo_send_request->set_document( lo_document ).
    send_request->set_document( document ).

    recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
    lo_recipient = cl_cam_address_bcs=>create_internet_address( mailto ).

    send_request->add_recipient( i_recipient = recipient  i_express   = 'X' ).
    lo_send_request->add_recipient( i_recipient = lo_recipient  i_express = 'X' ).


    send_request->set_send_immediately( 'X' ).
    sent_to_all = send_request->send( i_with_error_screen = 'X' ).

    lo_send_request->add_recipient( EXPORTING i_recipient = lo_recipient
    i_express = 'X' ).
    lo_send_request->set_send_immediately( 'X' ).
    lv_sent_to_all = lo_send_request->send( 'X' ).


    COMMIT WORK.

  CATCH cx_bcs INTO bcs_exception.
    lv_error_txt = bcs_exception->get_text( ).
    WRITE:`Error : ` , lv_error_txt.
    EXIT.
ENDTRY

.

Regards

Hi ,

With help from this forum i success in sending mail with internal and other program that send mail with attachment,

now the last thihng is to combin of the both,

i try do do it like this way (below) and i get 2 diifrent mail ,

Now i now that i give the mail adress twice and i write all thing twice and i not had to ,

but when i do it once it send just the : send_request , document, recipient...not with IO_....

i write it twice for the help.

i new In Abap OO how can i solve this ?

Regards

TRY.
    send_request = cl_bcs=>create_persistent( ).
    lo_send_request = cl_bcs=>create_persistent( ).

    lo_document = cl_document_bcs=>create_document( i_type = 'HTM'
                                                    i_text = lt_html[]
                                                    i_subject = 'Table' ).

    document = cl_document_bcs=>create_document( i_type    = 'RAW'
                                                 i_text    = lt_text
                                                 i_subject = 'Check this' ).
    APPEND 'Test Message' TO lt_text.

    document->add_attachment( EXPORTING i_attachment_type    =  'BIN'
                                        i_attachment_subject = mail_type
                                        i_att_content_hex    = lt_attach ).


    lo_send_request->set_document( lo_document ).
    send_request->set_document( document ).

    recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
    lo_recipient = cl_cam_address_bcs=>create_internet_address( mailto ).

    send_request->add_recipient( i_recipient = recipient  i_express   = 'X' ).
    lo_send_request->add_recipient( i_recipient = lo_recipient  i_express = 'X' ).


    send_request->set_send_immediately( 'X' ).
    sent_to_all = send_request->send( i_with_error_screen = 'X' ).

    lo_send_request->add_recipient( EXPORTING i_recipient = lo_recipient
    i_express = 'X' ).
    lo_send_request->set_send_immediately( 'X' ).
    lv_sent_to_all = lo_send_request->send( 'X' ).


    COMMIT WORK.

  CATCH cx_bcs INTO bcs_exception.
    lv_error_txt = bcs_exception->get_text( ).
    WRITE:`Error : ` , lv_error_txt.
    EXIT.
ENDTRY

.

Regards

1 REPLY 1
Read only

Former Member
0 Likes
290

Not answer,move to oo forum