cancel
Showing results for 
Search instead for 
Did you mean: 

No active process levels found

Former Member
0 Kudos

Hi all.,

I have just started configuring the n step header level approval workflow for shopping cart.I have to trigger the approval of cart based on te product catgeory in the shopping cart item.If the product catgeory is on eof the entries maintained in custom table,then process level is true.

This is what i have done so far:

1. Created a custom schema "Z_SC_SCHEMA" with evaluation ID ZEV_SC_EVENT.

For this process schema,I have created one process level as follows:

Sequence Number-->100

Level Type-->Approval with completion

Evaluation ID-->ZEV_SC_CATEGORY

Resp. Resolver Name-->Implementgation of BADI /SAPSRM/BD_WF_RESP_RESOLVER

Task ID-->40007953

Decision Type-->Descision for entire document

2.For the evaluation ID assigned to above process level,I have assigned a custom expression ZEX_SC_CATEGORY of type 0FB001.Result type is BOOLEAN

3.I have created another custom expression ZEX_SC_CASE_CATEGORY of type 0CF001 with result type C.I have copid the std FM "/SAPSRM_WF_BRF_0EXP000" and created a copy "ZSAPSRM_WF_BRF_0EXP000" and assigned that to this expression.In FM ZSAPSRM_WF_BRF_0EXP000,based on DOCUMENT_GUID,i'm setting the flag ev_value = 'X'.

4.The expresion created in step 3 has been used in expression ZEX_SC_CATEGORY which is assigend to evaluation ID of the process level.In ZEX_SC_CATEGORY ,in the formula editor,I have written :

ZEX_SC_CASE_CATEGORY = 'X'.

Now when I click on the approval preview in the shopping cart,I get the error :NO ACTIVE PROCESS LEVELS FOUND.

I think the prcoess level evaluation is not coming out to be true hence the error.

NOTE:There is only 1 schema defined for shopping cart.

Can someone point me what I'm doing wrong?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

What do you see in SLG1?

Can you share your code ?

Saravanan

Former Member
0 Kudos

Hi Saravanan,

Thanks so much for the response.

In SLG1,I see the following entries:

OBJECT-->SRM BRF Trace

10 Execute event ZEV_SC_CATEGORY Check the Product category.

42 Execute expression ZEX_SC_CATEGORY Check if 1st condition for SC approval is true; result is empty

52 Execute expression ZEX_SC_CASE_CATEGORY Check if the Product category in shopping cart is; result is empty

For the evaluvation ID(event) of the process level i.e. ZEV_SC_CATEGORY,the expression attached is ZEX_SC_CATEGORY.

In ZEX_SC_CATEGORY,in the formula,I have written the following:

ZEX_SC_CASE_CATEGORY = 'X'

The expression ZEX_SC_CASE_CATEGORY has been used in the expression ZEX_SC_CATEGORY.

In ZEX_SC_CASE_CATEGORY,I have attached the custom FM ZSAPSRM_WF_BRF_0EXP000" which is a copy of the std FM /SAPSRM_WF_BRF_0EXP000 under access FM.

I have not checked the check box for "Calculation of parameters infunction module/badi method" under data access.

The code in the custom FM is:

DATA lo_wf_brf_event TYPE REF TO /sapsrm/cl_wf_brf_event. 
DATA lo_context_provider TYPE REF TO /sapsrm/if_wf_context_provider
DATA lo_rule_context TYPE REF TO object. 
DATA lv_document_guid TYPE /sapsrm/wf_document_guid. 
DATA lv_document_type TYPE /sapsrm/wf_document_type. 
DATA lv_msg TYPE string. DATA lv_debstat TYPE char1.
DATA lc_exception TYPE REF TO /sapsrm/cx_wf_abort. 

* preset return values ev_type = /sapsrm/if_wf_rule_c=>type_bool. 
ev_length = 1. 
CLEAR ev_currency. 
ev_output_length = 1. 
ev_decimals = 0. 
ev_value = /sapsrm/if_wf_rule_c=>brf_result_bool_noprocessing. " no processing 
ev_data_missing = /sapsrm/if_wf_rule_c=>brf_data_missing.

DATA ls_expression LIKE LINE OF it_expressions. 
DATA lt_expressions LIKE it_expressions. 
* expression parameter splitting 
ATA lv_class_name TYPE /sapsrm/wf_brf_class_name. 
DATA lv_method_name TYPE /sapsrm/wf_brf_method_name. 
DATA lv_property_name TYPE /sapsrm/wf_brf_property_name.
DATA lv_data_missing TYPE char1. 
DATA lv_use_dot TYPE c. 
DATA lt_wf_brf_call TYPE /sapsrm/t_wf_brf_call. 
DATA ls_wf_brf_call LIKE LINE OF lt_wf_brf_call.
 DATA lo_wf_brf_msg TYPE REF TO /sapsrm/cl_wf_brf_msg. 
