2024 Dec 17 6:18 PM - edited 2024 Dec 20 12:51 PM
I am using CL_BCS to send an attachment of Smartform output print which is nothing but a PDF file, however this attachment creates extra folder in Outlook, which requires one extra click to open PDF file.
Is there any solution to send an attachment without this extra folder?
Actual PDF after clicking the folder.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = W_BINFILESIZE
bin_file = lv_bin_xstr
TABLES
OTF = IT_OTF_DATA
LINES = IT_PDF_DATA
.
IF SY-SUBRC <> 0.
ELSE.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_bin_xstr
TABLES
binary_tab = lt_binary_content.
TRY.
lo_bcs = cl_bcs=>create_persistent( ).
* ---------------------------------------------------------------------
* -----------------& Create Document *------------------------
* ---------------------------------------------------------------------
DATA: LV_SUBJECT TYPE SO_OBJ_DES.
LV_SUBJECT = LS_COMPOSER_PARAM-TDTITLE.
lo_doc_bcs = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lt_text[]
i_length = '12'
i_subject = LV_SUBJECT ). "Subject of the Email
*---------------------------------------------------------------------
*-----------------& Add attachment to document *----------------
*---------------------------------------------------------------------
CALL METHOD lo_doc_bcs->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_size = lv_bin_filesize
i_attachment_subject = LV_SUBJECT
i_att_content_hex = lt_binary_content.
CALL METHOD lo_bcs->set_document( lo_doc_bcs ).
data: lv_string type ADR6-SMTP_ADDR.
IF NAST-KSCHL = 'ZRDE'.
lv_string = wa_TVARVC2-LOW.
sender = cl_cam_address_bcs=>create_internet_address(
lv_string ).
lo_bcs->set_sender( sender ).
ELSE.
READ TABLE IT_TVARVC2 WITH KEY LOW = LS_BIL_INVOICE-HD_GEN-SOLD_TO_PARTY.
IF SY-SUBRC IS NOT INITIAL AND ( T_VKORG NE '1000' AND T_VKORG NE '5000' ).
lv_string = S_SENDER_EMAIL.
sender = cl_cam_address_bcs=>create_internet_address(
lv_string ).
lo_bcs->set_sender( sender ).
ENDIF.
ENDIF.
LOOP AT lt_adr6 into ls_adr6.
lo_recep = cl_cam_address_bcs=>create_internet_address(
ls_adr6-smtp_addr ).
if sy-tabix = 1.
CALL METHOD lo_bcs->add_recipient
EXPORTING
i_recipient = lo_recep
i_express = 'X'.
else.
CALL METHOD lo_bcs->add_recipient
EXPORTING
i_recipient = lo_recep
i_copy = 'X'.
endif.
ENDLOOP.
CALL METHOD lo_bcs->set_send_immediately
EXPORTING
i_send_immediately = ''.
*---------------------------------------------------------------------
*-----------------& Send the email *-----------------------------
*---------------------------------------------------------------------
CALL METHOD lo_bcs->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all ).
Request clarification before answering.
This issue got solved,
The actual issue is with acknowledge mails like “Your message has been delivered to the following recipients:” or “Not delivered” which will create unnecessary folder in Outlook I have used below values to suppress these Acknowledge mails/ Folders.
For CL_BCS class
lo_bcs->SET_STATUS_ATTRIBUTES( I_REQUESTED_STATUS = 'N' ).
For SO_NEW_DOCUMENT_ATT_SEND_API1 FM
RECEIVERS-NOTIF_DEL = ' '.
RECEIVERS-NOTIF_NDEL = ' '.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 6 | |
| 6 | |
| 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.