BADI [BBP_WFL_SECUR_BADI]

Hi,
Would like to ask about this BADI. In the doc it is written that
[[You use this BAdI to prevent the approval workflow from starting again
if the manager changes only the cost center of a shopping cart during
the approval process.]]
In the BADI only these parameters are available
ACTUAL_USER
OBJECT_ID
OBJECT_TYPE
GUID
SCENARIO
NEW_SEC_LEVEL
How the system knows which fields the approver has changed?
Alok

Hi
<b>Go through the sample code below.</b>
method IF_EX_BBP_WFL_SECUR_BADI~SET_SECURITY_LEVEL .
data: ls_header type BBP_PDS_SC_HEADER_D.
clear ls_header.
  CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
    EXPORTING
     I_OBJECT_ID             = OBJECT_ID
     I_WITH_ITEMDATA         = 'X'
   IMPORTING
     E_HEADER                = ls_header
*   TABLES
*     E_ITEM                  = lt_item
*     E_ACCOUNT               = lt_account.
*--- In lt_Account table.. you can find the details of the cost center..
*--- Incase the shopping cart is changed, that means SC Creator name will
*--- be  different from Approver (manger) name
*-- If current user not = user who created cart set security level = 1
If NOT ACTUAL_USER = ls_header-created_by.
   NEW_SEC_LEVEL = 1.
