Approver index

Hi
I'm using a N-step approval workflow (WS14000133).
When I create a shopping cart the approval index = 0. When the first approver has approved the shopping cart a new approver i determined (2th step) and now the approver index = 1.
My problem is that if I create a SC and Hold it the approver index = 0. When I later on want to order this sc the approver index = 1 even though the shopping cart has not been approved by anyone (1st step).
How is it possible to tell the difference between the two situations???
Best regards
Jesper Dueholm

Hello khan voyalpad usman,
I have the same problem. I see the question is answered but I don't see the solution.
We're on SRM 5.0 SP 12. Hope you can give me some information on this.
Kind regards,
Bert

Similar Messages

  • BADI n-step SC approval - Approval Index and Data Change Problems

    Dear forum gurus,
    We are implementing SRM 5.0 (SRM SERVER 5.5 SP 9) in Extended classic. I am developing the BADI's to use the n-step SC approval workflow WS14000133.
    Our approval process is as follows:
    1. Cost Centre approver (based on CC with the largest value in the SC)
    2. Financial approver (based on the total value of the SC)
    I have done this now and it works as long as every step is approved!
    I have implemented the BADI 'BBP_WFL_EMPL_WI_BADI' - method 'CHECK_REQUESTER_WI' to send back any changes to the cost centre to the shopper to review. The standard also sends back total value changes to the shopper in the same way.
    My problem is that if the main CC or the total value of the SC are changed, the logic goes back to the shopper and then if the shopper 'Accepts changes', the logic skips the first apporver again and goes directly to the second (financial approver).
    I think there are 2 options:
    1. After the shopper accepts chnages, to restart the WF so a new WF template is generated. Then my logic will show the new CC and FI approvers again.
    2. I change my logic in the 'GET_REMAING_APPROVERS' method so the apporval index is not assumed to be 1 or 2 only. I guess I will have to work with logic to read the history and apporval index, but this seems very complex.
    Option 1 - I can't get this to work. After the shopper accepts changes I can't get the WF to restart in the 'BBP_WFL_SECUR_BADI'.
    Has anyone fixed this?
    Option 2 - The logic for checking apporval index and apporval history tables seems to me very complex. Has anyone done this and can they explain the logic to me if so? The problem here is that the sample code for this BADI assumes the approval indexis always 1 for the first step and 2 for the second step, but this is not the case!
    Thanks in advance,
    Best regards,
    Nick

    Hi,
    I feel setting the parameter BBP_WFL_SECURITY  for the Approver should do the trick.i.e. Restart the workflow adn the same approval process should be followed again.So plese adjust the value of this parameter for the Approver role in trascn PFCG.Also if you want to overwrite the settings of this paramtere(as maintained in PFCG),you can implement the BADI "BBP_WFL_SECUR_BADI".
    For  more info,refer  the foll links:
    http://help.sap.com/saphelp_srm50/helpdata/en/37/830b3b7e7ef74de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/f7/a6a3415e34b05fe10000000a1550b0/frameset.htm
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • Approval Index in Application controlled WF

    Hi All
    I am working on Application controlled WF. I created a implementation for the BAdI- BBP_WFL_APPROV_BADI. In the method- GET_REMAING_APPROVERS, one of the importing parameter is ACTUAL_APPROVAL_INDEX.
    While i am creating SC (from portal), if i click on Approval Process Overview button, BAdI is getting with Approval_Index as 000000 and if i order the SC, BAdI is getting with Approval_Index as 000000.
    Please let me know, always the approval index will be 00000 (initially) and do we need to increase the approval index inside the BAdI?
    Vinoth

    Hi,
      you are taking two different things.. ACTUAL_APPROVAL_INDEX is import parameter of the Badi, But Approval_Index is part of the approval_table which is exporting parameter of the Baid..
    the approval index must be increased based on number of level you wants the sc to be approved..for an example..
    you want a SC to  be approved by 4 levels of approver's then the approval_table must be appended as follows
    approval_index = 1
    1st approver details.
    approval_index = 2
    2nd approver details.
    approval_index = 3
    3rd approver details.
    approval_index = 4
    4th approver details.
    ACTUAL_APPROVAL_INDEX is import parameter of the Badi is update dynamically once the approver take the decision for an example.. Assume that the 3rd level approver approve the sc.. now the ACTUAL_APPROVAL_INDEX is 3..
    Saravanan

  • WS14500015 is not working for Multilevel approval

    We are trying to Implement the Workflow Template Ws14500015. We have implemented the BADI BBP_WFL_APPROVE_BADI. The workflow works perfectly for 1st level approval. We have checked that the ApproverList Container element gets pouplated with 3 levels of approval when 1 st level approver has not approved it. But as soon as the first level approver approves it this container element is updated with one entry. Please review the code I am attaching. Any help will be highly appreciated.
    METHOD if_ex_bbp_wfl_approv_badi~get_remaing_approvers .
    Interface parameters:
    OBJECT_ID                  TYPE  CRMT_OBJECT_ID                "Import
    OBJECT_TYPE                TYPE  CRMT_SUBOBJECT_CATEGORY       "Import
    GUID                       TYPE  BBP_GUID_32                   "Import
    ACTUAL_APPROVAL_INDEX      TYPE  SWH_NUMC10                    "Import
    APPROVAL_HISTORY_TABLE     TYPE  BBP_WFL_APPROVAL_HISTORY_BADI "Import
    ITEM_APPROVAL_HISTORY_TABLE TYPE BBPT_WFL_ITEM_APPROVAL_BADI   "Import
    APPROVAL_TABLE             TYPE  BBPT_WFL_APPROVAL_TABLE_BADI  "Export
    ITEM_APPROVAL_TABLE        TYPE  BBPT_WFL_ITEM_APPROVAL_BADI   "Export
    NO_FURTHER_APPROVAL_NEEDED TYPE  BOOLEAN                       "Export
    ITEM_APPROVAL_OBJ          TYPE  BBPT_WFL_ITEM_APPROVAL_OBJ  "Changing
    This a default implementation that gives idea about of how line item
    approval should work as well to find the number of approval required
    and to find the approvers.
    Global data---------------------------------------------------------*
    TYPES---------------------------------------------------------------*
      TYPES : ty_item_info    TYPE STANDARD TABLE OF /fir/rmm0bgst001.
                  "to have the necessary values of custom table .
    DATA----------------------------------------------------------------*
      DATA : it_item_info TYPE ty_item_info,"to store the approval values.
             wa_item_info TYPE /fir/rmm0bgst001. " work area for item_info.
      DATA : v_value_per_cctr TYPE bbp_value, " contain value per account
                                              " type in line item of SC
             v_value_per      TYPE bbp_value. " value for v_value_per_cctr
                                              " in USD
      DATA : v_apprv_value    TYPE bbp_value. " amount of first level.
      DATA:  v_call_value1    TYPE bbp_wfl_app_property,"have cost_ctr,
                              "asset_no or order_no value.
             v_co_code        TYPE bbp_wfl_app_property," have company code
             v_plant_value    TYPE bbp_wfl_app_property," have plant value
             v_account_type   TYPE bbp_wfl_app_criterion ," Account type
                              " ie COST_CTR, ASSET_NO or ORDER_NO.
             v_comp_code      TYPE bbp_wfl_app_criterion ,"COMP_CODE
             v_plant          TYPE bbp_wfl_app_criterion ," PLANT
             v_acc_desc       TYPE bbp_step_description ." approval desc.
    WORKAREA------------------------------------------------------------*
      DATA:  wa_header         TYPE bbp_pds_sc_header_d, " header of line
                                                         " item
    tables and work area.
             it_item           TYPE TABLE OF bbp_pds_sc_item_d,
                                            " line item details
             wa_item           TYPE bbp_pds_sc_item_d,
                                            " have one line item detail.
    accounting structures
             it_account        TYPE TABLE OF bbp_pds_acc,
                                            " account details
             wa_account        TYPE bbp_pds_acc .
                                            " one account details.
      DATA: v_req TYPE bbp_wfl_app_criterion. " for creator.
    CONSTANTS-----------------------------------------------------------*
    Business objects
      CONSTANTS:
       c_po            TYPE crmt_subobject_category_db VALUE 'BUS2201',
       c_shop          TYPE crmt_subobject_category_db VALUE 'BUS2121',
       c_contract      TYPE crmt_subobject_category_db VALUE 'BUS2000113'.
    Approval Criteria and properties used
      CONSTANTS:
        c_cost_centre  TYPE bbp_wfl_app_criterion  VALUE 'COST_CTR',
        c_order_no     TYPE bbp_wfl_app_criterion  VALUE 'ORDER_NO',
        c_asset_no     TYPE bbp_wfl_app_criterion  VALUE 'ASSET_NO',
        c_comp_code    TYPE bbp_wfl_app_criterion  VALUE 'COMP_CODE',
        c_plant        TYPE bbp_wfl_app_criterion  VALUE 'PLANT',
        c_cc_desc      TYPE bbp_step_description   VALUE
                                                 'Cost center approval',
        c_io_desc      TYPE bbp_step_description   VALUE
                                                 'Order type approval',
        c_as_desc      TYPE bbp_step_description   VALUE
                                                 'Asset Num approval',
        c_usd          TYPE char3 VALUE 'USD',
        c_m            TYPE char1 VALUE 'M',
        c_x            TYPE char1 VALUE 'X',
        c_apprv_times  TYPE char1 VALUE 3,
        c_1            TYPE char2 VALUE '1',
        c_as           TYPE BBP_ACC_CAT VALUE 'AS',
        c_or           TYPE BBP_ACC_CAT VALUE 'OR',
        c_cc           TYPE BBP_ACC_CAT VALUE 'CC',
        c_us           TYPE char2       VALUE 'US'.
    Case when the object type bus212...---------------------------------*
      CASE object_type.
        WHEN c_shop.
    -----------   shopping cart --------------------------------------- *
          IF NOT approval_table[] IS INITIAL.
            approval_history_table[] = approval_table[].
            item_approval_history_table[] = item_approval_table[].
            REFRESH  : approval_table, item_approval_table,
                    item_approval_obj   .
          ENDIF.
          REFRESH : it_item,it_account.
        Get the details of the shopping cart
          CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
            EXPORTING
              i_object_id = object_id
            IMPORTING
              e_header    = wa_header
            TABLES
              e_item      = it_item
              e_account   = it_account.
        Proceed if it_item is not initial.
          IF NOT it_item IS INITIAL AND NOT it_account IS INITIAL.
    *read the lt_item for plant
            READ TABLE it_item INTO wa_item INDEX 1.
    CHANGE FOR REQEUSTOR.
            CONCATENATE c_us wa_item-created_by INTO v_req.
          now read the table with wa_item-be_plant.
            SELECT *
              FROM /fir/rmm0bgst001
              INTO TABLE it_item_info
              WHERE zplant = wa_item-be_plant.
            SORT it_item BY guid .
            SORT it_account BY p_guid .
            IF actual_approval_index LE c_apprv_times AND
               actual_approval_index GE c_1.
          looping at it_item is done to fetch the approver for every
          line item
              CLEAR: wa_item, wa_account.
              LOOP AT it_item INTO wa_item WHERE del_ind IS INITIAL.
                LOOP AT it_account  INTO wa_account
                  WHERE p_guid = wa_item-guid.
    to calculate the amount before calling the funciton module for
    approval table.value respective to account type
                  v_value_per_cctr =
                  wa_account-distr_perc * wa_item-value / 100.
    read the table respective to account type and for level 1 approval
    such that if the value is less than zvalue then no approval required.
                  CLEAR: wa_item_info.
                  CASE wa_account-acc_cat .
                    WHEN c_or.
                       READ TABLE it_item_info INTO wa_item_info
                        WITH KEY zlevel = c_1   " 1
                       zorder_no = wa_account-order_no
                       zplant    = wa_item-be_plant.
                    WHEN c_as.
                       READ TABLE it_item_info INTO wa_item_info
                        WITH KEY zlevel = c_1   " 1
                       zasset_no = wa_account-asset_no
                       zplant    = wa_item-be_plant.
                    WHEN c_cc.
                       READ TABLE it_item_info INTO wa_item_info
                        WITH KEY zlevel = c_1     " 1
                       zcost_ctr = wa_account-cost_ctr
                       zplant    = wa_item-be_plant.
                  ENDCASE.
                  IF sy-subrc = 0.
                    v_apprv_value = wa_item_info-zvalue.
                  ENDIF.
                now convert the amount to local currency ie usd
                  CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
                    EXPORTING
                    CLIENT                  = SY-MANDT
                      date                    = sy-datum
                      foreign_amount          = v_value_per_cctr
                      foreign_currency        = wa_item-currency
                      local_currency          = c_usd
                     type_of_rate            = c_m
                     read_tcurr              = c_x
                   IMPORTING
                     local_amount            = v_value_per
                   EXCEPTIONS
                     no_rate_found           = 1
                     overflow                = 2
                     no_factors_found        = 3
                     no_spread_found         = 4
                     derived_2_times         = 5
                     OTHERS                  = 6
                  IF v_value_per GE v_apprv_value AND sy-subrc = 0.
    To Find out Account id of what type ie cost center/IO/Asset.
                    IF wa_account-acc_cat eq c_cc.
                      v_call_value1 = wa_account-cost_ctr.
                      v_account_type = c_cost_centre.
                      v_acc_desc  = c_cc_desc. "'Cost center approval'.
                    ELSEIF wa_account-acc_cat eq c_or.
                      v_call_value1 = wa_account-order_no.
                      v_account_type = c_order_no.
                      v_acc_desc  = c_io_desc. "'Internal Order approval'.
                    ELSE.
                   IF NOT wa_account-asset_no IS INITIAL.
                      v_call_value1 = wa_account-asset_no.
                      v_account_type = c_asset_no..
                      v_acc_desc  = c_as_desc. "'Asset Number approval'.
                   ENDIF.
                    ENDIF.
                  Defining the PLANT and plant value.
                    v_plant = c_plant.
                    v_plant_value = wa_item-be_plant.
                  defining the COMPNAY CODE and company value.
                    v_comp_code = c_comp_code.
                    v_co_code   = wa_item-be_co_code.
                  Calling the Custom function to find the approvers.
                    CALL FUNCTION '/FIR/RP2P0BGS_ITEM_APPRV_GET'
                      EXPORTING
                        sc_guid                    = wa_header-guid
                        item_guid                  = wa_item-guid
                        approval_description       = v_acc_desc
                        hide_items_not_responsible = c_x "'X'
    each cost center approver should see only items he is responsible
                        criterion1                 = v_account_type
                        criterion2                 = v_comp_code
                        criterion3                 = v_plant
                        value1                     = v_call_value1
                        value2                     = v_co_code
                        value3                     = v_plant_value
                        approval_index           = actual_approval_index
                      TABLES
                        it_item_info               = it_item_info
                      CHANGING
                        approval_table             = approval_table
                        item_approval_table        = item_approval_table
                        item_approval_obj          = item_approval_obj.
                  ENDIF." end if if value per cost center is more than
                  " level one price.
                  CLEAR wa_account.
                ENDLOOP. " end of loop of account.
                CLEAR:  wa_account,wa_item, wa_item_info.
              ENDLOOP. " end of loop at item
    CHANGE FOR REQUESTOR.----
              DELETE approval_table WHERE approval_agent = v_req.
              IF approval_table IS INITIAL.
                no_further_approval_needed = c_x. " 'X'.
              ENDIF.
            ELSE. " end of if actual_approval_index le 3.
            this BADI-implementation defines 3 steps
              no_further_approval_needed = c_x. "'X'.
            ENDIF.
          ENDIF. " end of if the it_item is not initial.
      ENDCASE. "end of case if bus type is 2121
    ENDMETHOD.
    Function Module
    FUNCTION /fir/rp2p0bgs_item_apprv_get .
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(SC_GUID) TYPE  BBP_GUID OPTIONAL
    *"     REFERENCE(ITEM_GUID) TYPE  BBP_GUID OPTIONAL
    *"     REFERENCE(APPROVAL_DESCRIPTION) TYPE  BBP_STEP_DESCRIPTION
    *"       OPTIONAL
    *"     REFERENCE(HIDE_ITEMS_NOT_RESPONSIBLE) TYPE  BOOLEAN OPTIONAL
    *"     REFERENCE(CRITERION1) TYPE  BBP_WFL_APP_CRITERION OPTIONAL
    *"     REFERENCE(CRITERION2) TYPE  BBP_WFL_APP_CRITERION DEFAULT ''
    *"     REFERENCE(CRITERION3) TYPE  BBP_WFL_APP_CRITERION DEFAULT ''
    *"     REFERENCE(VALUE1) TYPE  BBP_WFL_APP_PROPERTY DEFAULT ''
    *"     REFERENCE(VALUE2) TYPE  BBP_WFL_APP_PROPERTY DEFAULT ''
    *"     REFERENCE(VALUE3) TYPE  BBP_WFL_APP_PROPERTY DEFAULT ''
    *"     REFERENCE(APPROVAL_INDEX) TYPE  SWH_NUMC10 OPTIONAL
    *"  TABLES
    *"      IT_ITEM_INFO STRUCTURE  /FIR/RMM0BGST001
    *"  CHANGING
    *"     REFERENCE(APPROVAL_TABLE) TYPE  BBPT_WFL_APPROVAL_TABLE_BADI
    *"     REFERENCE(ITEM_APPROVAL_TABLE) TYPE  BBPT_WFL_ITEM_APPROVAL_BADI
    *"     REFERENCE(ITEM_APPROVAL_OBJ) TYPE  BBPT_WFL_ITEM_APPROVAL_OBJ
    *"       OPTIONAL
    Local data-----------------------------------------------------------*
      TYPES: ty_option TYPE STANDARD TABLE OF rfc_db_opt,
             ty_fields TYPE STANDARD TABLE OF rfc_db_fld,
             ty_data   TYPE STANDARD TABLE OF tab512.
      DATA:
        wa_approval_table      TYPE bbp_wfl_approval_table_badi,
        wa_item_approval_table TYPE bbps_wfl_item_approval,
        wa_approval_def        TYPE /fir/rmm0bgst001.
      DATA:
        v_app_obj_guid           TYPE bbp_guid_32,
        v_is_new_approval_object TYPE boolean.
      DATA : it_update_tab   TYPE STANDARD TABLE OF /fir/rmm0bgst001,
             it_approval_def TYPE STANDARD TABLE OF /fir/rmm0bgst001,
             wa_update_tab   TYPE /fir/rmm0bgst001.
      DATA : it_actor_tab    TYPE STANDARD TABLE OF swhactor,
             wa_actor_tab    TYPE swhactor,
             it_ac_container TYPE STANDARD TABLE OF swcont,
             wa_ac_container TYPE swcont.
      DATA : it_options TYPE ty_option,
             it_fields  TYPE ty_fields,
             it_data    TYPE ty_data.
      DATA : wa_options TYPE  rfc_db_opt,
             wa_fields  TYPE  rfc_db_fld,
             wa_data    TYPE  tab512.
      DATA : v_apprv_io TYPE aufuser2,
             v_apprv_cc TYPE verak.
      DATA : v_cost_ctr  TYPE  bbp_wfl_app_property ,
             v_order_no  TYPE  bbp_wfl_app_property ,
             v_asset_no  TYPE  bbp_wfl_app_property ,
             v_as_value  TYPE  bbp_wfl_app_property .
      DATA : v_query_table   TYPE dd02l-tabname.
      DATA : v_apprv_count   TYPE char1 VALUE '0'.
    to find the number of lines in the table it_update_tab.
      DATA : v_lines TYPE i.
      DATA : v_app_ind TYPE swh_numc10 VALUE '0'.
      DATA : v_destination   TYPE char10,
             v_system        TYPE sysysid,
             v_mandt         TYPE symandt.
    Constants-----------------------------------------------------------*
      CONSTANTS:
        c_clnt          TYPE char4 VALUE 'CLNT',
        c_agent_is_user TYPE otype VALUE 'US',
        c_x             TYPE char1 VALUE 'X',
        c_cost_centre   TYPE bbp_wfl_app_criterion  VALUE 'COST_CTR',
        c_order_no      TYPE bbp_wfl_app_criterion  VALUE 'ORDER_NO',
        c_asset_no      TYPE bbp_wfl_app_criterion  VALUE 'ASSET_NO',
        c_csks          TYPE char4 VALUE 'CSKS',
        c_anlz          TYPE char4 VALUE 'ANLZ',
        c_coas          TYPE char4 VALUE 'COAS',
        c_verak         TYPE char5 VALUE 'VERAK',
        c_user2         TYPE char5 VALUE 'USER2',
        c_kostl         TYPE char5 VALUE 'KOSTL',
        c_aufnr         TYPE char5 VALUE 'AUFNR',
        c_bukrs         TYPE char5 VALUE 'BUKRS',
        c_anln1         TYPE char5 VALUE 'ANLN1',
        c_c             TYPE char1 VALUE 'C',
        c_and           TYPE char3 VALUE 'AND',
        c_eq            TYPE char1 VALUE '=',
        c_org_object    TYPE swc_elem VALUE 'ORG_OBJECT',
        c_deli          TYPE char1 VALUE '|',
        c_l12           TYPE ddleng VALUE '000012',
        c_off0          TYPE doffset VALUE '000000',
        c_l10           TYPE ddleng VALUE '000010',
        c_l20           TYPE ddleng VALUE '000020',
        c_l04           TYPE ddleng VALUE '000004',
        c_ind01         TYPE swc_index VALUE '000001',
        c_el06          TYPE swc_length VALUE '006',
        c_tab_name      TYPE tabname  VALUE '/fir/rmm0bgst001',
        c_r10           TYPE sysysid VALUE 'R10',
        c_r15           TYPE sysysid VALUE 'R15',
        c_r20           TYPE sysysid VALUE 'R20',
        c_r40           TYPE sysysid VALUE 'R40',
        c_e10           TYPE sysysid VALUE 'E10',
        c_e15           TYPE sysysid VALUE 'E15',
        c_e20           TYPE sysysid VALUE 'E20',
        c_e40           TYPE sysysid VALUE 'E40',
        c_121           TYPE symandt VALUE '121',
        c_300           TYPE symandt VALUE '300',
        c_100           TYPE symandt VALUE '100',
        c_120           TYPE symandt VALUE '120',
    begin of change for generic entry 06-06-2007----
        c_cc            TYPE kostl   VALUE 'CC',
        c_as            TYPE anln1   VALUE 'AS',
        c_or            TYPE aufnr   VALUE 'OR'.
    end of change for generic entry 06-06-2007----
    -perpare the system and client for RFC----
      CASE sy-sysid .
        WHEN c_r10.                                             "' R10'.
          IF sy-mandt = c_120.                                  " '120'.
            CONCATENATE c_e10 c_clnt c_121 INTO v_destination.
          ENDIF.
        WHEN c_r15.                                             " 'R15'.
          IF sy-mandt = c_120.                                  " '120'.
            CONCATENATE c_e15 c_clnt c_300 INTO v_destination.
          ENDIF.
        WHEN c_r20.                                             " 'R20'.
          IF sy-mandt = c_300.                                  " '300'.
            CONCATENATE c_e20 c_clnt c_300 INTO v_destination.
          ENDIF.
        WHEN c_r40.                                             " 'R40'.
          IF sy-mandt = c_100.                                  " '100'.
            CONCATENATE c_e40 c_clnt c_100 INTO v_destination.
          ENDIF.
      ENDCASE.
    Comment on logic ---------------------------------------------------*
    First find the right approval object the item belongs to.
    All items of an approval object are approved together in
    this approval step, and therefore only one workitem is
    created for this items.
      CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
        EXPORTING
          sc_guid                 = sc_guid
          criterion1              = criterion1
          value1                  = value1
       IMPORTING
    If 2 items of the same shopping cart have the same
    values for the criterias, this function returns the
    same (!!!) approval object guid
         approval_obj_guid       = v_app_obj_guid
        TABLES
         item_app_obj            = item_approval_obj
    Check what type of account is ie Order no/Internal order/ASSET.
    if the account type is asset_no then responsible cost center is
    found.
      CLEAR: it_update_tab, wa_update_tab.
      CASE criterion1 .
        WHEN c_asset_no.    " 'ASSET_NO'.
          v_asset_no = value1.
          CONCATENATE c_anln1 c_eq value1 " 'ANLN1' '=' value1
            c_and c_bukrs c_eq value2 INTO wa_options-text
            SEPARATED BY space.
          APPEND wa_options TO it_options.
          wa_fields-fieldname = c_anln1.                        " 'ANLN1'.
          wa_fields-length    = c_l12.                          " '000012'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.      " 'C'.
          APPEND wa_fields TO it_fields.
          wa_fields-fieldname = c_kostl.  " 'KOSTL'.
          wa_fields-length    = c_l10.                          " '000010'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.      " 'C'.
          APPEND wa_fields TO it_fields.
          wa_fields-fieldname = c_bukrs.  " 'BUKRS'.
          wa_fields-length    = c_l04.                          " '000004'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.      " 'C'.
          APPEND wa_fields TO it_fields.
          CALL FUNCTION 'RFC_READ_TABLE' DESTINATION v_destination
            EXPORTING
              query_table          = c_anlz  " 'ANLZ'
              delimiter            = c_deli  " '|'
            TABLES
              OPTIONS              = it_options
              fields               = it_fields
              data                 = it_data
            EXCEPTIONS
              table_not_available  = 1
              table_without_data   = 2
              option_not_valid     = 3
              field_not_valid      = 4
              not_authorized       = 5
              data_buffer_exceeded = 6
              OTHERS               = 7.
          IF sy-subrc = 0.
          as it_data table contains only one record
          so no sorting required.
            READ TABLE it_data INTO wa_data INDEX 1.
            v_as_value = wa_data-wa+13(10).
          ENDIF.
        at the end of this if asset is passed its responsible
        cost is obtained and is placed in value1 field.
          CLEAR : wa_data , wa_options , wa_fields .
          REFRESH: it_data , it_options , it_fields .
          v_cost_ctr = v_as_value.
          CONCATENATE c_kostl c_eq v_cost_ctr INTO wa_options-text
          SEPARATED BY space.
          APPEND wa_options TO it_options.
          CLEAR: wa_fields.
          wa_fields-fieldname = c_verak.   " 'VERAK'.
          wa_fields-length    = c_l20.                          " '000020'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.        " 'C'.
          APPEND wa_fields TO it_fields.
          CLEAR: wa_fields.
          wa_fields-fieldname = c_kostl.    " 'KOSTL'.
          wa_fields-length    = c_l10.                          " '000010'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.        " 'C'.
          APPEND wa_fields TO it_fields.
          v_query_table = c_csks. " 'CSKS'.
        set the initial value of v_asset_no by value1.
          CLEAR: v_cost_ctr .
          v_asset_no = value1.
        WHEN c_cost_centre . " 'COST_CTR' or 'ASSET_NO'.
          v_cost_ctr = value1.
          CONCATENATE c_kostl c_eq v_cost_ctr INTO wa_options-text
          SEPARATED BY space.
          APPEND wa_options TO it_options.
          CLEAR: wa_fields.
          wa_fields-fieldname = c_verak.   " 'VERAK'.
          wa_fields-length    = c_l20.                          " '000020'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.        " 'C'.
          APPEND wa_fields TO it_fields.
          CLEAR: wa_fields.
          wa_fields-fieldname = c_kostl.    " 'KOSTL'.
          wa_fields-length    = c_l10.                          " '000010'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.        " 'C'.
          APPEND wa_fields TO it_fields.
          v_query_table = c_csks. " 'CSKS'.
        WHEN c_order_no.    " 'ORDER_NO'.
          v_order_no = value1.
          CONCATENATE c_aufnr c_eq value1 INTO wa_options-text
          SEPARATED BY space.
          APPEND wa_options TO it_options.
          CLEAR: wa_fields.
          wa_fields-fieldname = c_user2.                        " 'USER2'.
          wa_fields-length    = c_l20.                          " '000020'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.      " 'C'.
          APPEND wa_fields TO it_fields.
          CLEAR: wa_fields.
          wa_fields-fieldname = c_aufnr.   " 'AUFNR'.
          wa_fields-length    = c_l12.                          " '000012'.
          wa_fields-offset    = c_off0.                         " '000000'.
          wa_fields-type      = c_c.        " 'C'.
          APPEND wa_fields TO it_fields.
          v_query_table = c_coas. " 'COAS'.
      ENDCASE.
      LOOP AT it_item_info INTO wa_update_tab
        WHERE
              zplant    = value3       AND
              zcost_ctr = v_cost_ctr AND
              zorder_no = v_order_no AND
              zasset_no = v_asset_no.
        APPEND wa_update_tab TO it_update_tab .
      ENDLOOP.
    -begin of change for generic entry 06-06-2007----
    it_update_tab may or may not contain the value as the per the data
    maintainted. if initial then only generic value is maintained and the
    the record need to be appended.
    so the record which need to be appended shud be appended to
    it_update_tab appropiatly with the amt of generic entry.
      CLEAR : wa_update_tab.
      CASE criterion1 .
        WHEN c_asset_no.
          READ TABLE it_item_info INTO wa_update_tab WITH KEY
          zplant = value3
          zasset_no = c_as."'AS'
          IF sy-subrc = 0.
            wa_update_tab-zasset_no = v_asset_no .
            wa_update_tab-zlevel    = 1.
            APPEND wa_update_tab TO it_update_tab.
          ENDIF.
        WHEN c_cost_centre.
          READ TABLE it_item_info INTO wa_update_tab WITH KEY
          zplant = value3
          zcost_ctr = c_cc."'CC'
          IF sy-subrc = 0.
            wa_update_tab-zcost_ctr = v_cost_ctr .
            wa_update_tab-zlevel    = 1.
            APPEND wa_update_tab TO it_update_tab.
          ENDIF.
        WHEN c_order_no.
          READ TABLE it_item_info INTO wa_update_tab WITH KEY
          zplant = value3
          zorder_no = c_or."'OR'
          IF sy-subrc = 0.
            wa_update_tab-zorder_no = v_order_no .
            wa_update_tab-zlevel    = 1.
            APPEND wa_update_tab TO it_update_tab.
          ENDIF.
      ENDCASE.
    end of change for generic entry 06-06-2007----
    RFC to read table for finding the person responsible for the
    cost center / order ie approver.
      CALL FUNCTION 'RFC_READ_TABLE' DESTINATION v_destination
        EXPORTING
          query_table          = v_query_table
          delimiter            = c_deli   "'|'
        TABLES
          OPTIONS              = it_options
          fields               = it_fields
          data                 = it_data
        EXCEPTIONS
          table_not_available  = 1
          table_without_data   = 2
          option_not_valid     = 3
          field_not_valid      = 4
          not_authorized       = 5
          data_buffer_exceeded = 6
          OTHERS               = 7.
      IF sy-subrc = 0.
        CLEAR :wa_approval_def.
        READ TABLE it_data INTO wa_data INDEX 1.
        IF v_query_table = c_csks.    " 'CSKS'.
          v_apprv_cc = wa_data-wa+0(20).
          wa_approval_def-zapprover = v_apprv_cc.
        ELSE.
          v_apprv_io = wa_data-wa+0(20).
          wa_approval_def-zapprover = v_apprv_io.
        ENDIF.
      ENDIF.
      find the number of record in the update table.
      DESCRIBE TABLE it_update_tab LINES v_lines.
      The updation of table runs only for the number of records
      avaiable in the  update table ie v_lines.
      DO v_lines TIMES.        " begin of do to approval index times.
         CLEAR: it_approval_def.
        v_apprv_count = v_apprv_count + 1.
        wa_approval_def-zlevel    = v_apprv_count .
      if the count is more than one then next level of approver
      is found using the rfc call swx_get_manager and stored as per.
        IF v_apprv_count > 1.
          v_apprv_count = v_apprv_count - 1.
          READ TABLE it_update_tab INTO wa_update_tab
               WITH KEY zlevel = v_apprv_count .
          IF sy-subrc = 0 .
    NOW FOR FINDING THE SECOND LEVEL OF APPROVER
    1ST LEVEL OF APPROVER IS FOUND USING ABOVE READ.
    THE FIRST LEVEL OF APPROVER IS USED TO FIND THE SECOND
    LEVEL OF APPROVER USING THE SWX_GET_MANAGER.
    PREPARE THE TABLES FOR SWX_GET_MANAGER
            REFRESH : it_ac_container.
            wa_ac_container-element = c_org_object. " 'ORG_OBJECT'.
            wa_ac_container-tab_index = c_ind01.                " '000001'.
            wa_ac_container-elemlength = c_el06.                " '006'.
            wa_ac_container-type       = c_c.   " 'C'.
            CONCATENATE c_agent_is_user wa_update_tab-zapprover
            INTO wa_ac_container-value .
            APPEND wa_ac_container TO it_ac_container.
            CALL FUNCTION 'SWX_GET_MANAGER' DESTINATION v_destination
              TABLES
                actor_tab    = it_actor_tab
                ac_container = it_ac_container
              EXCEPTIONS
                nobody_found = 1
                OTHERS       = 2.
            IF sy-subrc = 0.
              READ TABLE it_actor_tab INTO wa_actor_tab WITH KEY
                   otype = c_agent_is_user.
              wa_approval_def-zapprover = wa_actor_tab-objid.
            ENDIF.
          ENDIF.
          v_apprv_count = v_apprv_count + 1.
        ENDIF.
      before updating populate the table it_approval_def
      it_update_tab is read based on next v_apprv_count and
      updates the approver and its value.
        READ TABLE it_update_tab INTO wa_update_tab
               WITH KEY zlevel = v_apprv_count .
        IF sy-subrc = 0.
          wa_approval_def-zplant = wa_update_tab-zplant.
          wa_approval_def-zcost_ctr = wa_update_tab-zcost_ctr.
          wa_approval_def-zorder_no = wa_update_tab-zorder_no.
          wa_approval_def-zasset_no = wa_update_tab-zasset_no.
          wa_approval_def-zvalue = wa_update_tab-zvalue.
          APPEND wa_approval_def TO it_approval_def.
    modify the table it_update_tab so that along with the custom
    database table the table in use in this function module ie
    it_update_tab also remain updated.
    benefit is that if the modify to dtab fails. the process works fine.
          MODIFY it_update_tab FROM wa_approval_def
                   TRANSPORTING zapprover
                   WHERE zlevel = wa_approval_def-zlevel AND
                         zvalue = wa_approval_def-zvalue.
      now enqueue the table for modification.
          CALL FUNCTION 'ENQUEUE_E_TABLE'
            EXPORTING
              tabname        = c_tab_name       " '/fir/rmm0bgst001'
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 2
              OTHERS         = 3.
          now modify the table, for updation of approver.
          IF sy-subrc = 0.
            MODIFY /fir/rmm0bgst001 FROM wa_approval_def.
            if sy-subrc goes 0 commit work is called.
            also the it_update_tab need to be updated.
            IF sy-subrc = 0.
              COMMIT WORK.
            ENDIF.
          ENDIF.
      now dequeue the table after the updation.
          CALL FUNCTION 'DEQUEUE_E_TABLE'
            EXPORTING
              tabname = c_tab_name.     " '/fir/rmm0bgst001'.
        ENDIF.
        once all done clear the work areas.
        CLEAR : wa_approval_def-zlevel , wa_approval_def-zapprover.
      ENDDO.                               " END OF DO STATEMENT.
      SORT it_approval_def BY zlevel ASCENDING.
    as per the logic for the different level of approval.
    for second level of approval only records above 2 should be
    present in the apprval table.
    so for approval index = 2 delete the first record ie for zlevel  = 1.
    and for approval index = 3 delete first two records ie zlevel = 1 and
    zlevel = 2. thus only one approval of zlevel 3 is left in the table
    which is used to update the approval table.
      IF approval_index = 2 .
        DELETE it_approval_def INDEX 1.
      ELSEIF approval_index = 3.
        DELETE it_approval_def INDEX 1.
        DELETE it_approval_def INDEX 1.
      ELSEIF approval_index GT 3.
        REFRESH : it_approval_def .
      ENDIF.
    for above 3 as approval index there shud be no enteries in the table.
    so the table is refreshed and thus the approval table will not
    contain anything.
    approval_index is assigned to a varaiable
      v_app_ind = approval_index.
    v_app_ind is incremented for every next record so that approver is
    assigned to next approval index.
    beign of change 28th may 2007----
    clear : v_app_ind .
    v_app_ind = v_app_ind + 1.
      LOOP AT it_approval_def INTO wa_approval_def.
        wa_approval_table-approval_index       = v_app_ind.
        CONCATENATE c_agent_is_user wa_approval_def-zapprover
        INTO wa_approval_table-approval_agent.
        wa_approval_table-approval_description = approval_description.
        wa_approval_table-approval_object_guid = v_app_obj_guid.
        wa_approval_table-hide_items_not_responsible =
                                hide_items_not_responsible.
        APPEND wa_approval_table TO approval_table.
        v_app_ind = v_app_ind + 1 .
        CLEAR: wa_approval_def.
      ENDLOOP.
      sort the approval table so that approvers come in sequence.
      SORT approval_table BY approval_index.
    ENDIF.
    fill item table (which items belongs to which approval object)
      wa_item_approval_table-approval_object_guid = v_app_obj_guid.
      wa_item_approval_table-approval_item_guid   = item_guid.
      APPEND wa_item_approval_table TO item_approval_table.
      CLEAR :wa_item_approval_table,wa_approval_table,it_update_tab.
    ENDFUNCTION.
    Thanks
    Arghadip
    [email protected]

    Hi,
    You have to debug the entire system behaviour , the approval process using the second approver.
    As first step , please check the security level of the second approver. Restart of workflow is based on the security level of the approver.
    you can find the parameter for security level in the personalization tab of the user .
    there is one function module  which determines wether the workflow should be restarted (or) not.
    i do not remember the exact name of the function module.
    1)start transaction se37
    2)enter bbpwflrestart*.
    3) system will return a number of function modules , of them one function module determines wether to restart the workflow (or) not.
    Please check what does the above function module return for the user and the shopping cart , there will be one parameter 'restart' which triggers the start

  • Determine approvers based on lineitem in Shopping Cart Approval Workflow

    Hi All,
    We have N-step Approval workflow for Approving the Shopping cart implemented.
    The issue here is that based on the Product Category for a line item the list of approvals may differ.
    How can i handle this scenario ?
    Regards,
    Radhika.

    Hello Priyanka,
    While using N-step item level SC WF, you have to use BBP_WFL_APPROV_BADI for agent determination. This badi gets called everytime when shopper changes SC or approver takes action on it. So after every change done to SC, approvers are determined.
    Follow the listed steps:
    1) As per your logic, for each item first determine the approvers at each level & assign them approval index. Arrange them in ascending order of their approval index at item level.
    2) Now its possible that you have multiple approvers, multiple item at each level. For sending SC for approval, you will have to generate Approval_object_guid for each approver.  For this you have to find out a criteria for generating Approval guid.
    Eg:
    SC has 3 items then, if for any 2 items product category is similar then approvers will be similar at a particular level. Similarly for different Product Category, different approvers are determined. So you can consider 'Product Category' & 'Approval index' as a criteria to club approvers at each level.
    3) Use function module ''BBP_WFL_DIN_APP_OBJ_GET' to generate approval guid based on criteria & to update badi parameter 'item_approval_obj'.
    4) Update badi parameters 'Approval_table' and 'Item_approval_table'.
    5) Once SC is approved by all, set 'no_further_approval_needed' flag.
    Please let me know if you need any further help.
    Thanks,
    Shital

  • N-step BADI approval SRM workflow

    Hi,
    I am implementing N-step approval badi for SC approval using header level workflow (WS14000133) in SRM 5.0. My requirement is to determine the financial analysts responsible for each line item and then the mangement approvers based on their approval limits. Financial analyst need to approve the SC concurrently before the management approvers receives the SC. I developed the code in the BADI to populate the approval table. First time when the SC is created the approval table looks as follows,
    Index    Branch    Approver
    1         1        FA1
    1         2        FA2
    1         3        FA3
    2         1        MGMT approver1
    3         1        MGMT approver2
    FA1, FA2 and FA3 recieves the SC. The approval preview looks great. Since this is not item level workflow, FA will approve the SC at the header level.
    Here is the Issue--
    When FA1, FA2 or FA3 approves the SC, the approval index is incremented by 1 in the workflow, the SC is sent to MGMT approvers based on he index by skipping all the FA approvers.
    In this scenario, how to develop logic to send the SC to MGMT approvers only after the FA approvers approves it. I mean how to control the index and branching in BADi. I am using header level workflow.
    Any suggestion would be highly appreciated.
    Thanks
    Venkat

    Hello,
    You won't like my answer, but this behaviour is not possible with standard workflows.
    First WS14000133 does not handle parallel processing with badi.
    You could try the template WS14000141 that was at a time handling the branch number in approval table, but it is not officially support. I mean this is obsolete.
    This only parallel processing is provided with template WS14000015, but it's at item level: separated item can be sent in parallel, but it's not working well if you try to send the same item in 2 branch.
    You cannot send the same object in a parallel process, the reason is that the application layer cannot properly handle this.
    Rgds,
    Pierre

  • Item Approval Looping over approver level 2

    Hi
    Have an issue with item based cart approval (using BADI) looping around the same approver and not getting to the next/final approver.
    Working on simple 3 level approval model. Item received ok to level 1, once approved, ok to level 2 (approval index incremented ok) ... but then when level 2 approves, they receive it again (no increment of approval index takes place)
    I notice that the approval index doesn't appear to increment, so loops around the current one ..... forcing a work item to the same approver multiple times.
    Any ideas greatly appreciated.

    Hi Sheron
    The approval index doesn't appear to increment (from 2 to 3), but also the approval state seems to remain at 2 (although I thought it should change to 0 if succesfully approved??). It does appear to do both of these container changes going from index 1 to 2
    Not sure if this is a problem with WS14500013 or WS14500014.
    I am letting the standard containers deal with the increment values.

  • WORFLOW PROBLEM FOR SC APPROVAL

    Hello All,
        I am facing a wierd problem...Im  implementing the BADI  BBP_WFL_APPROV_BADI for header levell shopping cart approval based on the Cost centre  and Product Category.We have mainntained 3  tables  for the approvers  based on the  values for Cost center and Prod category values.
        These values  for the approvers  are passed through the BADI.Curently I have hardcoded the values for the approvers.
         I have activated the WF 14000133.  Initially the problem was that the Witem was goin to al the Users i.e. the Approver list from the BADI was not getting  copied to teh Actual agents container in the Workflow.
        So we applied the note 898768.after the application of  the note,the IWtem was  goin to the first approver for approval,but after he  apporves the  SC,the status is updated to "AWAITING APPROVAL" but the Witem again goes to the first approver for  second approval.i.e. the second  approver is not being taken by the WF..everytime the  actual approval index is 1.
      The coding is as  follows:
    clear approval_table.
          refresh approval_table.
         case actual_approval_index.
            when 0.
             ls_approver-approval_index = 1.
              ls_approver-approval_agent = 'USDOLAM'.
              ls_approver-name = 'Dola Mukherjee'.
              ls_approver-approval_description = 'First approval step'.
              append ls_approver to approval_table.
              ls_approver-approval_index = 2.
              ls_approver-approval_agent = 'USNIRMALN'.
              ls_approver-name = 'Nirmal'.
              ls_approver-approval_description = 'Second approval step'.
              append ls_approver to approval_table.
    *1st level approval
            when 1.
              ls_approver-approval_index = 1.
              ls_approver-approval_agent = 'USDOLAM'.
              ls_approver-name = 'Dola Mukherjee'.
              ls_approver-approval_description = 'First approval step'.
              append ls_approver to approval_table.
              ls_approver-approval_index = 2.
              ls_approver-approval_agent = 'USNIRMALN'.
              ls_approver-name = 'Nirmal'.
              ls_approver-approval_description = 'Second approval step'.
              append ls_approver to approval_table.
    2 step approval
            when 2.
              ls_approver-approval_index = 2.
              ls_approver-approval_agent = 'USNIRMALN'.
              ls_approver-name = 'Nirmal'.
              ls_approver-approval_description = 'Second approval step'.
              append ls_approver to approval_table.
            when others .
              no_further_approval_needed = 'X'.
          endcase .
        Also i dont understand why do we also consider actual_approval_index  as 0?Please ca anyone tell me  whether I need to pass any additionla data through the BADI for teh Actual Approval Index????
      We are on support package SP08.
    Regards,
    Disha.

    Hi Pierre,
      no program termination..in the step detremine  next approver ,actual agents im gettng 1 entry which is the same as  the first apporver,approval index is 2,approver list is 2 entries(whcih r set in the BADI),nofurther approval needed  variable is  blank.
    what i can see is after the first approval,the actual approval index value is remaining 1.
    I have found one  oss note 923463 but not sure whether this will solve the problem.
    Regards,
    Disha.

  • Determine the number of the aprovers required to approve in NStep BADI

    I am sending the workitem to 5 approvers in the BADI:BBP_WFL_APPROV_BADI.
    with approval index 1.
    And my requirement is that the workflow should be approved, if any 2 can approve from the 5 approvers.
    How do i determine that,Please suggest.

    Your using SRM 5 or 6??
    Thanks!!
    Bharath

  • Urgent help on SC approval BADI BBP_WFL_APPROV_BADI

    Hello SRM Gurus,
       I am working on the BADI BBP_WFL_APPROV_BADI for SC Approval.I need some clarifications on the foll points  before I can proceed with the development...
    My requirement is
    1>The no of levels of Approval depends on the total Value fo SC and the Product Category  of the Items(i.e. the Whole  shopping cart since all the Items will be  of the same Product category as  well  as  same  cost centre).
       Based on the combination of these 2 values,I will have to set the approval_index field.
    2>Also after this,based on the combination of the  value for the fields Product Category + Cost centre,the  approvers  have  to be  determined.
    Now  for the  deteremination of  Approvers,either a  custom table can be   maintained  or  they ca be  retrieved  form teh Org structure  itself.
    But now  here,for getting the Approvers,if I have to get the apporvers from the Table(database  table bbpt_wfl_lia_def),I can only maintain the combination of values for the fields  Cost center  and Prod category and the corresponding agent and not the approval level.How  do I link the approval index and the approvers???
      Also, if i ma  getting the approvers  form the Org structure how is the link between Cost centre+Prod cat and Corresponding approver maintained????Or in case of  getting the approvers for the Org structure,I just need to get the Chief/manager of the Person who is creating the Shopping cart(Since  cost centre will be  maintained at the User level)???
    3>Also since  my  approval is  purely at the Header level,whcih of the example implementations given with the std BADI will be usitable  for my reqt(particularly for the APprovers  part)????
      Also  since mine is Header level approval(since  cost center+Prod  cat will necessarily be same the whole of the SC,do I need to activate  only the workflow  14000133(and  no other wfs i.e.WS14500015,WS10000031,WS10000060,WS10000129 )?
      Also,Please correct me if i have gone wrong in any of my understanding.Any help on this is highly appreciated.
    Regards,
    Disha.

    Though i think this was posted long back, but still:
    You need to do a BRF configration which will take care of ur approval levels and the corresponding approvers.
    You need to define the schemas there.
    Thanks
    Nitin

  • SC Approval Query

    Hello SRM Gurus,
    I am working on the BADI BBP_WFL_APPROV_BADI for SC Approval.I need some clarifications on the foll points before I can proceed with the development...
    My requirement is
    1>The no of levels of Approval depends on the total Value fo SC and the Product Category of the Items(i.e. the Whole shopping cart since all the Items will be of the same Product category as well as same cost centre).
    Based on the combination of these 2 values,I will have to set the approval_index field.
    2>Also after this,based on the combination of the value for the fields Product Category + Cost centre,the approvers have to be determined.
    Now for the deteremination of Approvers,either a custom table can be maintained or they ca be retrieved form teh Org structure itself.
    But now here,for getting the Approvers,if I have to get the apporvers from the Table(database table bbpt_wfl_lia_def),I can only maintain the combination of values for the fields Cost center and Prod category and the corresponding agent and not the approval level.How do I link the approval index and the approvers???
    Also, if i ma getting the approvers form the Org structure how is the link between Cost centre+Prod cat and Corresponding approver maintained????Or in case of getting the approvers for the Org structure,I just need to get the Chief/manager of the Person who is creating the Shopping cart(Since cost centre will be maintained at the User level)???
    3>Also since my approval is purely at the Header level,whcih of the example implementations given with the std BADI will be usitable for my reqt(particularly for the APprovers part)????
    Also since mine is Header level approval(since cost center+Prod cat will necessarily be same the whole of the SC,do I need to activate only the workflow 14000133(and no other wfs i.e.WS14500015,WS10000031,WS10000060,WS10000129 )?
    Also,Please correct me if i have gone wrong in any of my understanding.Any help on this is highly appreciated.
    Regards,
    Disha.

    Hi Pras,
        I am implementing the BADI 14000133 for Shopping  cart approval at the Header level based on the  total value  of  shopping Cart,cost center and product category.
       We are  maintaining 3 ztables to determine the  rules for approval as  shown below :
    <u><b>1 Material Group Material Type relationship</b></u>
    Release Group     Material Type         Material Group
    Capital      CAP                 MCAP01- MCAP06
    Catalogue     CAT                 MCAT01 – MCAT03
    Normal             UTI,Service,GEN         MUT01, SER*,MGEN01–
                                        MGEN02
    <u><b>2 Rule Table for mapping the values ranges</b>.</u>
    Ruleno Release Grp  Val frm   Val TO   No. of Approvers
    01     Capital           0             5000         1
    <u><b>3 Determination of approvers based on rule, Material Group and cost center</b></u>
    Ruleno  RelGroup  CostCenter  No of Approver   Approvers
    01     Capital    100002     1               USJOHN
      Can anyone please tell me whether this apporach will be proper since we dont wnat to determine the approvers through Org?
      Also should we maintain the table BBPT_WFL_LIA_DEF?
    Also i have some doubts  regarding the execution of the Witem..
    1>The Witem goes to all the 3 approvers(say approval is 3 level) and if  nayone of the 3 approves ,the status is set to approved
    2>If  any of the approvers rejects the shopping cart,does the SC go back to the previous  approver?
    3>If  any of the approver  changes the SC,does the SC go to the  next approver?
      Our  requirement is ths  same as the std WF behaviour(WS100000129).
       I  have issues basically related to the Witem execution since I have not worked on Workflows previously...So  not sure  as  to what will happen inn case of this WF(WS14000133)..Since you have worked on this WF,can you please tell me how  will the WItem execution happen in case of this WF and are there any explicit settings required for the WF item execution to happen in some specified manner.
      Also, which of the std Implementations example for the BADI BBP_WFL_APPROV_BADI will suit my scenario?
    Regards,
    Disha.

  • Three level sc approval wf

    Hi all,
    I am currently working on three level sc approval workflow...
    the 1st level approval is based on product category,2nd level is based on costcentre and the 3rd level is based on the shopping cart value...i am currently working on the BADI...what value should i give for the approval index for each level..i am not clear abt the actual approval index..can anyone help me..
    Thanks&Regards,
    Hari.

    hi ,
    there is default implementation already provided by SAP along with the system --> please have a look.
    if you have three approvers
    1) first approver will have index 1 , second will have 2 , third will have 3.
    you have to code your BADI in such a way ---> that approval table will have correct number of approvers depending on the input of the shopping cart.
    approval_table is very critical in badi ---> this defines the approvers involved in approval chain
    Edited by: khan voyalpad usman on Jan 11, 2008 1:13 AM

  • Badi Determine WF-ADMIN as an actual Agent

    Hi frds,
    I m using SRM server 500.
    In shopping cart N level approver workflow, when workflow is finding an actual agent from approver list by BUS4101u2019s NextDynamicApproverGet method it is determining WF-Admin as an actual agent instead of approvers exist in approver List based on index.
    Scenario:
    When vendor is assign as a preferred vendor to the cart; BAdI determine all site purchasing coordinators on approval index one then budget holders on approval index 2 an so on based on the approval limit in approver List.
    First Validation work item is going to all SPC they validate the shopping cart convert the preferred vendor to vendor.
    The cart then by BUS4101u2019s NextDynamicApproverGet method finds the actual agent for index 2. IDEALLY the budget holder should be fetched by this but in my case it is determining WF-ADMIN.
    Kindly suggest the possible reason for this.
    Regards,
    Manish

    Check the validity of the budget user given. Also check the workflow container at the first step to see to check the heirarchy before and if the approval hierarchy has now changed

  • Best Practices for Workflow Development

    Hi,
    I'm compiling best practices in developing workflows in TEO/CPO, and accepting inputs. The result will be made available for the community to make use of it, and continuously improve the content. If you have any sort of best practices, please let me know.
    Thank you in advance,
    Renato Fichmann

    Good ones, thanks! Incorporated to the document.
    Currently have the following items on my index (yet to be cleaned up)
    5    Guidelines.................................................................................................................................. 8
    5.1    Style.................................................................................................................................... 8
    5.1.1    Naming Conventions..................................................................................................... 8
    5.1.2    Capitalization Conventions.......................................................................................... 9
    5.2    Usability.............................................................................................................................. 9
    5.2.1    Targets vs Target Groups............................................................................................. 9
    5.2.2    Global Variables and Extended Target Properties....................................................... 10
    5.2.3    Create Alerts, Incidents and Other Tasks................................................................... 10
    5.2.4    Classify Processes using Categories........................................................................... 10
    5.2.5    Provide Automation Summary................................................................................... 10
    5.2.6    Provide Descriptions to Processes, Global Variables and Target Groups.................. 11
    5.2.7    Process with trigger based on tasks must have tape name as trigger condition.......... 11
    5.2.8    Approve condition activities use approval index instead of approval choice............ 11
    5.2.9    Do not put test data into global variables................................................................... 11
    5.2.10    Add Knowledge Base to Alerts and Incidents.......................................................... 11
    5.2.11    Disable “Resume execution if interrupted” and “Archive complete instances” from monitoring/problem detection processes           11
    5.2.12    Make Incident Classes unique in the tap.................................................................. 11
    5.2.13    Make Alert Classes unique in the tap....................................................................... 11
    5.2.14    Make sure fail activities are not failing the process if the process has to create an incident even when the activities fail        12
    5.2.15    Do not include targets in TAP, only target groups based on target type................. 12
    5.3    Error Handling................................................................................................................... 12
    5.3.1    Assignments and Notification..................................................................................... 12
    5.3.2    Error handling outside the step................................................................................... 13
    5.3.3    Incidents generated as result of error.......................................................................... 13
    5.4    Non-Functional................................................................................................................. 14
    5.4.1    Cross-Environment Practices...................................................................................... 14
    5.5    Performance....................................................................................................................... 14
    5.5.1    To Archive or Not to Archive.................................................................................... 14
    5.5.2    Parallelize when possible............................................................................................ 15
    5.5.3    Tables and Loops........................................................................................................ 15
    5.5.4    Processing Data Tables............................................................................................... 15
    5.5.5    Scripting...................................................................................................................... 15
    5.5.6    Prefer XPath over regular expressions or text parsing when multiple values need to be retrieved in a single activity    16
    5.5.7    Prefer XML transforms rather than sequences of activites or scripts........................ 16
    5.5.8    Set the number of active sessions on Terminal targets appropriately........................ 16
    5.5.9    Optimizing the Number and Lifecycle of Tasks......................................................... 16
    5.5.10    Optimizing Process Database Grooming.................................................................. 17
    5.5.11    Spacing Scheduled Automation Loads...................................................................... 18
    5.6    Generic BPEL Best Practices............................................................................................ 18
    Waiting for more feedback before release the first draft for community review.

  • Does Apple provide any certification for Mobile Application testing (iOS)

    Does Apple provide any certification for Mobile Application testing (iOS)
    Kindly share the details of any Mobile Application testing certification provided by Apple.

    I'm not aware of any testing done by Apple except as part of the app approval process:
    https://developer.apple.com/appstore/resources/approval/index.html
    If you have questions about the review process, though, you can contact Apple via the contact links on that page.
    Regards.

Maybe you are looking for