cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

khan_voyalpadusman
Active Contributor
0 Kudos

Hi,

It is possible to restart the workflow , but for this you need to maintain the security level accordingly. in the parameter BBP_WFL_SECURITY in the personalization tab in transaction SU01.

this can also be done from the badi you have mentioned , i have seen during debugging that the badi is always called when even workflow is involved and the workflow would start if the parameters are maintained.

It is possible to find out wether restart happens at all , this can be done if you debug the 'accept changes' process by the requestor.

you have to look in the function module BBP_PDH_WFL_DB_UPDATE_BACK.

there will be one parameter lv_restart , which tells the system wether the restart should happen at all.

if lv_restart is set to 'X" , restart happens according to your requirement.

if lv_restart is set to empty , restart does not happen.

Former Member
0 Kudos

Hi,

I have considered changing the WF security parameters already, but this is not going to work, as I need to restart the WF only when the shopper accepts changes or changes the cart and resubimts it, and the change is to the total value or the main cc the WF uses.

I can't set the WFL security parameter to any of the standard values for the user as the shopper needs to change the shopping cart during apporval and should only restart the WF if certain data is updated. Our BADI WF has no starting conds, so the medium WFL security parameter setting will not work

I suppose I need to implement the BBP_WFL_SECUR_BADI to check the specific situation and set the security setting according to what is being done, and then hopefully the WF will restart after the shopper accepts changes.

Please let me know if anyone has a better idea or alternative solution!

Thanks a lot,

Nick

Former Member
0 Kudos

Hi,

Yes ,you can then implement the BADI BBP_WFL_SECUR_BADI to check the SC details(using FM 'BBP_PD_SC_GETDETAIL) and then acc set the BBP_WFL_SECURITY parameter value and initiate the restart of the workflow conditionallly.

BR,

Disha.

<b>Pls reward points for useful answers.</b>

Former Member
0 Kudos

Hi,

Yes ,you can then implement the BADI BBP_WFL_SECUR_BADI to check the SC details(using FM 'BBP_PD_SC_GETDETAIL) and then acc set the BBP_WFL_SECURITY parameter value and initiate the restart of the workflow conditionallly.

BR,

Disha.

<b>Pls reward points for useful answers.</b>

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Could you check the Security parameters for the users you are testing, and make sure the parameter is set to restart workflow for all the changes.( This can be set at user level or role level).

Thank you

Former Member
0 Kudos

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>