Hi Sudeesh
Workflow step...just for an email.....is overengineering!
To trigger this custom Step, you will have to code in a BADI/UserExit/Enhancement........ so instead of triggering a workflow step why not send the email straightaway?
You can use Methods of CL_BCS class to send an email...here is the simple sequence of calls
- lr_bcs = cl_bcs=>create_persistent( )
- lr_doc = cl_document_bcs=>create_document(..necessary parameters....)
- lr_bcs->set_document( lr_doc ).
- lr_sender = cl_sapuser_bcs=>create( 'WF-BATCH' ).
- lr_bcs->set_sender( lr_sender ).
- Loop on all addresses
- lr_rece = cl_cam_address_bcs=>create_internet_address( lv_receiver ).
- lr_bcs->add_recipient( lr_rece ).
lr_bcs->add_recipient( I_RECIPIENT = lr_rece I_COPY = 'X').
- Endloop
- lr_bcs->send( ).
- Let application handle the Commit Work
Regards,
Modak