Skip to Content
0
Former Member
Jun 22, 2010 at 11:09 AM

Custom Expression creation in Process controlled workflow

125 Views

Hi All,

I am working on SRM 7.0 and utilizing process controlled workflow to model my approval workflow scenario. Below are the steps that i have done but still i have not got the desired result. May be i am missing something which the forum members can let me know.

step 1: i have copied the standard function module /SAPSRM/WF_BRF_0EXP001 and made chnages in the code based on the logic to populate the ev_value.

basically in the coding it is done this way.

      • initialize

      EV_TYPE = 'B'.

      EV_LENGTH = 1.

      CLEAR EV_CURRENCY.

      EV_OUTPUT_LENGTH = 1.

      EV_DECIMALS = 0.

      EV_VALUE = ABAP_FALSE. " no processing

      EV_DATA_MISSING = 'X'.

      • get event object

      LO_WF_BRF_EVENT ?= IO_EVENT.

      • get Context Container from BRF event

      LO_CONTEXT_PROVIDER = LO_WF_BRF_EVENT->GET_CONTEXT_PROVIDER( ).

      CALL METHOD LO_CONTEXT_PROVIDER->GET_DOCUMENT

      IMPORTING

      EV_DOCUMENT_GUID = LV_DOCUMENT_GUID

      EV_DOCUMENT_TYPE = LV_DOCUMENT_TYPE.

      CASE LV_DOCUMENT_TYPE.

      WHEN 'BUS2121'.

      • Get shopping cart instance

      LO_WF_PDO_SC ?= /SAPSRM/CL_WF_PDO_IMPL_FACTORY=>GET_INSTANCE(

      IV_DOCUMENT_GUID = LV_DOCUMENT_GUID

      IV_DOCUMENT_TYPE = LV_DOCUMENT_TYPE

      IV_PDO_EVENT_HANDLING = ABAP_FALSE

      ).

          • custom logic with the GUID of the shopping cart then populate value accordingly

          EV_VALUE = ABAP_TRUE.

          CLEAR EV_DATA_MISSING.

          step 2: create an event ZEV_001 linked to expresion ZEX_001.

          step 3: expression ZEX_001 is of type 0FB001. and the xpression is as below.

          ZEX_002 = OB_WF_TRUE.

          step 4: ZEX_002 is of type 0CF001 and output result type is B. the attached function module is the one created above by copying /SAPSRM/WF_BRF_0EXP001

          no parameters provided .

          step 5: the process step level config completed.

          now when i am creating shopping cart go for approval preview its gives an exception occured error . i cant see any dump in the system. however if in the custom fucnction module code if i do not clear the EV_DATA_MISSING. then i d o not get the error but my steps is not executed. Inslg1 log i see the process level executed but return as space.

          as per other post in the forum we have to clear EV_DATA_MISSING but that casuing exception eror for me. in the dlg1 log howere the steps expressin i can see executed with return =X.

          hope i am made myself clear . feel free to ask for any more info.

          i have below question.

          1) do we need to copy /SAPSRM/WF_BRF_0EXP001 or /SAPSRM/WF_BRF_0EXP000 for creating a custom FM expression.

          2)what does the check box "Calculation of Parameter in Function Module/Badi/method" does

          3) how can i do debugging for such FM expression , probably saving the cart and then debugging the expression.

          Thanks in advance for any help provided.

          Cheers

          Iftekhar Alam