DATA lv_value TYPE /sapsrm/wf_brf_value. 
DATA lv_currency TYPE /sapsrm/wf_brf_currency. 
DATA lv_type TYPE /sapsrm/wf_brf_type. *----------------------------------------------------------------------* * Connection FM from BRF to Rule Handling, Call the rule and * get back the value BREAK-POINT ID /sapsrm/wf_brf_level_eval.
BREAK-POINT ID /sapsrm/wf_brf_trace. 
DATA : lt_item TYPE TABLE OF bbp_pds_sc_item_d, 
ls_item LIKE LINE OF lt_item, 
lt_sme TYPE TABLE OF zsme_approvers,
 lw_sme TYPE zsme_approvers. 

DATA : lv_flag. * get event object IF NOT io_event IS BOUND. 
* BRF event Object not bound. No further execution possible. 
MESSAGE e089(/sapsrm/brf) INTO lv_msg. 
TRY. 
CALL METHOD /sapsrm/cl_wf_brf_ccms=>send_message( ). 
CATCH /sapsrm/cx_wf_abort INTO lc_exception. E
NDTRY. 
ev_data_missing = /sapsrm/if_wf_rule_c=>brf_data_missing.
 EXIT. 
ENDIF. 
lo_wf_brf_event ?= io_event. lo_context_provider = lo_wf_brf_event->get_context_provider( ). * get Content Container from BRF event IF NOT lo_context_provider IS BOUND. * BRF Context Container Object not bound. No further execution possible. MESSAGE e090(/sapsrm/brf) INTO lv_msg. TRY. CALL METHOD /sapsrm/cl_wf_brf_ccms=>send_message( ). CATCH /sapsrm/cx_wf_abort INTO lc_exception. ENDTRY. ev_data_missing = /sapsrm/if_wf_rule_c=>brf_data_missing. EXIT. ENDIF. CALL METHOD lo_context_provider->get_document IMPORTING ev_document_guid = lv_document_guid ev_document_type = lv_document_type.

*CALL FUNCTION 'BBP_PD_SC_GETDETAIL'*
*EXPORTING* *i_guid = lv_document_guid* 
*TABLES* *e_item = lt_item.

* SELECT * FROM zsc_approvers INTO TABLE lt_sme. 
LOOP AT lt_item INTO ls_item WHERE del_ind IS INITIAL AND deduct_ind IS INITIAL.
LOOP AT lt_sme IN
TO lw_sme WHERE plant_code = ls_item-be_plant AND app_crit_value1 = ls_item-category_id. 
IF sy-subrc = 0. l
v_flag = 'X'.
 EXIT. 
ENDIF.
ENDLOOP. 

IF lv_flag = 'X'. 
EXIT. 
ENDIF. 
ENDLOOP. 
ev_value = lv_flag.


NOTE : ZEX_SC_CATEGORY is of type 0FB001 with result type B

ZEX_SC_CASE_CATEGORY is of type 0CF001 with result type C

The strange thing is that when I put a breakpoit in the above FM,I do see that EV_VALUE is set to "X".

The problem seems to be with the other formula expression where the expresiion ZEX_SC_CASE_CATEGORY is used.

Please advise.

Edited by: srm_tech on Oct 12, 2011 6:41 PM

Edited by: srm_tech on Oct 12, 2011 6:42 PM

Former Member
0 Kudos

Hi,

What is the field/ouput length you declare of ZEX_SC_CASE_CATEGORY is of type 0CF001? if it is 1 then change to around 24 and check..

Saravanan

Former Member
0 Kudos

Thanks Saravanan.

Yes the field length for ZEX_SC_CASE_CATEGORY was 1.When I changed it to 24,the error no longer showed up.

But under Approval process overview,I see the the approval step as AUTOMATIC one.

Another observation as per my further tests:

Also in the FM attached to the expression ZEX_SC_CASE_CATEGORY ,in teh debug mode I saw that thevalue for the parameter EV_TYPE was set to "B" when it was supposed to be "C" as I defined the result type of the expression as "C".

When I changed the value EV_TYPE = 'C' at runtime,the error no longer appeared and also under the APPROVAL PROCESS OVERVIEW tab,I got another error that strategy "ZSC_CATEGORY_APPROVER" did not determine any approvers.

Now,I'm totally confused as to whether I should set the EV_TYPE flag explicitly as "C" in the Z FM or just cange the length of the result type for the expresssion to "24" as you suggested.

Pls advise.

Former Member
0 Kudos

Hi,

got another error that strategy "ZSC_CATEGORY_APPROVER" did not determine any approvers is nothing but the process level could not determine the approver. try to implment the fall_back agent and see if the approver is display or not..

saravanan

Former Member
0 Kudos

Any idea whether I should set the EV_TYPE flag explicitly as "C" in the Z FM or just cange the length of the result type for the expresssion to "24" as you suggested???

Also I implemented the GET_FALLBACK_AGENTS method os badi /SAPSRM/BD_WF_RESP_RESOLVER..But still I'm getting the error "ZSC_CATEGORY_APPROVER" did not determine any approvers.

Also I have 2 process levels defined 1st one is to find the category approver and 2nd one is auto approval...is its because there are no approvers found in the system the cart is getting automatically approved ...i.e. 2nd process level is gettin executed automaticlly since the approvres are not determine din the process level 1.

Former Member
0 Kudos

Hi,

Any idea whether I should set the EV_TYPE flag explicitly as "C" in the Z FM or just cange the length of the result type for the expresssion to "24" as you suggested???

just change the expression value to 24..

Regarding other two issues, could you please share your code..

Saravanan

Former Member
0 Kudos

Thanks for the reply.

However if I change the value for the length of the expression to 24,then under APPROVAL PROCESS OVERVIEW,the approval is set to AUTOMATIC(which is the 2nd process level feined NOW).Earlier when I hadnt defined the 2nd process level as AUTO APPROVAL,still under APPROVAL PROCESS OVERVIEW,I didnt get the actual approvers as deifned in the method "GET_APPROVERS_BY_AREA_GUID" of the BADI "/SAPSRM/BD_WF_RESP_RESOLVER" but the approval set to "automatic approval by system".

BADi code is :

EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUID

DATA : lw_approver TYPE /sapsrm/s_bd_wf_approver.

 lw_approver-approver_id = 'USXXXXXX'.
  APPEND lw_approver TO rt_approver.

Edited by: srm_tech on Oct 14, 2011 7:26 PM

Former Member
0 Kudos

Hi,

you have updated these two fields..

ls_approver-APPROVER_OT = 'US'.

ls_approver-APPROVER_ID = only user id 'GARYL'

APPEND ls_approver TO rt_approver.

Saravanan

Former Member
0 Kudos

Thanks Saravanan....Really appreciate your help...I did the code changes as you mentioned but stil the BADI method is not getting triggered.

How to check if the BADI method was implemented correctly?I beleive the only problem is with the BADI implementation/class as in SLG1 the results of my expression and process schema are as follows:

10 Execute event ZEV_SC_EVENT Shopping cart Evaluation ID.

43 Execute expression ZEX_SC_SCHEMA Constant Expression for Process schema evaluation; result Z_SC_SCHEMA

10 Execute event ZEV_SC_CATEGORY Check the Product category.

42 Execute expression ZEX_SC_CATEGORY Check if 1st condition for SC approval is true; result is: =X

52 Execute expression ZEX_SC_CASE_CATEGORY Check if the Product category in shopping cart is; result X

NOTE: Please see in the log for the expression ZEX_SC_CATEGORY (highighted above),the result is =X....is this OK???

Also in addition to the above log,I also see the below log:

10 Execute event 0EV999 Check Necessity of Automatic Decision by System.

42 Execute expression 0B_WF_SYSTEMAPPROVAL Automatic Decision Required by SAP System; result is: =blank

52 Execute expression 0B_WF_VALIDLEVAVAILA At Least One Process Level is Valid; result is: =X

63 Execute expression 0C_C1_C_FWF__RLCNTNT Class: /SAPSRM/CL_WF_RULE_CONTEXT; result /SAPSRM/CL_WF_RULE_CONTEXT

63 Execute expression 0C_C2_C_VALIDLEVAVAI Method: Valid Level Available; result VALID_LEVEL_AVAILABLE

I have created a 2nd process level of type AUTO APPROVAL with evaluation ID OEV999...I believe the 2nd log in SLg1 is corresponding to that as system couldnt find any approvers thru Badi implementaion...Is my understanding correct?

Another wierd thing I observed is that the code I ahve written in the other method GET_AREA_TO_ITEM_MAP of the same badi is getting triggered if I put an external breakpoint in the code which is as follows:

IF is_document-document_type = 'BUS2121'.
    EXIT.
  ENDIF.

If I need to delete the entire implementation of the badi and re-do everything again,can you please let me knw the step-by step prcoedure to do that.

Another observation regarding the BADI implementation:

When I goto the ENHANCEMENT implementation,under Adjustment tab,I see an entry in the conflict list an din the long text,I see the foll message:

/SAPSRM/BD_WF_RESP_RESOLVER ZSC_IT_CAT_APPROVERS Interface method is not implemented

Many thanks in advance for helping me with my issue.

Please advise.

Edited by: srm_tech on Oct 19, 2011 2:16 AM

Answers (0)