Behaviour of BADI /SAPSRM/BD_WF_PROCESS_RESTART in workflow

Dear SAP gurus,
We're encountering the same issue as in post SRM 7.0 PC Workflow - Restart BADI behaviour /SAPSRM/BD_WF_PROCESS_RESTART
We observe that the restart workflow does triggered twice, and in the second run, there is no difference anymore between the one being processed and the one in the database. As there is no difference anymore we cannot know in which case we should restart and which case we should NOT restart (the requirement is to restart ONLY if quantity is changed).
As from the previous post, the sample coding provided by Bharatan is not working as if we write like he suggest:
DATA:
Internal Table to hold Shopping Cart Item details ...
lt_item_detail TYPE bbpt_pd_sc_item_d,
Internal Table to hold Shopping Cart Item Master table details ...
lt_PDIGP_master TYPE BBP_PDIGP,
Work Area to hold Shopping Cart Item details ...
lt_item_detail_line LIKE LINE OF lt_item_detail,
Work Area to hold shopping cart details ...
lwa_sc_header TYPE bbp_pds_sc_header_d.
Fetch Shopping Cart Item details ...
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
i_guid = is_document-document_guid
i_with_itemdata = 'X'
IMPORTING
e_header = lwa_sc_header
TABLES
e_item = lt_item_detail.
Loop at lt_item_detail into lt_item_detail_line.
SELECT *
from BBP_PDIGP into lt_PDIGP_master
Where GUID = lt_item_detail_line-GUID.
ENDSELECT.
IF lt_item_detail_line-QUANTITY GT lt_PDIGP_master-QUANTITY.
EV_RESTART = ''.
ELSE.
EV_RESTART = 'X'.
ENDIF.
ENDLOOP.
There will be NO difference at all between lt_item_detail_line-QUANTITY and lt_PDIGP_master-QUANTITY --> as apparently in the second run of BADI restart, SAP already update the data into table BBP_PDIGP
Can anyone shed light on this matter?
Best regards,
John

We adapt our coding to the observed behaviour. In the first run, we export the data to memory id which then will be imported in the second run.

