cancel
Showing results for 
Search instead for 
Did you mean: 

RE: Item-based approval

Former Member
0 Kudos

with regards to post so I can reward points to those who can really give a light on my issue. Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Again

2. For disha, pls correct me if I'm wrong..

for the "actual_approval_index"

PEOPLE

Requisitioner

Approver 1

Approver 2

Approver 3

Actual approver Index = 0 or 1

If the person logged in is Requisitioner and Approver 1.

And Actual approver Index = 2 if Approver 2 and so on?

Will give high reward for this..

1. Any idea what should I pass in BBP_WFL_DIN_APP_OBJ_GET?

Given this requirement ITEM Based Approval

determine the product type.

which have 3 types

1. NS - without product id

- have 3 different levels depending on the line item amount

2. SN - with product id and the subtype is blank

- have 3 different levels depending on the line item amount

3. SS - with product id and the subtype EQ 'DP'

- have 2 different levels depending on the line item amount

Thanks!

Former Member
0 Kudos

Hi ,

In the BADI,for each approval step,you haev to populate the approval_table with the APPROVERS from that level onwards.E..g IF ur approval step is 1 i.e. Ist Approval step..You will have to populate the approval_atble with the 1st and the 2nd approver...If 2nd step of approval,populate the approval_table with the 2nd approver and so on...

But analysing ur scenario...i can suggest you can maintain some custom tables wherin all the conditions will be stored and accordingly at runtime based on the runtime values of product type/total amount you can fetch the approvers form these custom tables and populate the approver_table...this is a suggestion..

Regarding the BBP_WFL_DIN_APP_OBJ_GET,i have implemented the header level WF for SC approval tru the BADI but i dont think we have to specifically pass anything to this...If all ur configuration,BADI logic and OSS notes(if any) hs been done correctly,then teh WItem should go properly to the respective Approvers at the item level too.

HTH.

BR,

Disha.

Pls reward points for helpful answers.

Former Member
0 Kudos

Hi Sy,

I have done Item level approval depending on the material.

If you need approval only on material. Can create a new attibute in the org structure names responsible material.

then fill this for each respective approval of Category.

Now in the BADI find out the person responsible for the particular product and fill in the 'approval_table' 'item_approval_table' and 'item_approval_obj'.

you will have to loop into the item table, which you can get using FM BBP_PD_SC_GETDETAIL.

For each item use FM BBP_WFL_DIN_APP_OBJ_GET , here the VALUE1 will be your category (material). So this FM will return you the same ITEM_APP_OBJ for same material.

Now depending on this you can fill all 3 tables I told before.

Now if the ITEM_APP_OBJ is same for 2 items and approver also then those Item will go to the same person.

I think this is good enough to start now....

Aslo there are some example BADI for Item level WF. look into that

Let me know if you need more details.

Regsrds,

Smita

Pls reward points for helpful answers.

Former Member
0 Kudos

Hi Smita,

How do I create this? is it in PPOMA_BBP? or what? Thanks

If you need approval only on material. Can create a new attibute in the org structure names responsible material.

Thanks!

Former Member
0 Kudos

Please help.

I've tried to populate TABLE bbpt_wfl_lia_def..Used the recommended FUNCTION MODULE BBP_WFL_DIN_APP_OBJ_GET

but i am still encountering "no workflow was found" But if the amount is less than 100,000, it has 1 level approver. BUT the items are still on the header level not item based. PLEASE help

have this code but was not able to give the correct result.

TABLE BBPT_WFL_LIA_DEF

CRIT_NAME1 CRITVALUE1 AGENT1 AGENT2 AGENT33

LOW 50000019 50000042

LOW 50000032 50000050

MEDIUM 50000019 50000042 50000077

MEDIUM 50000032 50000050 50000077

HIGH 50000019 50000042 50000077 5000076

HIGH 50000032 50000042 50000077 5000076

CRITVALUE1= ORGUNIT ID

AGENT1 = User ID of Approver

AGENT2 = User ID of Approver 2 levels

AGENT3 = USER ID of approver 3 levels

*

ZPOPULATE_LT_APPR_DEF'

SELECT * FROM bbpt_wfl_lia_def

INTO CORRESPONDING FIELDS OF TABLE lt_appr_def.

LOOP AT lt_item INTO ls_item WHERE del_ind IS INITIAL.

IF ls_item-ordered_prod is initial. "NS

                                                • NS

CALL FUNCTION 'ZPOPULATE_LT_APPR_DEF'

TABLES

LT_APPR_DEF = lt_appr_def.

ls_approval_item-approval_item_guid = ls_item-guid.

MESSAGE actual_approval_index TYPE 'I'.

IF actual_approval_index LE 1.

CLEAR ls_item_app_obj.

ls_item_app_obj-sc_guid = ls_header-guid.

