How to reject SC programatically in process controlled WF?

I set a background process level with process type 'automatic' and I want to reject the WF within it. This is my code:
lo_pdo_bo_sc ?= /sapsrm/cl_pdo_factory_sc_adv=>get_instance(
    iv_header_guid = lv_document_guid
    iv_mode = /sapsrm/if_pdo_constants_gen_c=>gc_mode_display
    iv_wiid = iv_workitem_id
    iv_user_id = iv_agent_id ).
    endif.
    lo_pdo_bo_sc->/sapsrm/if_pdo_adv_base~reject( ).
I set the mode = DISPLAY, since if I set it EDIT, it will reise an exception /SAPSRM/CX_PDO_WF_RECALL_RQ .
So in DISPLAY mode, when i call the reject method, I will get the exception CX_SY_REF_IS_INITIAL. It is caused by the mo_user_context object is INITIAL.
So I do not know what is wrong with my method. Maybe the input user or mode?
Or else, there is another way to reject the SC wf in backgound process level?

HI,
In your process level  definittion you can use task ID as 40007989  ( Automatic rejection).
Hope this solves your issue
Regards
Sam

Similar Messages

  • Process Control functionalities

    Dear coleagues,
    We are using MIC 1.0 and thoughting migrate to Process Control.
    May you know if process control has the functionality of automatizate schedule of effectiveness test as soon control design self assessment is done without issue?
    Thanks in advance.
    Luis Augusto.

    Hi Luis,
    How did your migration project to Process Control went out?
    Past March, we did not see much information for GRC 2008's conferences at Florida and missed the event.
    Maybe from your practical view, you could share a bit of the experience since on 2007 SAP told us there wasn't a ramp up project for clients who had already been working with MIC.
    Best regards,
    Perla SZ

  • How to make a restart of the workflow in a process controlled workflow?

    Hi Experts,
    How to make a restart of the workflow in case of process controlled workflow? Scenario is like this:
    The user has created a shopping cart with 1000 USD. The process schema has three process level with the first level being approval with completion.
    The first level being executed by the responsible purchaser. Here, the purchaser adds the source of supply and changes the price of the shopping cart 2000 USD and approve the shopping cart.
    Now, I want the approval task to start from beginning so that the requestor can know the changes and accept/reject the changes.
    Thanks and regards,
    Ranjan

    Hi,
    Restarting workflow goes to 1st level approval step. It is not requester.
    I think you need to set condition for "Acceptance by Contact Person" in Define Process Level.
    Regards,
    Masa

  • How to trigger standard task manually in Process controlled workflow?

    Hi All,
    I would like to trigger a task mannually in BRF, process controlled workflow. My requirement is to send an approval notification to the approvers at the current approval level, at any instance by the requestor of the shopping cart. In that case, will it be possible to trigger the standard task 40007953 (SRM Shopping Cart Approval (1)) with the workitem of Shopping cart under consideration?
    I have tried searching for the same in SDN and other forums but most of the information was regarding application controlled workflows. None of those function modules seems to be working in PCW.
    Any pointers on how to trigger a standard task (using FM or code) in BRF(process controlled workflow) environment is also highly appreciated.
    Thanks,
    S.H@ri

    Hi,
    Use this FM [SAP_WAPI_START_WORKFLOW|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/bb9100f8-0c01-0010-ac8e-e017351f3fc1].
    Regards,
    Surjith

  • Approvers of Rejected line items not getting removed -Process controlled WF

    I have developed shopping cart approval using process controlled workflow. We are using SRM 7.0, patch level 9.
    Decision set used is item based approval for partial documents (Type 4)
    While testing I observed that when I reject any item, the corresponding approvers of that items are not getting removed.
    As per your requirement, if we create SC with 2 items A and B. Based on various conditions
    2 process levels are determined for item A, say approver X and approver Y at respective level.
    3 process levels are determined for item B, say approver X, approver Z1 and Z2.
    Approver X, rejects item A and approves item B. Since one item is rejected, the work item is sent to requestor for acceptance. All process levels are of type "Approval". Once the requestor clicks on "Accept" button, the item A, which is rejected gets deleted from the shopping cart.
    However now when I see the Approval Process Overview, the current approver shown is Y. The work item is sent to approver Y and the value of the shopping cart is shown as 0.00. Logically the approver Y should have been removed from approval process.
    Could you let me know if I am missing any step or do I need to do some coding to get rid of approvers of rejected items.
    Regards,
    Manish.

    We were using N-step process level on the item level contrast to example provide by SAP of N-step process leve on Header level. SAP uses standard tables /SAPSRM/D_WF_015 and /SAPSRM/D_WF_016 to implement the logic. We have customized the solution with logic on same line of sap but using bespoke tbale ZSAPSRM_D_WF_016. Let me know if anyone needs solution.

  • Rejection case in Process controlled workflow

    Hi Friends,
                      My shopping cart is permitted to go to 1st level ,2nd level, 3rd level, and 4th level approvals.
    1st level is approved. If shopping cart is rejected at 2nd level , it is going to initiator. If initiator edits(Change the value) and proceed the item of shopping cart, it is going from 2nd level rather than starting 1st level.
    Is it standadard behavior of Process controlled workflow ?
    Is there any idea to go 1st level rather than 2nd level .
    Thanks,
    Balaji.T.
    Edited by: balajit on Apr 28, 2011 10:19 PM

    Hi,
       Yes - This is standard behavior if you are using Approval with completion..in order to restart the WF , you need to implement the Badi implementation for interface../SAPSRM/IF_EX_WF_PROC_RESTART.. you can find more details in SPRO-Manage Process Restarts
    Saravanan

  • How do I run a background process which is under WLE control

    Hello folks:
    How can I run a background process that runs under WLE's control.
    What I am looking for is a way to have a process that runs in an
    infinite loop and polls the database to see if there is any background
    work that needs to be done. But I still want the process to be managed
    by WLE for fault tolerance.
    Thanks,
    Ram Ramesh
    [email protected]

    The easiest way to do this is to write a Tuxedo server (i.e., using only
    ATMI and no CORBA stuff) that does the following:
    1.) In tpsvrinit(), the last thing that it should do is a tpacall to the
    service contained in this server (and nowhere else) with the TPNOREPLY
    flag.
    2.) In the method that implements the service, do your database work, sleep
    for a little while, do another tpacall to itself with the TPNOREPLY flag,
    and return.
    Hope this helps,
    Robert
    Ram Ramesh wrote:
    Hello folks:
    How can I run a background process that runs under WLE's control.
    What I am looking for is a way to have a process that runs in an
    infinite loop and polls the database to see if there is any background
    work that needs to be done. But I still want the process to be managed
    by WLE for fault tolerance.
    Thanks,
    Ram Ramesh
    [email protected]

  • Admin unable to reject entities in process control/process management

    Hi this is in HFM v 11.1.2.1. We have a small hierarchy which has one security class assigned to all seven entities. The end user sees that all entities except the top parent are "green" when she looks at it in the process control screen. The top parent, however, is orange. She can't consolidate it although she has rights. She can calculate and consolidate all of the entities and sub-parents below. Even though the top parent is orange, she can promote it, as well as all of it's children. Just to make this even more interesting, the administrator is UNABLE to reject the base entities in this structure back to First Pass - instead they remain at Review Level 1. Has anybody heard of bugs in the Process Control for this version (11.1.2.1)? Thanks for your help.

    For your rejection concerns, there are instances wherein the users tried to expressly promote an entity, at times including its base level members to a higher review level. Doing so makes it hard to reject. As a suggestion, it is always a best practice to promote entities one step at a time. In the aspect of rejecting, verify if you have the EPM Utilities Menu enabled, go to Auto Promote and reject.

  • Process controlled workflow - Reject SC approval

    Experts,
    I configured process controlled workflow in SRM 7. My approval process is working fine but i need to send a notification e-mail when the approver rejects the SC approval. The requisitioner will receive this email saying that the SC was rejected.
    Is there any chance to do this with configuration? Do you have to use a new expression linked to an event to perform this ?
    Thanks for your help,
    Best regards,
    Mário

    Hello Mario,
    See IMG path below:
    SAP Implementation Guide -> SAP Supplier Relationship Management -> SRM Server -> Cross-Application Basic Settings -> Business Workflow -> Process-Controlled Workflow -> Business Process Configuration -> Define Recipient of Notifications
    For scenario "Approve Shopping Cart", you can define user role which will receive notification in the event of "Rejection".
    Regards.
    Laurent.

  • How to maintain Import Processing: Control Code for the country India

    Hi Gurus,
    I need to maintain the Control Processing: Control Code for the country India in SPRO configuration.
    Please tell me the path to maintain it.
    Thanks,
    Thiyagu

    spro@Logistics - General@Material Master@Material IDs@Maintain PKWiUs
    Regards,
    Indranil

  • How to determine N Step Approval process through Process Controlled workflow

    HI
    For SC approval process after 4th level of approval the workflow keep go N step till the approval determine. If no approval find then go for WF Exceptions.
    In PCW we have process level like 100, 200, 300 and so on. What would be the procedure for Nth process level determination in SRM process controlled workflows settings.
    Regards
    Kharabela

    Hi,
      From SRM 7.0 PCW, requestor of SC or creator(buyer) of the PO can't be in the approval list.. this is standard...
    create two custom events like zev_po_schema_eva and zev_po_sl_approval
    create two custom expression.. one with constants as zev_po_schema_def and other one is formula interpreter(0FB001)..
      assign zev_po_schema_eva as schema evaluation for PO.. MAKE SURE YOU LINK THE zev_po_sl_approval
      with as zev_po_schema_def..
       now create schema definition entry and specify as zev_po_schema_def..
       now create process level
       100 approval / approval with completion ( Your chooice ) .. maintain  zev_po_sl_approval as evaluation id in the process level... maintain RR_SPENDING_LIMIT_APPROVER as Resp.Resolver...
    maintain formula interperter value as (OV_SC_PREVAPPROVALIMI < 0V_PO_POTOTALVALUE ) AND (OV_SC_SPNDNGLMTFRQST < 0V_PO_POTOTALVALUE).
    Saravanan

  • Back and Forth Logic in process-controlled (BRF) workflows in SRM 7.0

    Hi all,
    I am using the process-controlled workflow in SRM 7.0.
    The approval itself works ok, but now I am trying to set up the back-and-forth functionality (similar to how it worked for the Badi in SRM 5.0) as default:
    This is what happens:
    Requester creates shopping cart.
    Shopping cart goes for approval.
    Approver rejects SC.
    Back at the requester the SC can only be displayed, but not changed.
    As far as I can tell this happens for any kind of decision set (as long as all items are rejected).
    This is what I am trying to set up.:
    Once the SC is back at the requester, he can either accept the rejection OR change the SC and 're-order' it ie send it back to approver again.
    I know if the requester checks the flag 'Work Item to Requester at Process End' this can be done, but I need the system to have this functionality automatically without setting a flag manually.
    I really appreciate any suggestions on this issue.
    Cheers
    Ulrike

    Dear Masa,
    thanks for your helpful answer. I have an better idea now, but I am still not quite able to set it up.
    I have applied note 1296209.
    When i tried to set up this step I did the following:
    level type of that step I used 'Approval with completion'.
    Created Expression of type SAP Formula Interpreter, with return type Boolean, and use formula:
    0V_WF_CURRENT_DECISI = 'REJECTED'
    linked the evaluation id to above expression.
    Task id for the step is: 40007994 - Accept Decision / Adjust Document
    When i do this and create a SC, my system dumps after clicking on describe requirement::
      The following error text was processed in the system SR7 :  The method could not be found at dynamic call.
    The error occurred on the application server SAP01_SR7_07 and in the work process 1 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
          Method: CALL_RFW of program /SAPSRM/CL_WF_RULE_CONTEXT====CP
          Function: /SAPSRM/WF_BRF_0EXP000 of program /SAPSRM/SAPLWF_BRF_DATA
          Method: PROCESS_SPECIFIC of program CL_CALL_FUNC_METHOD_BRF=======CP
          Method: IF_RULE_COMPONENT_BRF~PROCESS of program CL_EXPRESSION_BASE_BRF========CP
          Method: GET_RESULT of program CL_EXPRESSION_POOL_BRF========CP
          Method: IF_EXPRESSION_BRF~GET_SUBEXPRESSION of program CL_EXPRESSION_BASE_BRF========CP
          Method: IF_FOEV_CONNECTOR~EVALUATE of program CL_FORMULA_BRF================CP
          Method: EVALUATE of program CL_FOEV_FORMULA===============CP
          Method: EVALUATE of program CL_FOEV_FORMULA===============CP
          Method: EVALUATE of program CL_FOEV_FORMULA===============CP
    What I don't understand about your explanation is what you mean by "Acceptance by Contact person". I don't have that option anywhere in my BRF? Is that supposed to show up under Resp. Resolver Name (like RR_MANAGER)?
    Also where did you add that step in Process level configuration? I have 2 approval steps (just approval, without completion) and then i wanted to enter this step after those levels before the automatic system decision.  But i wasn't able as the system doesn't allow you to add a completion step after a 'normal' approval step.
    Cheers for your help
    Ulrike

  • Inconstancy in Approval Workflow- Process Controlled Workflow

    Hello Experts,
    We are in SRM 7.0 classic scenario using process controlled workflow and facing an issue as described below:-
    During the approval workflow, we are observing that in
    Case 1: When approver3 is forwarding the work item to approver10, the approver10 in not getting the work item in his Inbox. However, when we see the log detail in SWI6 the status is shown as u201CREADYu201D
    Case 2: We created a shopping cart with identical details as in Case 1 and followed the same approval process i.e.Approver3 forwarding the work item to approver10, however in this case approver10 is getting the work item in his Inbox and when we see the log details in SWI6 the status is shown as u201CCOMPLETED"
    We tried this scenario for 10 times and we found that in 2 cases the approval status is showing as u201CREADYu201D while in other 7 cases the approval workflow got completed.
    Can you all experts please help us understand why this is happening and how can be find the root cause i.e why Case 1 is in u201CREADYu201D status for last 2 days.
    We seek your help in understandingroot cause so that we can eliminate any inconsistency in future.
    Any pointers to resolve this issue will be highly appreciated.
    Thank you in advance.
    Regards,
    RKS

    Use class /SAPSRM/CL_WF_APV_FACADE. This is used by standard SAP WF Analysis.
    Methods - RETRIEVE_PROCESS_HISTORY, GET_CURRENT_PROCESS_STATE, CREATE_PROCESS_FORECAST.
    To analyze more, check the program /SAPSRM/WF_CFG_ANALYSIS_002. Check lines 209...216 (These Lines pull Previous Approved Steps, Current Process Step & Gets the approval forecast). However the REJECTED Items (Accept Decision) work little different (which is not captured by this report).
    To Identify the current approval process awaiting decision by the requester of the cart, use method GET_CURRENT_PROCESS_STATE, return parameter structure /SAPSRM/S_WF_PROCESS-PROCESS_LEVEL_LIST-DECISIONSET_LIST-ITEM_STATUS_LIST gets you the current status of the item (ACCEPTED, REJECTED, OPEN, INQUIRED). If ITEM_STATUS_LIST-ITEM_STATUS EQ 'REJECTED', then the WF is waiting for acceptance/resubmission from the requester.
    To your specific need, pass DOCUMENT_GUID to the class /SAPSRM/CL_WF_APV_FACADE=>GET_CURRENT_PROCESS_STATE get the return parameter /SAPSRM/S_WF_PROCESS. It will give you PROCESS_LEVEL_LIST. Then loop through DECISIONSET_LIST. It contains Table Types of AGENTS_LIST, ITEM_STATUS_LIST, WORKITEM_LIST. At /SAPSRM/S_WF_PROCESS level, you can get all the details of the current process level details
    Thanks,
    SC

  • Phased Submission (Process Control)

    Hi,
    I want to use the phases submission in process control and I have a problem regarding the submission group and the order in phased submission ...
    In application settings is submission phase activated for accounts, custom1 and custom 4.
    The follwoing issue ...
    Phase 1:
    Accounts: Gross Margin (from P&L) --> Group 10
    Custom1: [None] --> Group 15
    Custom4: Input1 --> Group 50
    Phase 2:
    Accounts: Rest of P&L --> Group 20
    Custom1: [None] --> Group 15
    Custom4: Input1 --> Group 50
    Accounts: Balance Sheet --> Group 30
    Custom1: Movements --> Group 30
    Custom4: Input1 --> Group 50
    Phase 3:
    Accounts: P&L --> Group ??
    Custom1: CostCenter --> Group 45
    Custom4: Input2 --> Group 60
    How can I do it???
    Thanks for help!
    Stefan
    Edited by: tyranny242 on Oct 19, 2010 12:08 PM

    So I understand your problem, I'm just really confused as to how that happened. Can you share the Process History of the two phases(Feel free to remove names, the times are the important parts).
    To go from Published in Phase 1 to RL3 means that you were somehow able to reject Phase 1 twice. Either that, or Submitted is not considered higher than RL 3.
    Try seeing if you can reject phase 1 down another level and then reject Phase 2. I don't know if HFM considers Submitted to be the 2nd highest RL or not, but if it doesn't, then this might work.
    Again, the process history for the entity would help greatly.

  • 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.

