I am facing problem in custom developed leave workflow. The workflow is being triggered from portal ( standard leave service ) and approval is also done through portal . In the worklfow after getting approval from one level we are setting the request's status to SENT again so that the other level of approver can approve the request further.
But sometimes the status is not changing from APPROVED to SENT and hence for the next level of approver,when the approver clicks on the workitem It shows blank screen ( No data ).
When we go the technical workflow log then we can see that the task which is changing the status of the request was completed with error. And one entry is missing from the table PTREQ_HEADER corresponding to the status SENT.
Error message : Call of interface SAP_WAPI_PUT_BACK_WORKKITEM
within the runtime system not permitted
We are unable to track the reason of this message because this problem do not occur regularly.
CALL FUNCTION 'ENQUEUE_EPTREQ'
EXPORTING
mode_ptreq_header = 'E'
request_id = request
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3
.
IF sy-subrc NE 0.
ELSE.
CALL METHOD ca_pt_req_header=>agent->get_request
EXPORTING
im_request_id = request
IMPORTING
ex_request = is_request_obj
EXCEPTIONS
request_not_found = 1.
IF sy-subrc = 0.
execute state transition from APPROVED to SENT
DATA: w_subrc TYPE sysubrc.
CALL METHOD is_request_obj->initiate_state_transition
EXPORTING
im_transfer_event = w_req_send
IMPORTING
ex_new_status = new_status
ex_ret_code = w_subrc.
ENDIF.