Skip to Content
0
Former Member
Jun 26, 2009 at 12:19 PM

How to use commit work in class cl_bls

338 Views

Hi,

When i have used commit work after email sent,

it goes into dump.

Here is the code segment:

try.

  • -------- create persistent send request ------------------------

send_request = cl_bcs=>create_persistent( ).

  • -------- create and set document -------------------------------

pdf_content = cl_document_bcs=>xstring_to_solix( pdf_tab ).

document = cl_document_bcs=>create_document(

i_type = 'PDF'

i_hex = pdf_content

i_length = bytecount

i_subject = sub ). "#EC NOTEXT

  • add document object to send request

send_request->set_document( document ).

  • --------- add recipient (e-mail address) -----------------------

  • create recipient object

recipient = cl_cam_address_bcs=>create_internet_address( recip-recip ).

  • add recipient object to send request

send_request->add_recipient( recipient ).

  • ---------- send document ---------------------------------------

sent_to_all = send_request->send( i_with_error_screen = 'X' ).

commit work.

if sent_to_all is initial.

message i500(sbcoms) with recip.

else.

message s022(so).

endif.

  • ------------ exception handling ----------------------------------

  • replace this rudimentary exception handling with your own one !!!

catch cx_bcs into bcs_exception.

message i865(so) with bcs_exception->error_type.

endtry.

What could be the reason?

Is there any way to use commit work in class while sending email as in SO_NEW_DOCUMENT_ATT_SEND_API1 fm?

Thanks.