Maybe you are looking for

  • Since upgrading to Yosemite mu USB 3 to Ethernet adapter not working

    I just recently (earlier today) upgraded to Yosemite 10.10 from Mavericks and now my USB 3.0 to ethernet adapter is not working.  I see a bunch of people complaining about this online but I can't follow the solutions.  They seem to be playing with pl

  • Standard report center text in table

    Hello, I am new to LabVIEW 2011 running Windows 7.  I am trying to run and print standard report in LabVIEW but I couldn't figure out how to make text or data to center in the table. See pic below. Please help. Thank you so much in advance. Marlin12

  • Can the deskjet 3940 be used with a dell inspiron mini laptop which has no cd compartment?

    Hello ? Really keen to purchase Deskjet but at moment only have the laptop named above to use with it.Is this possible as the set up CD does not go in it as no CD compartment ?

  • Help required on Mask functionality..

    Hi Gurus, One of our Client has a requirement that the catalog items should be available to the users specific to their Company codes. For this purpose I have created a custom field in the "Catalog Items" table as Co.Code. Created users & roles. Made

  • Working with various formats within project

    Good Afternoon, I am about to embark on creating a 2-3 minute splash reel for our company, to include tons of clips from work we've done in the last year. Owners of content submitted the work in a variety of formats with an unfortunate emphasis on WM