cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow Administrator appears in workflow without cause

Former Member
0 Kudos

Hello Gurus,

I am using the N-step shopping cart approval workflow in SRM 4.0. I recently populated the workflow administrator so that the annoying messages that one doesn't exist would quit appearing in RZ20 (application monitors). Now, on some of my workflows, the workflow administrator gets added as an approver for no apparent reason. I have scoured the workflow log, system dumps, and the transactional RFC log for errors pertaining to why the administrator was added as an approver.

Any ideas why this might occur? Any other ideas as to where I could look for errors?

Thanks,

Kris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You must have implemented the BAdi "BBP_WFL_APPROV_BADI" for the number of approvers.If you see parameters in this BAdI there are tables for approvers and administrator.

You can check number of approvers in approvers table. If this table is empty, then append your name or workflow administrator name (or both) into administrator table so that even if shopping cart doesn't find any approver, BAdI will send work item to you or workflow administrator and shopping cart workflow will not get stuck.

See a small example below.

Tables which I mentioned above are -

APPROVAL_TABLE ( will have all your approvers)

APPROVAL_ADMINISTRATORS ( will have administrators).

In the following code if no approver is found, Work item goes to WFADMIN and CHIEFOFCR (Chief officer).

Hope this is clear.

See coding as -

i]IF approval_table[ IS INITIAL.

*fill administrators for WIs with missing approver assignment:

CLEAR ls_approver.

ls_approver-approval_agent = 'USWFADMIN'.

APPEND ls_approver TO approval_administrators.

ls_approver-approval_agent = 'USCHIEFOFCR'.

APPEND ls_approver TO approval_administrators.

ENDIF.

BR,

Disha.

Pls reward points for useful answers.

Former Member
0 Kudos

Previously the BADI was coded in the way you describe and we were constantly getting alerts that no workflow admin was defined. When we looked at all workflows, there were no issues. To alleviate this, we now always define the administrator, even if the approval table contains entries.

We are only seeing the administrator inserted for a few workflows, which leads me to believe that there is some problem that SAP identifies and then sticks the administrator in.

What I am trying to do is figure out what the problem is that causes the insertion. I have checked everything that I know how to check.

Any ideas on where else errors might be stored?

Thanks,

Kris

Former Member
0 Kudos

The way i understand for your issue is that 'no workflow admin was defined' will come into picture when you are not maintain start condition. please check SWB_PROCUREMENT T.code. take out the admin coding in the Badi and make sure the workflow is been activated in the start condition.

John.

Former Member
0 Kudos

Sorry, John, that's not my problem. The workflow starts fine. (It's the n-step BADI workflow.) However, the workflow administrator is inserted as an approver into the workflow and I can't figure out why. I have narrowed it down that there must be a problem with a particular agent that the BADI is determining. But, nothing has clued me in as to what that actual problem is. I have tried everything obvious, like wheter or not the agent is expired or defective... Know of any obscure reason why an agent might be replaced with the workflow administrator?

Thanks,

Kris

Former Member
0 Kudos

Hi,

Can you decsribe the cases in which this is happening i.e. the Approval agent is not getting determined through the BADI and hence the Witem goes to the WF admin.Also is this happening when you use the ADD APPROVER functionality also.?

In the particular case for which the agent is not getting determined by the BADI(For which the Witem goes to the ADMIN),try using the ADD APPROVER functionality and see whether you can see any changes.

There might be some problem with the User(Who is the approver for that particular case).Also check in your BADI code whether all the tables are being refreshed properly.

BR,

Disha.

Pls reward points for useful answers.

Former Member
0 Kudos

In one particular case, the BADI determines 1 approver and the shopper adds two others. The last approver that the shopper added, which would be the last approver of the shopping cart, is being replaced by the workflow administrator. I am pretty sure that there is a problem with the added approver, but I can't figure out what the problem is. I have checked roles, organizational structure integration, the user is not expired and the user is not defective. I just don't know what else to look at.

Kris

khan_voyalpadusman
Active Contributor
0 Kudos

hi,

administrator user should be added only when there are no approvers returned by the badi.

so what you are doing , adding administrator user even when the badi is able to find administrators is wrong.

