Code: Alles auswählen.
CL_ABAP_CHAR_UTILITIES=>NEWLINE
Code: Alles auswählen.
Loop At TAB into wa_TAB.
CONCATENATE wa_tab-spalte1 wa_tab-spalte2 wa_tab-spalte3 CL_ABAP_CHAR_UTILITIES=>NEWLINE into l_inhalt_csv SEPARATED BY ';'.
l_w_attachment-line = l_inhalt_csv.
APPEND l_w_attachment TO l_i_attachment.
Endloop.
Code: Alles auswählen.
DATA: l_i_attachment TYPE soli_tab.
DATA: l_w_attachment TYPE LINE OF soli_tab.
Code: Alles auswählen.
"Erstellt E-Mail-Objekt
l_o_send_request = CL_BCS=>CREATE_PERSISTENT( ).
"Angaben zum Versender
l_o_sender = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( 'test@test.de' ).
l_o_send_request->set_sender( i_sender = l_o_sender ).
"Angaben zum Empfänger
l_o_recipient = cl_cam_address_bcs=>create_internet_address( 'test@test.de' ).
l_o_send_request->add_recipient(
i_recipient = l_o_recipient
i_copy = '' " CC indi
).
"Angaben zum Kopieempfänger
l_o_recipient = cl_cam_address_bcs=>create_internet_address( 'test@test.de' ).
l_o_send_request->add_recipient(
i_recipient = l_o_recipient
i_copy = 'X'
).
"Dokument erstellen
l_o_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = l_it_contents
i_subject = l_subject
).
"Dokument anhängen
l_o_document->add_attachment(
i_attachment_type = 'CSV'
i_attachment_subject = datei_name
i_att_content_text = l_i_attachment
).
l_o_send_request->set_document( l_o_document ).
"E-Mail verschicken
l_v_ret = l_o_send_request->send( ).
Folgende Benutzer bedankten sich beim Autor black_adept für den Beitrag:
andipalamos