2009 Jun 26 1:19 PM
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.
2009 Jun 26 1:26 PM
2009 Jun 26 1:36 PM
Hi,
I have used
submit program.....
but in update task i have used it.
"Z_SD_ORDER_UPDATE". program is a print driver program.
However error says:
There is probably an error in the program
"Z_SD_ORDER_UPDATE".
This program is triggered in the update task. There, the
following ABAP/4 statements are not allowed:
- CALL SCREEN
- CALL DIALOG
- CALL TRANSACTION
- SUBMIT
I used submit as:
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = ' '
AND RETURN.
Instead of submit i want to use commit work but i also get a dump after commit work too.
How can i use commit work in above code?
Thanks.
2009 Jun 26 1:39 PM
Hi,
Instead of commit work try using following statement.
TRY.
CALL METHOD lref_send_request->release
EXPORTING
i_with_error_screen = c_x.
CATCH cx_send_req_bcs INTO lref_bcs_exception.
error_handling 'send_request->release'
lref_bcs_exception->error_type.
ENDTRY.KR Jaideep,
2009 Jun 26 2:12 PM
Hi,
You cannot use a commit work statement in update task.
Since update task will be called after commit work; so do not call the commit else you will get a dump.
Regards,
Ankur Parab
2009 Jun 26 2:47 PM
Hi,
So how can i make waiting emails to be at queue, instead of a grey X on emails?
Thanks.
2009 Jun 26 3:55 PM
Why don't you use this way
send_request->set_send_immediately( 'X' ).
send_request->send( ).
without a commit
a®