Hi Experts,
i write a program exit like 'IF_SWF_IFS_WORKITEM_EXIT~EVENT_RAISED' for a workflow task, and need read some elements from workflow task container and send a mail.
The method input parameter is standard :
| IM_EVENT_NAME | TYPE SWW_EVTTYP | Workflow: Event Type for Workflow Runtime |
| IM_WORKITEM_CONTEXT | TYPE REF TO IF_WAPI_WORKITEM_CONTEXT | Context for Work Item |
My code:
DATA: lh_wihandle TYPE REF TO if_swf_run_wim_internal,
lw_wiid TYPE sww_wiid,
lw_container TYPE REF TO if_swf_cnt_container.
lw_wiid = im_workitem_context->get_workitem_id( ). "Here i can get the wiid when debug at SWUS; IM_EVENT_NAME is 'BEF_CREAT’.
TRY.
lh_wihandle = cl_swf_run_wim_factory=>find_by_wiid( lw_wiid ). "Here i'll get the exception 'cx_swf_run_wim_read_failed'
*- get element from container
lw_container = lh_wihandle->get_wi_container( ).
CATCH cx_swf_run_wim. "Jump to this after exception
ENDTRY.
some code read element from containers...
------ I also get a dump--------------------------------------------------------------------
Category ABAP Programming Error
Runtime Errors MESSAGE_TYPE_X_TEXT
ABAP Program CL_SWF_RUN_WIM_LOCAL==========CP
Application Component BC-BMT-WFM
---
Error analysis
Short text of the error message:
"Exception CX_SY_NO_HANDLER triggered by ZCL_SEND_MAIL=CP in
line 1 with text: An exception with the type CX_SY_REF_IS_INITIAL occurred,
but was neither handled locally, nor declared in a RAISING clause"
----------------------------------------------------------------------------------------------------
Seems like there no available container i can find from my wiid. When i try to access it, it'll be error. If i delete this program exit at my workflow, everything is fine, no error no dump. I try use FM 'SAP_WAPI_READ_CONTAINER' with my lw_wiid, the return value is '1'. Could anyone give me a hint which place is not right for my program exit?
Many thanks,
JG.