cancel
Showing results for 
Search instead for 
Did you mean: 

workflow WS14000133 rejection problem

Former Member
0 Kudos

Hello All

Can any one please suggest us to solve this issue ,

We are using a shopping cart header level approval (WS14000133), using BBP_WFL_APPROV_BADI

Where we are building approvers based on cost center ownership.

Issue: partial approval/rejection is not getting the correct approvers list

For example:

If the shopping cart having two items, with two different cost centers.

Item1 is having a cost center: 1121011

Item1 is having a cost center: 1121012.

After ordering, when the requester seeu2019s the approval preview, we are getting the correct approver list. (at this particular point of time Work item id will be Initial )

We Build the approvers list , in such a way that based up on the cost centers so that each cost center has 2 levels of approval. So in the above scenario the approval preview will be displayed like this (when requester is ordering the cart):

Approvers index description

AAAA 00001 1121011-1st level

BBBB 00002 1121012-1st level

CCCC 00003 1121011-2nd level

DDDD 00004 1121012-2nd level

The problem we are facing is during partial approval/rejection by the approver.

When the approver partially approves/rejects the cart and saves, and requester accepts the changes-->the approval preview shows approvers who are not relevant to cost center of the particular item.

For example if the first approver rejects the 2nd item :

EX:

Item1 is having a cost center: 1121011 Approved

Item2 is having a cost center: 1121012. Rejected

The Expected output of the approvers list is

Approvers index description

AAAA 00001 1121011-ist level

CCCC 00003 1121011-2nd level

(Since approver rejected the item2, it should not get the approvers which are maintained for the cost centers of item 2)

That part we are able to achieving the by checking the Deduct Indicator for the particular item in the BBP_WFL_APPROV_BADI.

If 1st level approver approves item1 and rejects item2, we should not get the approvers which are maintained cost center as 1121012(since we are rejected the item2, which is having cost center as 1121012).

At this particular point of time Work item will get generated.

So its system is getting the approvers as initially assigned looping into approvers we got it from the BADI, based up on the actual approval index its populating below results , which are wrong .

Results coming now

Approvers index description

AAAA 00001 1121011-ist level

BBBB 00002 1121012-ist level

When we see in the BADI, we are getting the correct approvers list, where in the standard FM, these values are getting changes based up on the actual approval index.

The function module where the values are changing is BBP_WFL_DIN_APPR_CHECK (which will be calling inside the BBP_WFL_DIN_APPR_FINALLIST_GET )where are the changing the approvers list

BBP_WFL_DIN_APPR_CONTAINER_GET which is calling the approvers at the initial stage .

Can someone let us know why the approvers are getting changed? Is it anything to do with out BADI code or any bug which can be fixed by OSS notes?

If anybody has any suggestions, please share it with us

Will appreciate, any pointer to the same.

Accepted Solutions (0)

Answers (1)

Answers (1)

martin_nooteboom
Active Contributor
0 Kudos

As far as I can tell I think there is a problem in the Badi. You need to make sure when you loop over your line items you exclude the items where the field del_ind is set. Also I think you are complicating things because you are trying to create a sort of line item approval at header level.

I think you should debug your Badi at different levels to see if you get the correct results.

Regards,

Martin

Former Member
0 Kudos

Hi Martin ,

Thank you for your reply.

We are elimanating the approvers for the particular item, By checking if the particular item has any of these indicatorRejected ( DEDUCT_IND) , Deleted (DEL_IND).

When i am Degugging i can see the all the correct results in BADI .

Problem facing is when comes function module , after the BADI.

martin_nooteboom
Active Contributor
0 Kudos

Did you also debug it with the partially rejected shopping cart? What do you mean by eliminating? do you get them first and the delete them from the table?

If you are absolutely sure your Badi is correct, you could raise a message at OSS.

Regards,

Martin

Former Member
0 Kudos

Hi ,

Thank you ,

when the requestor will see the appoval preview when shopping cart odered , we can see all the all the appovers how we are expecting.

But when approver try to partially approve the shopping cart ,

we build a logic in the BADI , Based up on the Deduct_Indicator of the partiluar rejected , We elimating cost center of the item , when we are trying to loop into to get approvers .

LOOP AT p_t_account INTO ls_account.

Read table p_t_item into ls_item with key guid =

ls_account-p_guid.

    • We consider only items, which are not deleted (del_ind = 'X')

    • We consider only items, which are not Rejected (deduct_ind = 'X')

if sy-subrc = 0.

if ls_item-deduct_ind EQ 'X' OR

ls_item-del_ind EQ 'X' OR

CONTINUE.

      • Found out to which cost center this item belongs

ELSE.

APPEND ls_account-cost_ctr TO t_cc_list.

ENDIF.

ENDIF.

ENDLOOP.

case : at the time of shopping cart ordered , deduct-ind will not be "X" .

case2: when the apporver trying to reject that time deduct-ind will be "X".

martin_nooteboom
Active Contributor
0 Kudos

I suggest you test your Badi with the shopping cart you have partially rejected to see if you get the result you think you will.

Regards,

Martin