cancel
Showing results for 
Search instead for 
Did you mean: 

BADI [BBP_WFL_SECUR_BADI]

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

tarkan_atesoglu
Explorer
0 Kudos

Hi everybody,

Does this BADI work on only Rejection or for all approval activities? I need the functionality of approval reset for price / total value changes, while other changes like vendor, product category do not trigger a approval reset.

Any opinions?

Thanks in advance

anil_w
Explorer
0 Kudos

You can use BBP_DOC_CHANGE_BADI and use function BBP_CHANGE_DOC_GET_NEW to find the changes.

Former Member
0 Kudos

Hi,

It means this BADI can be used to set the security level for the approver in such a way that he can change the Cost centre the Approval workflow/process will not be started.

BR,

Disha.

Pls reward points for useful answers.

Former Member
0 Kudos

But where do we need to specify certain field like cost center OR how to check that he has changed the cost center? There is no parameter which tells about the item info.

Former Member
0 Kudos

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

Former Member
0 Kudos

Not of much help. This FM will read the status available in the database. When the approver change the cost center it is not yet saved and system needs to decide security based on the changes that are not saved.

Changed values are not exported in the BADI. I think something can be done only after field comparision between old and new values.