let me know wether you know how to debug , it is possible to find out why the system behaves like this.

Former Member
0 Kudos

OK, because soooo many carts were going to the administrator (for no apparent reason), I have changed the BADI code such that now the administrator is only defined if there were no entries in approval_table.

Now, work items don't go to the administrator, but I get an alert message in RZ20 that says, No administrator defined in approval BADI.

Does anyone know what makes the workflow thinks it needs to go to the administrator?

I figured out that one answer was if an approver is defective, the workflow thinks it needs to go to the administrator.

Anyone else know of anything else?

Thanks,

Kris

khan_voyalpadusman
Active Contributor
0 Kudos

hi,

If the system --> sends an alert message to RZ20 .

please create an OSS ticket for this--> SAP will guide you further regarding the alert message --> and i am not sure wether the message is to be sent to monitors (or) not.

But any way --> i can tell you from where this error message is thrown.

in the SRM system -->

1) Transaction SE37

2) Function Module --->

BBP_WFL_DIN_APPR_BY_RULE_GET

3) search for the following code

IF lv_admininistrator_found IS INITIAL.

      • create application alert because no administrator was found

MOVE iv_object_id TO lv_msg1.

CALL FUNCTION 'BBP_ALERT_WFL_START_COND'

EXPORTING

msgid = 'BBP_ADMIN'

msgno = 140

msgarg1 = lv_msg1

msgarg2 = '0'

EXCEPTIONS

invalid_parameters = 1

OTHERS = 2.

4) this is the place where the system will send the alert message

further look at the function module

BBP_WFL_DIN_APPR_FINALLIST_GET --> in this function module --->

search for the following code

IF lv_is_admin_approval IS NOT INITIAL.

      • this is the case if the approverlist from BADI is empty

      • and the administrator should get the workitem

SO ONLY FLAG WHICH DETERMINES WETHER TO SEND AN ALERT and WETHER APPROVAL ADMINISTRATOR IS REQUIRED IS THE

FLAG --> lv_is_admin_approval

5) Further ---> in the FM

BBP_WFL_DIN_APPR_BY_RULE_GET --->

find the following code --> where the above mentioned flag is set

      • In this case the implementation of the BADI is not correct. Get

      • the admin approvers returned by the BADI

ev_is_admin_approval = 'X'.

REWARD POINTS IF USEFULL

Edited by: khan voyalpad usman on Jan 25, 2008 10:54 PM

khan_voyalpadusman
Active Contributor
0 Kudos

further to my previous reply --> consider the following in

FM BBP_WFL_DIN_APPR_BY_RULE_GET

IF lv_no_further_approval IS INITIAL AND

lt_badi_approver_list[] IS INITIAL.

Usually ---> lv_no_further_approval is set when there are no more approvers involved in the approval chain.

this flag should be set to X after all the approvers have approved.

if this flag is not set after approval by the last approver , then approval table would any way be empty -->

and then badi administrators come in to picture

please refer to the above FM..

Former Member
0 Kudos

I had found where the alert was issued, but when I debugged carts that had thrown the alert, they were already changed such that they yielded no useful information.

I am worried about setting the flag for no further approval required in the BADI as many times additional approvers are added by shoppers. If the flag was set, would this cause the added approvers to be ignored.

Also, the flag for no further approval required is NEVER set if the BADI returned items in the approver list. Wouldn't this mean that ALL carts would issue an alert? Right now, only some carts issue an alert.

Thanks for your insight,

Kris

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kristine,

Do you managed to get this resolved? I'm facing the same issue. this will happen when user add more than 1 approver to the Last approver that the BADI return. The WF will ignore the last approver and set the SC as "Approved". Hope to hear from you soon.

Thanks,

Cindy

khan_voyalpadusman
Active Contributor
0 Kudos

administrator approver should be written in BADI in such a way that it is considered only when the BADI is not able to find any approvers.

looks like in your system , administrator user is getting added to the approval_table and this results in problems.

check out the following things

1) does this happen always (or) only some times?

2) if it happens sometimes , it is easy to identify the case when it happens .

3) please check wether you are adding administrator user anywhere in the approval_table?