I am facing an issue with the shopping cart auto approve wrongly.
We have created a Z class for the standard class "/SAPSRM/CL_WF_RULE_CONTXT_SC". In this class we have created a method "STEP_TRIGERRED" which Check if a step need to be trigger (BRF).
In the below method when there is not process level find then CATCH is getting triggered and a message.
But the issue is when ever this catch is getting triggered the shopping cart status is getting changed automatically to Approved. It should be in Awaiting Approval status.
Kindly let me know if you have some solution for this issue.
ev_data_missing = 'X'.
IF iv_property IS SUPPLIED.
lv_level-level_seqnr = iv_property.
CALL METHOD /sapsrm/cl_wf_apv_facade=>get_current_process_level
iv_document_guid = iv_document_guid
es_process_level = ls_process_level.
MOVE-CORRESPONDING ls_process_level TO lv_level. "#EC ENHOK
CREATE OBJECT lo_wf_rule
guid = iv_document_guid
level = lv_level.
lv_trigger = lo_wf_rule->get_trig_prop( lv_level-level_seqnr ).
* No process level available.
MESSAGE w123(/sapsrm/brf) INTO mv_msg.
RAISE EXCEPTION TYPE /sapsrm/cx_wf_rule_error.
CATCH zcx_pu_wf_rhodia INTO lx_err_rule.
RAISE EXCEPTION TYPE /sapsrm/cx_wf_rule_error
previous = lx_err_rule.