IF ls_item-value <= 200000.

lv_call_crit1 = 'LOW'.

ELSEIF ls_item-value > 200000 and

ls_item-value <= 1000000.

lv_call_crit1 = 'MEDIUM'.

ELSE.

lv_call_crit1 = 'HIGH'.

ENDIF.

  • lv_call_crit1 = c_org_unit.

lv_call_value1 = ls_orgdata-proc_group_id.

  • if actual_approval_index LE 1.

CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'

EXPORTING

sc_guid = ls_header-guid

criterion1 = lv_call_crit1

value1 = lv_call_value1

IMPORTING

approval_obj_guid = ev_app_obj_guid

TABLES

item_app_obj = item_approval_obj.

ls_approval_item-approval_object_guid = ev_app_obj_guid.

APPEND ls_approval_item TO lt_approval_items.

if lv_call_crit1 = 'MEDIUM'.

CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'

EXPORTING

sc_guid = ls_header-guid

criterion1 = lv_call_crit1

value1 = lv_call_value1

iv_item_value = ls_item-value

iv_add_value = 'X'

IMPORTING

approval_obj_guid = ev_app_obj_guid

TABLES

item_app_obj = item_approval_obj.

ls_approval_item-approval_object_guid = ev_app_obj_guid.

APPEND ls_approval_item TO lt_approval_items.

endif.

if lv_call_crit1 = 'HIGH'.

CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'

EXPORTING

sc_guid = ls_header-guid

criterion1 = lv_call_crit1

value1 = lv_call_value1

iv_item_value = ls_item-value

iv_add_value = 'X'

IMPORTING

approval_obj_guid = ev_app_obj_guid

TABLES

item_app_obj = item_approval_obj.

ls_approval_item-approval_object_guid = ev_app_obj_guid.

APPEND ls_approval_item TO lt_approval_items.

endif.

ELSE

--to be implemented

ENDIF.

Former Member
0 Kudos

Hi sy,

Have you activated the start condition for the item level WF? tocde SWB_COND here you need to activate for WF Item-Based Main WF. Give your condition on which it should trigger the Item level WF.

To create attribute u will have to maintain in table T77OMATTR. Send me your email id I have a document on it which Tracy shared with me.

I suggest you to closely study the example Implementation on Item level WF.

Also do u need to maintain data in bbpt_wfl_lia_def. Can't you directly try to get the approvers from org structure. In that case your WF will be more flexible.

Regards,

Smita

Message was edited by: smita kumar

Former Member
0 Kudos

hi smita,

[Removed by the moderator.]

Yep my start conditions are already activated.

Hopefully you can share your documents for these. Thank you so much.

Case Sy

Former Member
0 Kudos

Hi I've received your file but it was corrupted

I copied the sample implementation of

BBP_WFL_DIN_ITEM_APPROVAL_GET.

Currently the problem I'm encountering is that Item level was ok when SHC is created.

2 problems am encountering that is a stopper.

2 items being tested per SHC.

once created (2level and 3 level) - ok

1st approval logged in (2level shown as 3 level (2level plus 1st level on the next item) and 3 level becomes one level thus this 1st level is incorporated in the 1st item) therefore once opening the next item, am encountering a rabax state problem

Seems that an item once approved approves the whole shopping cart.

Note: i have checked OOCU for subworkflow parallel approver.

Pls pls help. Thanks!

Former Member
0 Kudos

Hi sy,

It seems there is some prob in your BADI coding. Have you checked it in debugging when you create SC. then go to approval preview at that time it will go in BADI check your data.

Now when you do 1st level of approval then also it will go in BADI ans so on. try to check there is some prob of approval index

Also for each step what is the data passing to WF u can check in SWI1 tcode. See in the workitem container for each step.

hope this will help

regards,

Smita

Pls reward points for helpful ans.

Former Member
0 Kudos

Hi Smita,

How can I check it in debugging when I create SC?

I have created 3 items per SHC. each having different levels of approver,

1st 2 is ok maybe its because they both have Product ID, but on the 3rd item which normally dont have product ID, the WFL after save was not correct. I've tried to create the 3rd item fon another SHC but only having that item, it worked fine.

Another problem is that once I approve any of the items on the first level, the whole shopping cart is automatically set to approved. But I require to have it n-level base approval per Item. and not parallel based per item

Is this possible? I've checked the WFL WS14500015 but it seems that it has parallel approval per item?

Many thanks!

Case

Former Member
0 Kudos

Hi sy,

I think you should debugg and you will be able to find out the problem in your coding.

Just keep in mind everything you need to handle through code.

see these two threads for setting the debugger

Put debugger in services BBPSC01, BBPSC02 and BBPSC03

Hope this will help.

Regards,

Smita

Pls reward points for helpful ans

Answers (0)