cancel
Showing results for 
Search instead for 
Did you mean: 

Process Controlled WF - Schema

Former Member
0 Kudos

Expert's,

I'm using process controlled WF in SRM 7, When i use a constant to return a schema name it works fine. My goal is to determine the schema according for example to the product category.

Is it possible to create a BRF expression with 0CF001 ( function module ) and return a schema name ?

i tried to create a custom FM and export a schema name but with no sucess.

Full points for useful answers.

Best regards,

Mário.

Accepted Solutions (1)

Accepted Solutions (1)

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Yes. You can use Function Module type BRF expression.

Return Value should be CHAR 32. Please copy FM /SAPSRM/WF_BRF_0EXP001. The input/output parameter should be fixed.

  • initialize value

ev_type = 'C'.

ev_length = 32.

ev_output_length = 32.

CLEAR ev_currency.

ev_decimals = 0.

ev_value = ''. " no processing

ev_data_missing = 'X'.

  • your logic

if ***************************************

CLEAR ev_data_missing.

ev_value = 'SCHEMA_NAME' . <- return the schema name

  • ev_length = STRLEN( ev_value ).

  • ev_output_length = STRLEN( ev_value ).

Regards,

Masa

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Thanks for the answers, it's working fine now ! Full points awarded !

Best regards,

Mário.

Former Member
0 Kudos

Hi

Hope you can help. I am in a very similar position. I Have two different n_level Approval schema's working ok, one for Catalog Items and one for non Catalog items, but now have to switch between them based on Partner Function 'source of supply' being present or not (Catalog ID's not used), so need schema determination

So. I have Created BRF event based on an expression. The expression is based on a copy of FM /SAPSRM/WF_BRF_0EXP001.

In the expression I have passed the Class 0c_C1_C_FWFSCRCNTNT.

my question is, what else should I be passing into the FM? and how is the return schema named held, I have made the expression a char 32, does the BRF expression take on the value passed back from the FM

Thanks

Former Member
0 Kudos

H John,

I Have two different n_level Approval schema's working ok, one for Catalog Items and one for non Catalog items? You mean that you are determining n_level Approval Schema dynamically by Catalog Items and one for non Catalog items? , if yes please please. I have same to develop same requirement, but i am struggling lot lot lot lot to find the approval schema dynamically. i am getting an error message 'No process schema found' while i click the create shopping cart link in Portal.

I knew the reason why i am getting this error, but do not know how to fix. The error is coming because; I have assigned the CASE expression to a BRF EVENT (ZSC_EV_SCHEMA) which is nothing but Schema Evaluation. But i could not and i do not know how to make the link established between the Schema Evaluation and CASE expression in Define Process level in SPRO, because i am expecting the dynamic schema name from CASE expression.

I have coded into the CF001 BRF which is assigned to CASE expression as shown below to find the correct and dynamic schema..

  • initialize value

ev_type = 'C'.

ev_length = 32.

ev_output_length = 32.

CLEAR ev_currency.

ev_decimals = 0.

ev_value = ''. " no processing

ev_data_missing = 'X'.

if (Condition)

ev_type = 'C'.

CLEAR ev_currency.

ev_output_length = 32.

ev_length = 32.

ev_decimals = 0.

ev_value = 'zsc_ex_catalog'.

else.

ev_type = 'C'.

CLEAR ev_currency.

ev_output_length = 32.

ev_length = 32.

ev_decimals = 0.

ev_value = 'zsc_ex_noncatalog'.

i do not specify any parameter for CF001 BRF . since i wrote the above code with the custom FM. John.. can you please share how can I determine the dynamic schema based on catalog or noncatalog.

I have configured the define process level in SPRO as shown below

Process Schema Evaluation : - ZSC_EV_SCHEMA

Process Schema Definition : - Object Type Process level Schema

bus2121 zsc_ex_catalog

bus2121 zsc_ex_noncatalog

Here is the problem , since there is no link i could make between Process Schema Evaluation 'ZSC_EV_SCHEMA' with Process Schema Definition as shown above. Because i have linked the Process Schema Evaluation: - 'ZSC_EV_SCHEMA' event with CASE BRF Expression which will return 'zsc_ex_catalog' or 'zsc_ex_noncatalog' in BRF. Hope you understand my problem. Your help will be highly appreciated. I need your help how to establish the link between Process Schema Evaluation and CASE Expression in define process level in SPRO. if you find something i am doing wrong... please help me to fix..

John

Former Member
0 Kudos

Hi

Sorry I didnt make myself clear enough. Yes I have developed the two process schema's but have been manually switching between them whilst configuring them. Now they are working ok, I need to dynamically select them.

I have not chosen the CASE statement approach, I have taken the advise of the guys earlier in this post and created a new FM based on the one suggested and used that. I have hard coded one of the values of the schemas in and it is returning the value ok.

So now I just need to understand what / how i can code the FM to check the source of supply being blank, which will indicated that the SC is a non catalog one and choose between the two schem's based on that

Your thoughts would be welcome.

Thanks

John

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

You need to clear the value of ev_data_missing when FM returns the schema name.

CLEAR ev_data_missing.

Regards,

Masa

Former Member
0 Kudos

Hi Masa

Do you have any thoughts on what I should I should pass into the new FM, in order to be able to check if its a Catalog or Non Catalog item?

Thanks

John

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Parameter should be /SAPSRM/CL_WF_RULE_CONTXT_SC for SC.

Please look at the code /SAPSRM/WF_BRF_0EXP001 or /SAPSRM/WF_BRF_0EXP000.

Regards,

Masa

Former Member
0 Kudos

Yes you can create a expression of type 0CF001.

While creating expression, you can utilize the standard expressions for the input data. For example, you need to get the schema name based on Product category, look for product category expression and pass it as input parameter.

Create the FM by copying /SAPSRM/WF_BRF_0EXP000.

use the IT_EXPRESSIONS table for retreiving the input values and check the condition

IF (condition).

ev_type = 'C'.

CLEAR ev_currency.

ev_output_length = 32.

ev_length = 32.

ev_decimals = 0.

ev_value = "Process Schema1".

ELSE.

ev_type = 'C'.

CLEAR ev_currency.

ev_output_length = 32.

ev_length = 32.

ev_decimals = 0.

ev_value = "Process schema2".

ENDIF.

Regards

Kannaiah

Former Member
0 Kudos

Hey at all,

solved my problem with brf case expression.

described in here

Thanks you all.