cancel
Showing results for 
Search instead for 
Did you mean: 

How to reject SC programatically in process controlled WF?

Former Member
0 Kudos

I set a background process level with process type 'automatic' and I want to reject the WF within it. This is my code:

lo_pdo_bo_sc ?= /sapsrm/cl_pdo_factory_sc_adv=>get_instance(
    iv_header_guid = lv_document_guid
    iv_mode = /sapsrm/if_pdo_constants_gen_c=>gc_mode_display
    iv_wiid = iv_workitem_id
    iv_user_id = iv_agent_id ).

    endif.
    lo_pdo_bo_sc->/sapsrm/if_pdo_adv_base~reject( ).

I set the mode = DISPLAY, since if I set it EDIT, it will reise an exception /SAPSRM/CX_PDO_WF_RECALL_RQ .

So in DISPLAY mode, when i call the reject method, I will get the exception CX_SY_REF_IS_INITIAL. It is caused by the mo_user_context object is INITIAL.

So I do not know what is wrong with my method. Maybe the input user or mode?

Or else, there is another way to reject the SC wf in backgound process level?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

In your process level definittion you can use task ID as 40007989 ( Automatic rejection).

Hope this solves your issue

Regards

Sam

Former Member
0 Kudos

Hi Sam,

I use the codes in the standard task and reject SC successfully. Thanks.

Answers (0)