Similar Messages

  • How to access Shopping Cart Obj-ID with BADI /SAPSRM/BD_WF_RESP_RESOLVER

    Hi, i am transforming old application based workflow from SRM 5.0 to process orientated on SRM 7.0. With SRM 5.0 the system uses BADI BBP_WFL_APPROV_BADI to determine approvers for workitems. This BADI had parameters like OBJECT_ID and OBJECT_TYPE and also GUID. With the new BADI /SAPSRM/BD_WF_RESP_RESOLVER i can't see how to get access to these data. Can anyone help me solving this question?
    Thanks in advance,
    Matt

    Hi,
       There are two methods trigger in PCW.. first one is GET_AREA_TO_ITEM_MAP followed by GET_APPROVERS_BY_AREA_GUID. the import parameter of method GET_AREA_TO_ITEM_MAP will have SC guid to get the current SC details.
    Saravanan

  • BADI /SAPSRM/ES_SOA_MAPPING

    Hi Gurus,
    The purpose of the project on which I am working is to create shopping cards from a JAVA interface instead of the standard web dynpro. Therefore I am using the web service /SAPSRM/INTERNALREQUESTCNCRC it works.
    BUT there are customer fields. I did expand the message type of the web service. I did expand the database. I did implement the BADI /SAPSRM/ES_SOA_MAPPING  but the customer fields are not mapped nor save in the database. The programm does not even go thu the call_inbound_method. It does through the outbound but it is then to late.
    As any one an idea how to deal it ?
    Thks
    VIncent

    Hi,
    I am on version 7.10
    The application is not based on the standard web dynpro. All the user interface is developped in native JAVA. Therefore for updates and request we will use the standard webservices.
    They are supposed to be extendable throught BADI but after implementation from the BADI the process doesn't go thought the inbound extension and therefore is no mapping possible.
    I hope I have been understandable now.
    Regards
    Vincent

  • System is not picking up approvers from BADI in Item level workflow

    Hi All,
    My problem is that
    1. when I creat the shopping cart the system is picking up the correct approver from BADI and showing it in approval preview.
    2. My first level approver is a general task so Workitem going to the correct persons.
    3. after first level approver I am fillng approver in BADI for 2 nd level.
    4. But after first approval the SC is directly getting approved finally as system is not picking up approvers from the BADI.
    I dont understand the problem. even We applied SP9 as well, but the problem is not resolved.
    Please suggest something.
    Thanks
    Smita

    Hi ,
    I am pasting the code of my BADI.  Let me know if i need to do some changes.
    Regards,
    smita
    if lv_wf = '4'.
    1st approval step executed for indices 1 and 0
          IF actual_approval_index LE 1.
    First approval step (General task)
    endif.
    2. approval step executed for indices 2,1 and 0
          IF actual_approval_index LE 2.
    *break-point.
    **get the approver for the commodity
             LOOP AT lt_item INTO ls_item WHERE del_ind IS INITIAL.
    We consider only items, which are not deleted (del_ind = 'X')
    Set the product category
                MOVE ls_item-category_id TO lv_call_value1.
    Find the approver of this item based on the customizing table ZCOMMODITY
    CALL FUNCTION 'ZWF_COMODITY_ITEM_APPROVAL_GET'
       EXPORTING
         SC_GUID                          = ls_header-guid
         ITEM_GUID                        = ls_item-guid
       APPROVAL_DESCRIPTION             =
        HIDE_ITEMS_NOT_RESPONSIBLE       = 'X'
         CRITERION1                       = 'COMMODITY'
         CATEGORY_ID                      = ls_item-category_id
         ITEM_VALUE                       = ls_item-VALUE
         APPROVAL_INDEX                   = '2'
       CHANGING
         APPROVAL_TABLE                   = approval_table
         ITEM_APPROVAL_TABLE              = item_approval_table
        ITEM_APPROVAL_OBJ                = item_approval_obj
    endloop.
    *ELSEIF actual_approval_index EQ 2.
    don't process 2nd step
             no_further_approval_needed = 'X'.
    endif.
    endif. " if lv_wf = '4'.
    FUNCTION ZWF_COMODITY_ITEM_APPROVAL_GET.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(SC_GUID) TYPE  BBP_GUID
    *"     VALUE(ITEM_GUID) TYPE  BBP_GUID
    *"     VALUE(APPROVAL_DESCRIPTION) TYPE  BBP_STEP_DESCRIPTION OPTIONAL
    *"     VALUE(HIDE_ITEMS_NOT_RESPONSIBLE) TYPE  BOOLEAN OPTIONAL
    *"     REFERENCE(CRITERION1) TYPE  BBP_WFL_APP_CRITERION
    *"     VALUE(CATEGORY_ID) TYPE  ZBBP_CATEGORY_ID
    *"     VALUE(ITEM_VALUE) TYPE  BBP_VALUE
    *"     VALUE(APPROVAL_INDEX) TYPE  SWH_NUMC10
    *"  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
    this Function Module is for getting the commodity approvers
    for the commodity items, in the Shopping cart
      DATA:
        ls_approval_table      TYPE bbp_wfl_approval_table_badi,
        ls_item_approval_table TYPE bbps_wfl_item_approval,
        ls_approval_def        TYPE bbpt_wfl_lia_def,
        ls_item_approval_obj   TYPE BBPS_WFL_ITEM_APPROVAL_OBJ.
      DATA:
        lv_app_obj_guid   TYPE bbp_guid_32,
        lv_is_new_approval_object TYPE boolean.
    **structure for commodity data
    data : ls_commodity type zcommodity.
    data : lv_value1 type BBP_WFL_APP_PROPERTY.
      CONSTANTS:
          c_agent_is_user TYPE otype VALUE 'US'.
    First find the right approval object the item belongs to.
    All items of an approval object are approved togheter in
    this approval step, and therefore only one workitem is
    created for this items. IF possible use this standard function
    BBP_WFL_DIN_APP_OBJ_GET for creating the approval object.
    lv_value1 = category_id.
    CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
      EXPORTING
        SC_GUID                      = sc_guid
        CRITERION1                   = criterion1
      CRITERION2                   = ''
      CRITERION3                   = ''
       VALUE1                       = lv_value1
      VALUE2                       = ''
      VALUE3                       = ''
    IMPORTING
       APPROVAL_OBJ_GUID            = lv_app_obj_guid
      IS_NEW_APPROVAL_OBJECT       =
      TABLES
        ITEM_APP_OBJ                 = item_approval_obj
                  CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
                    EXPORTING
                      SC_GUID                      = sc_guid
                      CRITERION1                   = criterion1
                     CRITERION2                   = ''
                     CRITERION3                   = ''
                     VALUE1                       = lv_value1
                     VALUE2                       = ''
                     VALUE3                       = ''
                     IV_ITEM_VALUE                = ITEM_VALUE
                   IMPORTING
                     APPROVAL_OBJ_GUID            = lv_app_obj_guid
                     IS_NEW_APPROVAL_OBJECT       =
                    TABLES
                      ITEM_APP_OBJ                 = item_approval_obj.
    CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
       EXPORTING
         sc_guid                 = sc_guid
         criterion1              = criterion1
      CRITERION2              = ''
      CRITERION3              = ''
         value1                  = category_id
      VALUE2                  = ''
      VALUE3                  = ''
      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       = lv_app_obj_guid
       TABLES
    This table saves the criterias  for which the approval object
    was created. For example:
    |approval object1| "cost center" | 1000   |
    |approval object2| "cost center" | 1200   |
    |approval object3| "prod categ " | office |
        item_app_obj            = item_approval_obj
    Check if this approval object already exists in the approval
    table
      READ TABLE approval_table INTO ls_approval_table
              WITH KEY approval_object_guid = lv_app_obj_guid
                       approval_index       = approval_index.
      IF sy-subrc EQ 4.
        lv_is_new_approval_object = 'X'.
      ENDIF.
      IF lv_is_new_approval_object = 'X'.
    Now read your own approval table based on your criteria's
    **now check whether the category id is a commodity material and
    *find the responsible person for that and
    *check if the amount of item is falling in the approval limit of the comodity manager
    select single * from zcommodity into ls_commodity
    where CATEGORY_ID = category_id
    and ( ZFROMAMT <= item_value and ZTOAMT >= item_value ).
       SELECT * FROM bbpt_wfl_lia_def
                INTO CORRESPONDING FIELDS OF ls_approval_def
                WHERE
                      app_crit_name1  = criterion1 AND
                      app_crit_value1 = value1
       ENDSELECT.
        IF sy-subrc NE 4.
    Fill approval table (who is responsible for which approval
    object in which approval step)
          ls_approval_table-approval_index       = approval_index.
         CONCATENATE c_agent_is_user ls_approval_def-approval_agent1
                                 INTO ls_approval_table-approval_agent.
    CONCATENATE c_agent_is_user ls_commodity-person
                                  INTO ls_approval_table-approval_agent.
          ls_approval_table-name = ls_commodity-name.
          ls_approval_table-approval_description = approval_description.
          ls_approval_table-approval_object_guid = lv_app_obj_guid.
          ls_approval_table-hide_items_not_responsible =
                                  hide_items_not_responsible.
          APPEND ls_approval_table TO approval_table.
         IF ls_approval_def-approval_agent2 IS NOT INITIAL.
    Second approver for the same workitem exists
           CONCATENATE c_agent_is_user ls_approval_def-approval_agent2
                               INTO ls_approval_table-approval_agent.
           ls_approval_table-name = ls_approval_def-agent_string2.
           APPEND ls_approval_table TO approval_table.
         ENDIF.
        ENDIF.
      ENDIF.
    Fill item table (Which items belongs to which approval object)
      ls_item_approval_table-approval_object_guid = lv_app_obj_guid.
      ls_item_approval_table-approval_item_guid   = item_guid.
      APPEND ls_item_approval_table TO item_approval_table.
    **Fill Item approval object
    ls_item_approval_obj-sc_guid = sc_guid.
    ls_item_approval_obj-APP_CRIT_NAME1 = CRITERION1.
    ls_item_approval_obj-APP_CRIT_VALUE1 = CATEGORY_ID.
    ls_item_approval_obj-APPROVAL_OBJECT_GUID = lv_app_obj_guid.
    append ls_item_approval_obj to ITEM_APPROVAL_OBJ.

  • SRM Process Controlled Workflow - Re-start using FM BBP_PD_SC_UPDATE

    Hi All,
    We are upgrading from SRM4.0 to SRM7.0 SP07 in classic scenario. We switched to Process Controlled Workflow.
    We have a CUSTOM application where the requisition items are entered and a Shopping Cart is created in SRM through Function Module BBP_PD_SC_CREATE. When the Shopping Cart is created in SRM , the Process Controlled Worflow is triggered successfully.
    In the custom application , we allow users to do changes to the requisition that are awaiting approval.The changes are updated in SRM Shopping Cart through function module BBP_PD_SC_UPDATE. It is noticed that the workflow process levels are not re-started after the shopping cart is updated through FM BBP_PD_SC_UPDATE.
    However , the process levels are re-started when the change is directly done to the Shopping Cart in SRM POWL. We want the process levels to be re-started even when the changes are done through BBP_PD_SC_UPDATE. The users are used do changes to the requisition through the custom application. We also noticed that system does not go through BAdI /SAPSRM/BD_WF_PROCESS_RESTART when changes are done to the SC through BBP_PD_SC_UPDATE.
    Is there any way that we can trigger process level re-start when SC is changed through FM BBP_PD_SC_UPDATE
    Thanks
    Sukumar

    HI ,
           This is not the correct way of updating the SC. please check the below process...
           first you try to get the SC document in Edit mode and this can be done only SY-UNAME should requester of the SC or( user who are changing the SC should be in the Org structure ).  ( This point why i mentioned is you mentioned that your editing through custom application ). 
      note : use try and endtry and catch the exception when u get the SC document in Edit mode.
      DATA: lo_pdo_sc             TYPE REF TO /sapsrm/cl_pdo_bo_sc_adv.
          "Instance SC PDO Layer
          lo_pdo_sc ?= /sapsrm/cl_pdo_factory_sc_adv=>get_instance( iv_header_guid   = p_guid "ps_shopping_cart-guid
                                                                    iv_mode          = /sapsrm/if_pdo_constants_gen_c=>gc_mode_edit ).
       now you do what ever changes to the document. I mentioned points below.
            "Get Item Details
          lo_pdo_sc->/sapsrm/if_pdo_bo_sc~get_item_detail
    do changes to the items of the SC.
           "Update SC Items
          lo_pdo_sc->/sapsrm/if_pdo_bo_sc~update_items
           "Submit Update
          lo_pdo_sc->/sapsrm/if_pdo_base~submit_update
           "Save SC
          lo_pdo_sc->/sapsrm/if_pdo_base~save    
          or  order  the SC again.
          COMMIT WORK AND WAIT.
    regards,
    Devi

  • N Step BADI Approval Workflow Error in SRM 7.0

    Hi,
    I have implemented SC  Workflow Approval based on line item(sequential approval). I implemented process controlled workflow for this using N step Badi. Necessasy configuration done for each level at schema. All steps are executed per line item and agents determined using N step Badi /SAPSRM/BD_WF_RESP_RESOLVER.
    Even in SC after the document is ordered, in approval overview tab i see the all level sequence with  approvers name for that  line item.
    But when approved by first approver, it doesnot move to the next level for approval and the SC is approved bypassing all approvers in the following levels.
    For example, if there four levels of approvals for one line item. as soon as the first approver approves the SC is approved and in SC Approval Overiew tab that contained four level of approval in it is now reset to one level with SC marked as appproved.
    Have anybody come across this error.
    Not able to figure out why it is happening so... need some expert advice.
    Thanks in Advance.

    Hi Masa .. thanks for your reply.
    Was on vacation so could not reply.
    I have below settings in SRM for SC
    Process Level definition should be like this.
    Level Eva.ID ; Resolver Task ID Decision Type
    100 L100 R100 40007953 Item-Based decision for Partial Doc.
    200 L200 R100 40007953 Item-Based decision for Partial Doc.
    300 L300 R100 40007953 Item-Based decision for Partial Doc.
    I have implemented /SAPSRM/BD_WF_RESP_RESOLVER for R100.
    for grouping we are using line item number ... so each line item is a group.
    Below are issues that i am facing now.
    For say 2 line item in a SC... with 3 level of approvals for each line item. I am not able to approve one line item in a sequence. For example: If for first line item, when I approve level one .. then the workitem doesnot move to 2nd approver's inbox for that line item. Now if second items (asssuming there are only 2 line items in SC) first approver has approved then i see all second level of approvers available for all line item.
    In short system waits for all one level approvers to approver for all line item and when all the line items are approved at one level then the workitems are available for seconds level of approval.
    Is this the standard behaviour?
    As per our requirement we wanted one line item shoudl follow the approveral sequence without being dependent on other items approval.

  • SRM 7.0 BADI Define Agents-- How to use type /sapsrm/t_wf_area_entity

    Hi Experts,
    I'm using SRM 7.0. When implementing BADI /SAPSRM/BADI_DET_AG (Define the agents of  procsess controlled workflow), I created the sub-class of interface /SAPSRM/IF_WF_AREA to develop my won logic in method GET_RESPONSIBLE_APPROVERS.
    I want use the data in workflow container, seems the method GET_AREA_ENTITY_IDS of /SAPSRM/IF_WF_AREA  can provide a pointer which type is /sapsrm/t_wf_area_entity and point workflow area.
    My question is how to use this pointer (or how to use the type /sapsrm/t_wf_area_entity )? Many thanks.
    PS. I found some example code delivered by sap, but i want know the full structure which /sapsrm/t_wf_area_entity point. Below code for your reference:
    METHOD /sapsrm/if_wf_area~get_responsible_approvers.
      DATA lt_area_entity_id TYPE /sapsrm/t_wf_area_entity_id.
      DATA lr_area_entity_id TYPE REF TO /sapsrm/wf_area_entity_id.
      DATA ls_actor_id       TYPE swhactor.
      DATA lt_approver       TYPE /sapsrm/t_wf_approver.
      FIELD-SYMBOLS: <ls_agent_id> TYPE /sapsrm/s_wf_approver.
      lt_area_entity_id = me->/sapsrm/if_wf_area~get_area_entity_ids( ).
      LOOP AT lt_area_entity_id REFERENCE INTO lr_area_entity_id.
        ASSIGN lr_area_entity_id->* TO <ls_agent_id> CASTING.
        TRY.
            ls_actor_id-otype = <ls_agent_id>-approver_ot.
            ls_actor_id-objid = <ls_agent_id>-approver_id.
            lt_approver = /sapsrm/cl_wf_config_user=>get_manager_list( ls_actor_id ).
            APPEND LINES OF lt_approver TO rt_approver.
          CATCH /sapsrm/cx_wf_error /sapsrm/cx_wf_abort.
            CONTINUE.
        ENDTRY.
      ENDLOOP.
    ENDMETHOD.

    Hi Darcy,
    You can also use FM SAP_WAPI_READ_CONTAINER to read workflow container values.
    Please state if you have some other specific requierment.
    Regards,
    Saumya

  • 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

  • Issue in Process Controlled workflow for Shopping cart in Quality system.

    Hello All,
    I ahve configured a Process controlled workflow in SRM 7.0  with custom resolver, and I am facing an issue taht the Workflow works well in Development but in Quality the approvers are dropped after SC is ordered in Quality system.
    The SC Workflow drops the approvers picked up from the Interface  method /SAPSRM/IF_EX_WF_RESP_RESOLVERGET_AREA_TO_ITEM_MAP and IF_EX_WF_RESP_RESOLVERGET_APPROVERS_BY_AREA_GUID of BADI /SAPSRM/BD_WF_RESP_RESOLVER. The approvers can be seen in the shopping cart Approval preview Tab until the SC is ordered.
    I have compared the OSS notes relevant for Workflow, all of them have been transported, Also I compared and checked general Workflow settings, BRF Config and  Process level  settings in Dev and Quality, everything is same.
    Also while debugging; the approvers can be seen in the decision set table in the create_process_forecast method of class /SAPSRM/CL_WF_PROCESS_MANAGER.
    Kindly let me know what else i can check to find the root cause.
    Thank you in advance for help!
    Regards
    Prasuna.

    Hello Vinita;
    Thanks for the input and sorry for the not so "ASAP" reply;
    From what I'm seeing in from your 2 screenshot, i strongly believe that the problem is even before the Z implementation /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUID (in which the FM i ZSRM_GET_USER_FROM_PGRP is called. I think the problem could be in the process level determination  ZSRM_WF_BRF_0EXP000_SC_APP100. Let me explain:
    In your  cases where not buyer is determined,  in the approval tab there is not even a process level for buyer approval. If the problem were indeed in the implementation  /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUID  then the process level would be there, but the system will display, instead of the name of the buyer(if the buyer determination fails) a red label with the message:  "With the strategy "Buyer determination" an approver could not be determined (or something like that..please check the image at the end of the text)".
    I can propose a way to discard this: Implement the method /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_FALLBACK_AGENTS of class ZCL_BADI_SC_WC (in case you didn't know, in this method you can specify an "default" approver in case that the determination of approver in GET_APPROVERS_BY_AREA_GUID fails). The idea is to specify an default approval and see how it behaves:
    If the user you indicated in the method GET_FALLBACK_AGENTS appears as approver, then yes, the problem is arises from implementation GET_APPROVERS_BY_AREA_GUID, in which case it could be a data problem (peharps in pposa_bbp?). You could also check in TX SU53 with the users with this problem to see if there's a missing authorization objetc.
    If, in the other hand, the "default" approver is not shown, it means that the process level buyer determination is not even called, so you should check in more detail ZSRM_WF_BRF_0EXP000_SC_APP100 and /SAPSRM/CL_WF_PROCESS_MANAGER > Determine process restart –method ----- (i have never used this method, so i could not tell if  it could be the source of the problem).
    Also, you could implement the method GET_FALLBACK_AGENTS in this way so the default approver would be the WF administrator indicated in the customizing (or you could just append directly any user you want):
    METHOD /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_FALLBACK_AGENTS.
       DATA: lv_admin_expr TYPE swd_shead-admin_expr,
             lv_admin      TYPE swd_shead-wfi_admin,
             lv_admin_type TYPE sy-input,
             ls_agent      TYPE  /sapsrm/s_wf_approver.
       CALL FUNCTION 'SWD_WF_DEFINITION_ADMIN_GET'
         IMPORTING
           default_admin_expr = lv_admin_expr
           default_admin      = lv_admin
           default_admin_type = lv_admin_type.
       ls_agent-approver_id = lv_admin.
       APPEND ls_agent TO rt_agent.
    ENDMETHOD.
    Error of agent determination:
    Please let me know the result of the test with the implementation of method GET_FALLBACK_AGENT. By doing this we could ensure if really the problem is in method GET_APPROVERS_BY_AREA_GUID or before.  I just made the test in our system and I'm almost sure that you wont get the default approver, but i could be wrong. 
    Any question please let me know.
    Best regards
    Cristian R.

  • Approver not determined process controlled workflow in SAP SRM 7.0

    Hello all,
    I have setup process controlled workflow in SAP SRM 7.0 EHP3 for shopping cart approval.
    I have 4 approval levels.
    I have used item-based Decision for entire document because for some items i want system approval.
    In implementation of BADI /SAPSRM/BD_WF_RESP_RESOLVER, in the method /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_AREA_TO_ITEM_MAP, i am skipping the items for which i want system approval.
    Also in method /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUID of BADI implementation class, i am keeping the approver table empty for the step which i want system approval.
    For example i have 1 item in shopping cart and for 1st step, based on some accouting criteria, i want system approval for 1st level and the workitem should go directly to 2 approval step when shopping cart is ordered. This is not happening.
    But if i have multiple items, and one item should have system approval based on some criteria and the 1st approval level should be system approval and other item should go to the 1st approver. This is happening and showing 'system' approver for item1 and 'appr_xyz' for item 2.
    For shopping cart having only 1 item, If i approve the shopping cart in this state only, it doesn't go to any approver and is not usable.
    am i missing anything in BADI /SAPSRM/BD_WF_RESP_RESOLVER??
    Please let me know.
    Regards,
    Yayati Ekbote

    Hi Adrian,
    Yes it is possible to display custom workflows in the Universal Worklist,  However, I am not sure what you are trying to do with a routing table.  If the workitems are of type decision, you can use UserDecisionHandler (action handler) configured in the XML file to use the Approve/Reject functionality - we are talking about webflow connector here correct?  R/3 connector?
    Regards,
    Beth Maben
    EP - Senior Support Consultant II
    SAP Active Global Support
    Global Support Centre Ireland
    **SDN Forum Moderator:
    SAP Enterprise Portal: Application Integration
    **SDN Universal Worklist Wiki:
    http://wiki.sdn.sap.com/wiki/x/ehU

  • SRM 7.0 Process Controlled Workflow change

    Hi
    I have a SRM 7 process controlled Shopping cart workflow working ok, Approval based on value levels. The customer wouldlike to change this so that approval is also based on cost center attributes and also want at each approval level to have a reviewer.
    Could anyone advise me how to add in a reviewer, as well as an approver for a particular process step, and also confirm that to have the cost center attribute taken account of at each process step, i would have to develop and code a new expression / evaluation ID, rather than use existing one.
    Many Thanks
    john

    Hi John,
    Reviews are common for all process level.. itu2019s not process level specify like approvers.. Also we can add reviewers dynamically by a simple BADI implementation and configurations as follows..
    BADI Implementation:
    BADI : /SAPSRM/BD_WF_RESP_RESOLVER
    Enhancement Spot: /SAPSRM/BD_WF_AGENTS
    BADI Definition : /SAPSRM/BD_WF_REVIEWER_RULE
    Configuration:
    We can see Reviewer folder for all process schemas..
    For adding approver or pool of approvers for a particular process level, review my answer in the following forum.. Re: SRM 7.0 SP05 - BRF Item level approval does not work
    Thanks!!
    Bharath

  • Workflow process does not restart when re-ordering a PO

    We are running SRM 7.0 with Process Controlled Workflow and have configured N-Step approval process for PO.
    When the PO is ordered for the first time, the approver determination and the approval process work as expected. However, after the PO has been ordered, and the user makes changes to the ordered PO and re-orders it, the PO's approver list does not get refreshed, and the PO header shows the following staled information in "Approval" tab with "current status" = "Finished" -
    Process Step                   Status         Processor                      
    SRM Purchase Order Approval    Approved   <approver user name>
    And the PO would go into "Awaiting Approval" status but the PO work item does not appear in anybody's UWL.
    Any hints regarding the possible cause of this behavior are appreciated.
    Thanks.

    Hello,
    check in the BBP_PD the changed version po generated. there you will see if any WFL started or not. Or take the PO change version GUID and go at SWI6/swi1 to check the WFL log.
    At SLG1 should appear also, check if at table /SAPSRM/C_WF_CST you have the trace level set to 1. This will make slg1 take all logs (green and red).
    You can also always force a restart via BADI /SAPSRM/IF_EX_WF_PROC_RESTART
    Thanks,
    Melina

  • N- Level Process Controled Item workflow.

    Hi Experts,
    I am using Process Controlled item level workflow in SRM 7.0 (WS40000014) . My workflow is working for only one level approval.
    I dont know how to increase number of approvers.... Could any one please suggest a BADI and process to achieve this?  
    Thanks in advance,
    Regards,
    Bhanu.

    Hi Bhanu,
        Increasing the number of approval level( APPROVAL_INDEX ) is not same as SRM 5.0 in SRM 7.0.
         First you have to implement custom BADI for increasing Process level which is same (APPROVAL_INDEX), then implement another BADI to process the approval level. you can find the sample code for increasing the process level in standard Badi '/SAPSRM/BD_WF_PROCESS_SC'. 
    Best Regards,
    Saravanan Dharmaraj

  • Update CT_RESULTS in SAPSRM/BD_WF_ADHOC_AGENT_F4

    Dear users,
    We are using the method FILTER_F4_ADHOC_AGENTS in the BADI SAPSRM/BD_WF_ADHOC_AGENTS_F4 as a part of one of our implementations.
    I used fieldsymbols to read the entries from CT_RESULTS (which is of type any) and used my logic to determine what entries can stay in it.
    I am not sure how to update CT_RESULTS though. Can anyone please advise how to update this table which is of TYPE ANY?
    Thanks,
    Vijay.

    HI,
    I suppose you plan to use process controlled workflow.
    If yes then you can check the tcode BRF and try to create a expression of type formula interpreter.
    In the this expression navigate to formula editor and here you can find all the attritutes you can trigger for any business object.
    For agent dertermination SAP has already delivered many agent determination method.. If a process level and click on the F4 feature available for field Resolver Name to find all the predelivered methods.
    You can check the service market place http://service.sap.com for Workflow Guide SAP SRM 7.0
    Path:
    service markerplace -> Release & Upgrade info -> Installation & Upgrade Guides-> select SRM 7.0
    Regards
    Sam

  • Use HR Structure for Agent Determination in Shopping Cart Workflow SRM7.0

    We are implementing a Shopping Cart Approval Workflow in SRM 7.0. The process is that the Requester creates a Shopping Cart and an approval process will take effect.
    The approvers will come from an HR structure wherein the direct superior (or supervisor) is the first approver. The second approver is the direct superior of the first approver; and so on, until the Shopping Cart is approved. A maximum of 7 approvals can be done in a Shopping Cart document.
    I would like to ask the following:
    1. How can I achieve this in our WF? I tried to implement BADI /SAPSRM/BD_WF_RESP_RESOLVER but I was not able to activate it (there are other active implementations for this in Shopping Cart).
    2. If there are other suggestions on how to accomplish this, please let me know.
    Thanks in advance for your help.

    Thanks Masa.
    We created 2 custom expression for our requirement and copied FM /SAPSRM/WF_BRF_0EXP001 to put values on those expressions. Then, on our BRF we compared these 2 expressions. After putting the Eval. ID on the process level configurations, we were able to see in SLG1 that the fields are populated correctly. However, we just put constant values on the custom expressions so we can proceed with testing.
    There is one problem in terms of populating the other custom expression. This expression is for the Level of the Manager. I understand that this custom expression is populated before RR_MANAGER_OF_MANAGER. I would like to understand how to get the next approver in the copy of FM /SAPSRM/WF_BRF_0EXP001. In this way, I can get the Manager Level from table HRP5581 and use this to compare with the Release Strategy. If this will not work, is there a way to get the work item ID for the WF so I could get the previous approver then get the superior of the that previous approver and then get the Manager Level from there?
    Currently, only the GUID and Object Type is populated in the FM. Can I reuse some of the fields from other expressions so I can achieve my requirement?
    Thank you very much for your help.

Maybe you are looking for

  • Where are my files on a MAC?

    I have created an air app that looks to an XML file for the location of an mp3 file.... the mp3 file is saved in the same folder.... When I install this app on a PC, the xml file and the mp3 are clearly in the program files folder with the app. When

  • Retriving a blob after it was loaded by OLE container in forms 6i

    We had forms6i application which has loaded documents into a blob column in the database using OLE container. We are able to retrive the blob from the OLE container on the forms6i, However when we are trying to retrive the same blob using PL/sql into

  • Bug with currently selected and customised power plan.

    I have reproduced this twice now. I customised my power plans (the balanced and power saver but not the high performance). My personal settings are to never sleep and for sleep not to be an option. On two occasions I have returned to the PC and found

  • 0 Item Found (Document Access Report)

    When I execute the Document Access Report the result of report is found 0 document.I am ensure my document is read. Please Help me.

  • I Can't Update To Quicktime 7.1.3....Please Help.

    I have QT 7.0.1 on my Mac now. I tried to use the "Software Updater" on my computer, but when downloading QT 7.1.3 it keeps killing my internet connection, and therefore failing to downlod. Is there ANY other way to do the upgrade without having to d