Skip to Content
0
Former Member
Jul 06, 2012 at 04:43 PM

Exception CX_DOCUMENT_BCS occurred

836 Views

Hi all.

We have a program which reads file content from AL11 and send an email to User's. We are trying to send an 'XLS' file as an attachment of an email and using I the cl_document_bcs->add_attachment. I am getting an error 'Exception CX_DOCUMENT_BCS occurred (program: CL_DOCUMENT_BCS===============CP, include: CL_DOCUMENT_BCS===============CM01C, line: 64).' while executing this report. Email has been successfully sent but attachment is missing. I debugged the program and found that in include LSOB2U02, program is calling exit SO_EXT_DB_EXIT and giving error as FM does not exists. I tried to change the xls in below code to caps but still getting error. please suggest.

LOOP AT zcl_vcvp_logger=>i_singleton INTO lwa_objs.

* Get data into Excel format

lwa_objs-obj->get_xls(

IMPORTING

ei_xls_data = li_xls

ev_size = lv_size ).

* Add attachment

TRY.

lv_subject = lwa_objs-file.

document->add_attachment(

i_attachment_type = 'xls'

i_attachment_subject = lv_subject

i_attachment_size = lv_size

i_att_content_hex = li_xls ).

CATCH cx_document_bcs INTO lo_exc.

lv_string = lo_exc->get_text( ).

MESSAGE 'Error while adding attachment'(m03) TYPE 'S'.

MESSAGE lv_string TYPE 'S'.

ENDTRY.

CLEAR: li_xls.

ENDLOOP.

Thanks

Shilpa