‎2011 Mar 09 9:11 PM
Hi ,
I am using the class CL_BSC for sending mail with attachment,i need to disply the messge captured in the cx_document_bcs in spool log.
TRY.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'Test*
i_attachment_subject = i_attachment_subject1
i_att_content_hex = lt_att_content_hex ).
CATCH cx_document_bcs INTO lx_document_bcs.
ENDTRY.
How to disply the messges in Spool,which are captured in the cx_document_bcs.
Please advise.
Thanks
Kiran
‎2011 Mar 09 9:23 PM
Hi Kiran,
Catch exceptions like this.
TRY.
...
CATCH cx_document_bcs INTO lx_document_bcs.
MESSAGE Ennn(ZXX).
CLEANUP.
ENDTRY.
There you can check diffrent exceptions like this.. from class CX_DOCUMENT_BCS..
ERROR_TYPE parameter of lx_document_bcs contains the below values.. or you can use message parameters. Check constructore parameters in that class.
OBJECT_NOT_EXISTS
KPRO_ERROR
MIME_NOT_AVAILABLE
Based on the code you can give meaning ful message.
‎2011 Mar 10 5:57 AM
Catch the exceptions as descibed. send messages to spool with Messase ststement. Eg, message sooo(za) with 'no records found'. That message will show up in job log. Any write statement will show up in the spool.
‎2011 Mar 10 11:23 AM
data:lf_ref type ref to cx_root.
data:lf_string type string.
TRY.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'Test*
i_attachment_subject = i_attachment_subject1
i_att_content_hex = lt_att_content_hex ).
CATCH cx_root INTO lf_ref.
lf_string = lf_ref->get_text( ).
MESSAGE E101(ZMM) with lf_string.
ENDTRY.