Endif.
endmethod.
<u>Related BADI Documentation -></u>
<b>BBP_WFL_SECUR_BADI</b>
You can use the Business Add-In (BAdI) BBP_WFL_SECUR_BADI to determine whether
1) A shopping cart can be changed during the approval process
2) The approval workflow restarts when changes are made to the document
3) A reviewer/approver can be added or changed
4) These are the call scenarios (see import parameter SCENARIO).
You use this BAdI to overwrite the settings for the authorization level of approver. The BAdI is called each time the shopping cart screen is opened and whenever a purchase order is ordered and held.
For more information, see the SAP Note 502952.
Example
You use this BAdI to prevent the approval workflow from starting again if the manager changes only the cost center of a shopping cart during the approval process.
Standard settings
Rejection of a shopping cart item causes the approval process to be restarted (dependent on workflow start conditions and authorization level). SAP supplies a BAdI-Implementation that prevents a restart if you set the authorization level of the approver to "not defined".
The standard system features the following authorization levels, which you can set in user maintenance (transaction SU01) or role maintenance (transaction PFCG) on the Personalization tab. Note that user settings override role settings:
Not defined Initial setting: Authorization level on delivery.
No authorization
Changes to the document are not allowed while it is being approved.
Low
Changes can be made to the document. The approval workflow is restarted after every change.
Medium
Changes can be made to the document. After every change, the approval workflow either continues or is restarted.
The system evaluates the start conditions and restarts the workflow if a new approval is required as a result of the change. If this is not the case, the approval workflow continues.
High
Changes can be made to the document. The current approval process always continues. A new approval workflow is not started when the document is changed.
Note: if the approver is assigned several roles, the system uses the highest authorization level.
Activities
The following parameters are provided in the SET_SECURITY_LEVEL method:
Import
ACTUAL_USER (user whose authorization level is overridden)
OBJECT_ID (transaction number of the document
OBJECT_TYPE (business process type)
GUID (unique document key)
SCENARIO (scenarios in which the BAdI is called).
Export
NEW_SEC_LEVEL (determined authorization level)
Hope this will help.
Regards
- Atul

Similar Messages

  • Use of BADI BBP_WFL_SECUR_BADI in SRM 7 PCW

    Hi all,
    We are on SRM 7.0
    We had implemented the BADI BBP_WFL_SECUR_BADI to overwrite the authorization levels(basically BBP_WFL_SECURITY parameter) in SRM 5.0 so that when new approvers are added in SC workflow/SC approval process,they are able to change as well as approve the SC.
    Can someone please tell me how can I achieve the same now in SRM 7 with PCW?\
    Thanks.

    Thanks Saravanan.
    But in SRM 5,we had to do it selectively only for some users at runtime based on table entries in a custom table and also when the approver is the shopping cart creator.
    Considering,how do we do it now in SRM 7 PCWpartuclarky how to change the BBP_WFL_SECURITY at runtime in SRM 7 when the approver actually goes to approve the cart?

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

  • BBP_WFL_SECUR_BADI triggered twice

    Hi Gurus,
    I am using BADI BBP_WFL_SECUR_BADI to retrigger workflow when user make changes to certain fields in the shopping cart. First I check SCENARIO is initial, then I use function BBP_PD_SC_GETDETAIL to get screen values, then I called function BBP_PROCDOC_RESET_DB_BUFFER_SG to reset database buffer before calling function BBP_PROCDOC_GETDETAIL to get database values.
    I compared values on screen verses values in database and then set NEW_SEC_LEVEL = 2 if retrigger is necessary. Everything works fine except this BADI is triggered twice, once before save and once after save. Second call is made after screen values are committed to the database. So this make my screen value and database value the same when the BADI is triggered for a second time. So approval is never retrigger since there is no difference.
    Appreciate any advice or help, thanks.

    Hi,
       I think this  BADI should work for PO also.Pls read the doc again and there you can see the scenario for  PO is also covered wherein the BAdI is called each time the shopping cart screen is opened and whenever a purchase order is ordered and held.
    For more information, also see the SAP Note 502952.
      But this will not work for BIDS/AUCTIONS.
    BR,
    Disha.
    Pls reward points for helpful answers.

  • BADI for forwarding SC approval.

    Hi All,
    I have  a scenario like,when I need to forward the approval of a SC,a workflow 14000133 gets triggered and we want to find the BADIs that are getting called inorder to implement our scenario.
    We need to implement a BADI that does the restriction and selection of approvers which have a spend limit equivalent to the approver who is forwarding the shopping cart.We are trying on BADIs BBP_OFFLINE_APP_BADI  and BBP_WFL_APPROV_BADI.Will the debugging of workflow help?
    Can anyone please post some useful links on debugging a workflow??Is it possible??
    Thanks in advance.
    Regards,
    Gowthami.

    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>

  • When SC is partially rejected my manager no workitems are not going to user

    Hi Gurus,
    Below is our requirement:
    Requester (User) creates a SC of multiple line items. Shopping cart is rejected by the manager for a particular line items and rest of the line items was approved, for the rejected line items workitems are not going to requestoru2019s inbox and also e-mail is not triggered to requistioner.(Informing that the SC is partially approved)
    Help us how to implement the above functionality? We have figured out a BADI- BBP_WFL_SECUR_BADI will this BADI suit to our functionality.
    IF then throw some input on this. Or please suggest any OSS note related to this functionality.
    Regards
    Paul

    Hi Daniel,
    Thanks for the quick response.
    WF we used is WS14000133, Last approver is Manager further no approvers.
    For Manger they havenu2019t set (BBP_WFL_SECURITY) any value.
    Regards
    Paul

  • Invoice BUS2205 Workflow

    All-
    We are working on a SRM 5.0 (Classic Scenario Implementation). We have implemented the 2 step Invoice workflow along with other workflows. The business requirement is as follows:
    1.) Requester creates invoice
    2.)Special approver changes/Updates accounting data and approves.
    <b>3.) Once approved, the invoice Work item has to goto the next approver for approval without re-triggering the approval</b>
    <u><b>Problem</b></u>
    1.) Requester creates invoice
    2.) Special Approver changes/updates accounting data and approves.
    <b>3.) Once approved, the work item is again in the special approvers inbox with a notification sent to the requester (No Work item with accept changes button is sent to the requester, like in a SHC) that the invoice has been changed.</b>
    To tackle this problem, we are using the BADI BBP_WFL_SECUR_BADI and flipping the authorization level of the user from "Medium" to "High" when accounting data has been changed. Even after doing so, the workflow is retriggering and the work item is sitting again in the special approvers inbox.
    We also found out that the Workflow is not even hitting the BBP_WFL_SECUR_BADI.
    Question?
    1.) Does anybody know if this BADI can also be used for Business Object BUS2205. I know that we have used this BADI for our past clients for Confirmations but i am not sure if it can be used for BUS2205 Invoice?
    2.) Is there any setting that needs to be accomplished to stop this behaviour? How can we avoid this behaviour?
    Thanks,
    Sundeep

    Hi
    <b>I don't think the BADI - BBP_WFL_SECUR_BADI  will help in solving this issue.</b>
    Try this ->
    <u>You can use the AUTHORISE_FOR_CHANGE method of the BBP_CHNG_AGNT_ALLOW BAdI to prevent approvers from being changed.</u>
    If the workflow is not working as expected, see SAP Note 322526 Analysis for workflow problems.
    I guess, that the workflow conditions are not properly configured or this might be due to some OSS note missing in the system.
    <u>Some related OSS notes: -</u>
    <b>975852 No workflow is started after you have entered invoices
    1039864 INVOICE: Sometimes no Workflows started
    986391 Some objects have no workflow
    Note 1033007 - Requester is first approver during BAdI restart
    973915 Incorrect approvers during restart of BADI workflow
    1015915 Wrong restarts in some cases
    942115 Invoice IDocs are not sent
    889693 New exception category (Invoice entry overdue)
    710787 EBP: Message control: Additional messages (2)
    625344 Status change not possible because follow-on docs exist
    699300 EBP-INV purchaser as approver of his invoice
    373675 Problems with invoice generation (check list)
    362904 Completeness status is not in WF Container
    Note 942089 - 'Accept changes' creates restart</b>
    Please refer to these links.
    <u>http://help.sap.com/saphelp_srm50/helpdata/en/2c/e68d406b305537e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/5a/af5f1185d011d2b42d006094b92d37/frameset.htm</u>
    Incase it does not help, please raise an OSS message with SAP.
    Regards
    - Atul

  • AD-hoc approver n step item level shopping cart workflow

    Hi
    We are on latest version of SRM and using n step item level SC approval workflow.
    The scenario goes like this:
    -     Requester creates shopping cart and workflow goes for two step approval.
    -     In the approval preview the requester is able to see both levels of approvers, which is correct.
    -     Requester now selects second level approver and replaces him with a ad-hoc approver. WE DO NOT WANT THIS.  Requester should NOT be able to replace an approver determined by approval badi. However should be able to extend approval step with ad-hoc approver say third level approver a ad-hoc approver. Also he should be able to change AD-HOC approvers ONLY.
    Thanks
    Joe

    Jo,
      You may be able to achieve it in the BADI BBP_WFL_SECUR_BADI .
    You can use the Business Add-In (BAdI) BBP_WFL_SECUR_BADI to determine whether
    A shopping cart can be changed during the approval process
    The approval workflow restarts when changes are made to the document
    A reviewer/approver can be added or changedThese are the call scenarios (see import parameter SCENARIO).
    Regards,
    Suren

  • Re-starting Item Level Shopping Cart Approval Workflow

    Hi All -
    We are implementing WS 14500015 - the Item-based n-level approval workflow for shopping carts - for certain scenarios.  In other scenarios we are using the overall approval workflow.
    I need to re-start the item-level approval workflow for certain scenarios (change in price, change in quantity, etc) - not when any and all changes are made to a line item.
    I was hoping to use the badi BBP_WFL_SECUR_BADI - which works great for the overall n-level shopping cart approval workflow.  However, I can't seem to hit it appropriately for the item level approval workflow!
    Does anyone know if this BADI or any other can be utilized for determining when to re-start the item-level shopping cart n-level approval workflow?
    Thanks so much!
    Abby

    hi,
    Have you implemented the badi BBP_WFL_SECUR_BADI ? for restarting the workflow?
    Let me know?
    Also it is possible to debug and see why the restart does not happen.
    Also let me know wether the restart happens in other cases?

  • Change button missing in the created SC

    Hi Gurus
    User 1 has shopped for user 2, who is having the approval limit and created the Shopping Cart. The SC is in the status of Awaiting approval.The user 1 is trying to change the data in the created SC, but he is not getting the "Change" button.
    Also the user 2 is trying to Change the data in the SC before approving the SC, he is also unable to find the "Change" Button.
    The user 1 is having the Security parameter BBP_WFL_SECURITY value as Low and the user 2 is having the Security parameter BBP_WFL_SECURITY value as High.
    FYI, if the approver rejected the SC, then also the creator is not getting the Change button. And if the SC contains any error to convert to the follow-on documents, then user 1 & 2 are able to get the Change Button.
    please advice.
    Thanks
    Sada

    Hi Sada,
    You can check if badi BBP_WFL_SECUR_BADI is active. After a support package, this badi became active by default. If you do not have your own logic within this badi you can deactivate it.
    The sample SAP code always return "0", which does not allow the user to change the document.
    Kind regards,
    Ricardo

  • 'Change' authorization when manager raises SC as a requisitionar.

    Hello,
    First let me explain the regular functionality.
    When a requisitionar (with role SAP_BBP_STAL_EMPLOYEE) orders the shopping cart and the same is gone to manager
    ( with role SAP_BBP_STAL_MANAGER), the manager can change but employee can not.
    i.e. the manager can see the 'change' button under approval for that SC but employee can not.
    This we have achieved by setting the security level (BBP_WFL_SECURITY) under PFCG for resp. role.
    For role SAP_BBP_STAL_MANAGER = 4
    For role SAP_BBP_STAL_EMPLOYEE = 1
    Our client is happy with this functionality.
    But, now it's desired that when the manager will raise a SC for his own use,
    then the manager also must not be allowed to change the SC once ordered or when changed/rejected by his approver.
    Please let us know whether this is possible?
    If yes, How?
    BR
    Dinesh

    Hi Dinesh,
    with the BADI BBP_WFL_SECUR_BADI, method SET_SECURITY_LEVEL, you can change the WF security level determined from role personalization.
    In input parameters you have the user ID in ACTUAL_USER, the object ID/Type/Guid, the scenario SCENARIO (see possible values in SE11 domain BBP_SC_SCENARIO).
    So with the inbound scenario and the user's profiles, you can determine your own security level and overwrite the standard one.
    In export parameter, you have the changed security level NEW_SEC_LEVEL.
    Rgds
    Christophe

  • Html template for approve/ reject sc

    Hi there,
    Whats the HTML tempalte for the approve / reject SC.
    There is button called 'change' in the approval screen of the approval.
    I want to remove this button through html modifcation.
    has anybody done thsi befor / how to achieve this.
    Please help.
    regards

    Hi,
    IF you are talking about the CHANGE button which appears when adding an approver,then you can implemnet the BADI  BBP_CHNG_AGNT_ALLOW for it.Also see note 894346.
    If you want to remove /disable or not allow the approver to chnage the SC using the CHANGE button,thenn you can do this by setting the  value of the paramtere "BBP_WFL_SECURITY " to low in trasn PFCG.
    See if the foll threads are useful to you....
    1>Re: Employee should not be able to change SC at all
    2>Re: How to stop an approver from changing a line item during approval
    You can also implement the BADI BBP_WFL_SECUR_BADI,
    method - SET_SECURITY_LEVEL to overwrite ur PFCG settings....
    BR,
    Disha.
    Pls reward points for useful answers.

  • Change button is not appearing in the SC after SP Application

    Hi SRM Gurus,
    Change button is not appearing in SC check status after Higher SP Applicaation implementation.
    Can any body tell what will be the reason and solution..
    Thanks in advance
    CK
    Edited by: CK on May 13, 2009 6:30 AM

    Found OSS note to fix problem
    Standard implementaion of Badi BADI BBP_WFL_SECUR_BADI had got activated because of OSS note 1022237 which got applied as part of SP 14. This BAdi was setting the WFL security level to 0 for all users.
    After deactivation of Badi Change button is appearing
    Thank you

  • Workflow only has 1st approver after restart even if more were there before

    Hi,
    We have are using a BADI, BBP_WFL_SECUR_BADI, to restart the workflow of a shopping cart. This restart is triggered when the price of the shopping cart has been changed and if the shopping cart has been partially approved (approvals consist of 2 or more approvers).
    The BADI only includes 1 export parameter. In the BADI, I call function modules to check if the price has been changed. If true, then I set the export parameter to '2'. This restarts the workflow once the shopping cart is saved.
    However, if the workflow had 2 or more approvers - after the restart, only the 1st approver remains in the approval preview.
    Can anyone help?
    Thanks.

    Hi,
    I think approvers are re-evaluated after workflow re-start.
    Can you check workflow log in SWI1? If it shows only 1 approver, approver preview is correct. If it shows multiple approvers, it looks a bug in preview.
    Regards,
    Masa

  • SRM7  team purchasing: cannot take over SC by subsititute

    Hi all,
    We are testing "Team Purchasing" function in SRM 7 SAPKIBKV05 .  Cross organizational substitution had been checked in configuration.  User A assigned user B as purchase substitute.  Now the questions:
    (1) User A ordered a team SC which in awaiting approval status.  User B can display the team SC but u201CTake Overu201D button is grey out.  Is this as designed?
    (2) User A saved a team SC in Saved status.  User B can take over the saved team SC.  But after this user A cannot display the team SC in Check Status tag "Shopping Carts" or "Team Carts".
    We are using application controlled workflow (SAP standard WS10000129 for testing purpose) and badi BBP_WFL_SECUR_BADI is inactive. Users A and B's personalization BBP_WFL_SECURITY is 2 (Low), so changing shopping cart in approval status should be allowed.
    Please let me know if you have any answer or suggestion. Thanks.
    Regards,
    Donald

    Hi Donald,
    I have done some testings on team purchasing last year and my answers to your questions are:
    (1) User A ordered a team SC which in awaiting approval status. User B can display the team SC but u201CTake Overu201D button is grey out. Is this as designed?
    -> As far as I understand (and through testing), we can only take over the shopping cart if the SC is in SAVED status.
    (2) User A saved a team SC in Saved status. User B can take over the saved team SC. But after this user A cannot display the team SC in Check Status tag "Shopping Carts" or "Team Carts".
    -> This is correct. However, user A should see the SC under "Team Carts".
    Hope that helps.
    Regards
    SF

Maybe you are looking for

  • Crystal Reports 8.5 and Ms-Sql in Citrix Environment

    Hello All: I have a VB application that accessed data from a SQL-2005 database.  We use Crystal (8.5) for several reports. On the network or using VNC viewer all the reports work fine. However when we access te reports from Citrix client, none of the

  • Flash player for Device central

    Every time i try to preview a page in device central i get a message saying i need a flash player plugin. I click on ok and it takes me to adobe site that has download links for flash player 9. I have downloaded it 3 times now and i keep getting the

  • Schedule lines getting created even when material is there in stock

    Hi Friends, I have configured a normal material and have sufficient stock also, but when I am creating a sakes order the system is generating schedule line for the material even when I have stocks. Can someone please advice what could be the problem

  • Exiting from SQLPLUS on failure returned from a function

    I am working on Oracle 11g (R2). I want to call a function in package and if that function returns zero then I want to quit/exit from SQLPLUS prompt. I will be calling that function of package from an .sql file. How can i do this? I can also call rai

  • Find first occurence of an integer in a string

    Hi all, I have a number of strings which go something like "MBNA Flow 12a" and I want to separate the integer from the rest of the string so I can parse it, sort the strings into some sort of order according to their integer, and then put it all back