on ‎2024 Jun 28 5:40 AM
Dear experts,
The current code snippet is sending e mail in xls format. Now the requirement is I need to send email in both Excel and CSV formats.
code:
"merging header and item rows
IF lv_header IS NOT INITIAL AND lv_item IS NOT INITIAL .
CONCATENATE lv_header cl_abap_char_utilities=>newline lv_item INTO lv_excel.
ENDIF.
"converting to binary
TRY.
cl_bcs_convert=>string_to_solix(
EXPORTING
iv_string = lv_excel
iv_codepage = '4103' "suitable for MS Excel, leave empty
iv_add_bom = 'X' "for other doc types
IMPORTING
et_solix = lt_binary_content ).
CATCH cx_bcs.
MESSAGE e005.
ENDTRY.
"add attchement
CALL METHOD lo_document->add_attachment
EXPORTING
i_attachment_type = 'xls'
i_attachment_subject = lv_subject
i_att_content_text = lt_cont_text
i_att_content_hex = lt_binary_content.
* add document to send request
CALL METHOD lo_send_request->set_document( lo_document ).
Please guide me how to do this or if you have any sample code for help.
Thank you.
Request clarification before answering.
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.