Skip to Content
avatar image
Former Member

Dump as UNCAUGHT_EXCEPTION CX_OS_DB_INSERT CB_PT_REQ_NOTICE in Leave request workflow WS33700137

Hi All,

I have copied the workflow for leave request WS33700137 and customized for multilevel approver.

The front End is Fiori,

All the process of multilevel approval and rejections works fine, but in the back end when try to change the 2nd level to third level approval, i get the below dump. how to handle it.

Exception 'CX_OS_DB_INSERT' was raised, but it was not caught anywhere along the call hierarchy. Since exceptions represent error situations, and this error was not adequately responded to, ABAP program 'CB_PT_REQ_NOTICE==============CP' had to be terminated.

How to correct the error If the error occurs in a non-modfied SAP program, you might be able to find a solution in the SAP Notes system. If you have access to the SAP Notes system, check there first using the following keywords: "UNCAUGHT_EXCEPTION" CX_OS_DB_INSERT "CB_PT_REQ_NOTICE==============CP" bzw. CB_PT_REQ_NOTICE==============CM00F "MAP_SAVE_TO_DATABASE"

Please find the attached dump document.

in brief i have the code as below when i try to change the status from one level approver to next level approver

IF im_current_level NE im_total_level.
*

*
DO.
SELECT * FROM
ptreq_header
INTO TABLE lt_ptreq_header
WHERE request_id = lv_request_id.
IF sy-subrc EQ 0.
SORT lt_ptreq_header BY version_no DESCENDING.
READ TABLE lt_ptreq_header INTO ls_ptreq_header INDEX 1.
IF ls_ptreq_header-status = 'APPROVED'.
***-->Enqueue the request
CALL FUNCTION 'ENQUEUE_EPTREQ'
EXPORTING
mode_ptreq_header = 'S'
mandt = sy-mandt
request_id = lv_request_id
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0.

CALL METHOD cl_pt_req_badi=>get_request
EXPORTING
im_req_id = lv_request_id
IMPORTING
ex_request = request.

lcl_req_request ?= request.

CALL METHOD cl_pt_req_badi=>initiate_state_transition
EXPORTING
im_request = request
im_event = event
IMPORTING
ex_new_status = lvv_status.
*
* CALL METHOD lcl_req_request->clone_to_old.

COMMIT WORK AND WAIT.
IF lvv_status IS NOT INITIAL.
CLEAR : lt_ptreq_header, ls_ptreq_header.
SELECT * FROM
ptreq_header
INTO TABLE lt_ptreq_header
WHERE request_id = lv_request_id.
IF sy-subrc EQ 0.
SORT lt_ptreq_header BY version_no DESCENDING.
READ TABLE lt_ptreq_header INTO ls_ptreq_header INDEX 1.

IF sy-subrc EQ 0.
IF ls_ptreq_header-status = 'SENT'.
EXIT.
ELSE.
ex_error = 'HEADER APPROVED STATUS'.
WAIT UP TO 5 SECONDS.
ENDIF.
ENDIF.
ELSE.
ex_error = 'Not Sent status'.
WAIT UP TO 5 SECONDS.
ENDIF.
ELSE.
ex_error = 'ENQUEUE Failed'.
WAIT UP TO 5 SECONDS.
ENDIF.
**-->if in approved status and it has to go as sent status
ELSE.
ex_error = 'NOT AS APPROVED'.
WAIT UP TO 5 SECONDS.
ENDIF.
ENDIF.
ENDIF.
ENDDO.

***-->Dequeue the request
CALL FUNCTION 'DEQUEUE_EPTREQ'
EXPORTING
mode_ptreq_header = 'S'
request_id = lv_request_id.

dump1.png

dump2.png

dump1.png (83.5 kB)
dump2.png (82.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers