on 2006 Jan 06 7:27 PM
Hi,
Can you please tell me <b>is there any BAdi avaliable for ITEM LEVEL SHOPPING CART APPROVAL</b>? If is kindly give me an overview about that please
Thanks,
Kannan.
Durai,
Just to let you knowto every contribution that answers your question...you should be assigning points to it.I can see that you have not assigned points to anybodyJay,Vadim,Christophe and others have been extremely helpful.
The least you can do is award them the points appropriately.
Thats the motivation-and one needs to respect their time and suggestions by assigning points to them.
Hope you understand my point.
Thanks
Priya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Priya,
No, i gave points to all priya. i don't know how did you came to know i don't give. no priya. i gave.
this is very good form. as a beginner i got lot of ideas with help like you.
if you find any think wrong from my side , please let me know , i'll correct that.
if you find i don't give points for any body please friend let me know , i'll do that.
request,
please friends answer my coming questions. that will help me very lot.
thanks,
durai.
Hi Durai,
You should read what Priya has mentioned. Thanke Priya.
Ok, coming to your question, I am not sure you looked at the BADI Sample Code, Here is that, i had put my remarks in there with my name Jay where you should focus.
METHOD if_ex_bbp_wfl_approv_badi~get_remaing_approvers.
This a default implementation that gives idea about of how line item
approval should work
DATA:
ls_header TYPE bbp_pds_sc_header_d,
tables for different approval criteria
lv_call_crit1 TYPE bbp_wfl_app_criterion,
lv_call_value1 TYPE bbp_wfl_app_property,
local help variables
lv_guid TYPE crmt_object_guid,
item fields and structures
ls_item TYPE bbp_pds_sc_item_d,
lt_item TYPE TABLE OF bbp_pds_sc_item_d,
accounting structures
ls_account TYPE bbp_pds_acc,
lt_account TYPE TABLE OF bbp_pds_acc.
DATA: ls_approver TYPE bbp_wfl_approval_table_badi.
Business objects (local)
CONSTANTS:
c_po TYPE crmt_subobject_category_db VALUE 'BUS2201',
c_shop TYPE crmt_subobject_category_db VALUE 'BUS2121',
c_contract TYPE crmt_subobject_category_db VALUE 'BUS2000113'.
.
Approval Criteria and properties used (local)
CONSTANTS:
c_cost_centre TYPE bbp_wfl_app_criterion VALUE 'COST_CTR',
c_prod_categ TYPE bbp_wfl_app_criterion VALUE 'PROD_CAT'.
CASE object_type.
WHEN c_shop.
----------- shopping cart ---------------------------------- *
get the details of the shopping cart
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
i_object_id = object_id
I_WITH_ITEMDATA = 'X'
IMPORTING
e_header = ls_header
EV_IS_PD =
ET_ATTACH =
TABLES
e_item = lt_item
e_account = lt_account
E_PARTNER =
E_ORGDATA =
E_TAX =
E_PRIDOC =
.
Jay - you decide here that what approval it should start first.
First Level Approval.
In this case, they are starting with approval based on cost center in SC Line items.
Values in changing parameters will decide which item to go to which approver based the cost center the approvers are responsible for.
1st approval step executed for indices 1 and 0
IF actual_approval_index LE 1.
First approval step (cost center based)
LOOP AT lt_item INTO ls_item WHERE del_ind IS INITIAL.
We consider only items, which are not deleted (del_ind = 'X')
Found out to which cost center this item belongs
READ TABLE lt_account INTO ls_account
WITH KEY p_guid = ls_item-guid.
IF sy-subrc = 4.
MOVE 'OTHERS' TO lv_call_value1.
ELSE.
MOVE ls_account-cost_ctr TO lv_call_value1.
ENDIF.
Call your own customers function to found the approver of this item
based on your own customizing table/RFC.
The function BBP_WFL_DIN_ITEM_APPROVAL_GET is only an example
for implementing this.
CALL FUNCTION 'BBP_WFL_DIN_ITEM_APPROVAL_GET'
EXPORTING
sc_guid = ls_header-guid
item_guid = ls_item-guid
approval_index = '1'
approval_description = 'Cost center approval'
each cost center approver should see only items he is responsible
hide_items_not_responsible = 'X'
criterion1 = c_cost_centre
value1 = lv_call_value1
CRITERION2 = ''
CRITERION3 = ''
VALUE2 = ''
VALUE3 = ''
CHANGING
approval_table = approval_table
item_approval_table = item_approval_table
item_approval_obj = item_approval_obj
.
ENDLOOP.
ENDIF.
Jay - you decide here that what should be second level approval.
In this case, they are following the approval based on product category in SC Line items.
Values in changing parameters will decide which item to go to which approver based on the product category the approvers are responsible for.
2. approval step executed for indices 2,1 and 0
IF actual_approval_index LE 2.
IF ls_header-total_value GE 510000000.
LOOP AT lt_item INTO ls_item WHERE del_ind IS INITIAL.
We consider only items, which are not deleted (del_ind = 'X')
Set the product category
MOVE ls_item-category_id TO lv_call_value1.
Call your own customers function to found the approver of this item
based on your own customizing table/RFC.
The function BBP_WFL_DIN_ITEM_APPROVAL_GET is only an example
for implementing this.
CALL FUNCTION 'BBP_WFL_DIN_ITEM_APPROVAL_GET'
EXPORTING
sc_guid = ls_header-guid
item_guid = ls_item-guid
approval_index = '2'
approval_description = 'Product approval'
each product category approver should see all items
hide_items_not_responsible = ''
criterion1 = c_prod_categ
value1 = lv_call_value1
CRITERION2 = ''
CRITERION3 = ''
VALUE2 = ''
VALUE3 = ''
CHANGING
approval_table = approval_table
item_approval_table = item_approval_table
item_approval_obj = item_approval_obj
.
ENDLOOP.
ELSEIF actual_approval_index EQ 2.
don't process 2nd step if shopping cart value is less than 510000000
no_further_approval_needed = 'X'.
ENDIF. " value more than 510000000
ENDIF.
now fill the approval_table
IF actual_approval_index GE 3.
this BADI-implementation defines 2 steps
no_further_approval_needed = 'X'.
ELSE.
IF approval_table[] IS INITIAL.
if no approver found because send sc to default administrator
ls_approver-approval_index = actual_approval_index.
the agent is 'US' + user
ls_approver-approval_agent = 'USADMNIN1'.
ls_approver-name = 'Peter Admin'.
APPEND ls_approver TO approval_administrators.
ENDIF.
ENDIF.
ENDCASE.
ENDMETHOD.
Pls keep im mind that you will one or more or no approvers in every level. It could be parallel or sequential. SAP delivers standard workflow definition for both parallel or sequential.
In your case, you do not need first level approval. So, You do not need the codes involved for first level. Use the code involved for second level.
Again, it is sample code, pls treat this is a pseduo to drive your logic.
Good Luck.
Regards,
Jay
Hi Jay,
<b>sorry to ask, you mean i don't give points for your past great suggestions? please let me know jay, because i gave points to all, that is why.</b>
ok let us come to topic.
jay.
as your sample coding i need to go through from step 2, ok , i'll do that, but before i go through that please give me your ideas about below one.
<b>*** Call your own customers function to found the approver of this item
based on your own customizing table/RFC.</b>
The function BBP_WFL_DIN_ITEM_APPROVAL_GET is only an example
for implementing this.
CALL FUNCTION 'BBP_WFL_DIN_ITEM_APPROVAL_GET'
EXPORTING
sc_guid = ls_header-guid
item_guid = ls_item-guid
approval_index = '2'
approval_description = 'Product approval'
each product category approver should see all items
hide_items_not_responsible = ''
criterion1 = c_prod_categ
value1 = lv_call_value1
CRITERION2 = ''
CRITERION3 = ''
VALUE2 = ''
VALUE3 = ''
CHANGING
approval_table = approval_table
item_approval_table = item_approval_table
item_approval_obj = item_approval_obj
endloop.
<b>i hope you can see bold letters above, what is that mean, do i need to write coding in that block.</b>
<b>say for example i have a 'z' custom table which is having PRODUCT CATEGORY,APPROVAL ID , NAME AND ETC..
my scenario is based on the product category workitem should send for approval.
take this above scenario and explain me how should my coding please. if you need any thing please let me know i'll explain my scenario breifly.</b>
please jay,
thanks,
durai.
Hi,
I am very new to EBP and SRM, so please forgive me if I ask the obvious or ask a question that has already been asked on this forum. Any hint, help or suggestion is appreciated.
We are trying to develop an implementation the BBP_WFL_APPROV_BADI for item-level n-step approval.
In the example BAdI SAP provides they have a FUNCTION 'BBP_WFL_DIN_ITEM_APPROVAL_GET'
'BBP_WFL_DIN_ITEM_APPROVAL_GET'
EXPORTING
sc_guid = ls_header-guid
item_guid = ls_item-guid
approval_index = '1'
approval_description = 'Cost center approval'
hide_items_not_responsible = 'X'
criterion1 = c_cost_centre
value1 = lv_call_value1
CHANGING
approval_table = approval_table
item_approval_table = item_approval_table
item_approval_obj = item_approval_obj.
ENDLOOP.
What values do you enter/populate the tables 'approval_table', 'item_approval_table' and 'item_approval_obj'?
Here is the parameter definition for the BAdi
OBJECT_ID Transaction Number  I assume this is the Shopping Cart number
OBJECT_TYPE Business Transaction Category  BUS2121 (for SC)
GUID Globally Unique Identifier in 32-Character Display
I dont know what I enter for the rest of the fields.
ACTUAL_APPROVAL_INDEX Current Approval Step
APPROVAL_HISTORY_TABLE Table for Approval History for BADI
ITEM_APPROVAL_HISTORY_TABLE Old Assignment of Items to Approval Objects
DELETE_REJECTED_ITEMS Single-Character Indicator
IN_UPDATE General Flag
APPROVAL_TABLE Table of Approval Steps and Approvers
APPROVAL_ADMINISTRATORS Administrators for Missing Approvers
ITEM_APPROVAL_TABLE New Assignment of Items to Approval Objects
NO_FURTHER_APPROVAL_NEEDED Boolean Variable (X=True, -=False, Space=Unknown)
ITEM_APPROVAL_OBJ Assignment of Approval Objects to Approval Criteria
The definition of table APPROVAL_TABLE is:
APPROVAL_INDEX
APPROVAL_BRANCH
APPROVAL_AGENT
NAME
APPROVAL_DESCRIPTION
APPROVAL_OBJECT_GUID
HIDE_ITEMS_NOT_RESPONSIBLE
I dont know what to enter in the fields in table APPROVAL_TABLE and table ITEM_APPROVAL_TABLE.
My understanding is that to implement item-level n-step approval, I only need to fill these tables correctly. The Workflow will handle the rest. Is this conclusion correct?
Thanks in advance,
Naing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have also a problem with regards on implementing item based approval.
I have populated the APPROVAL_TABLE.
When i tested it, the Items in shopping chart has already have levels i have specified on. Problem being is that the request doesnt send approval request to the necesary person. I also do not see this in the approval workflow per item who is responsible.
I am thinking that because I have not called BBP_WFL_DIN_APP_OBJ_GET.
My requirement is that
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
What should I include in calling BBP_WFL_DIN_APP_OBJ_GET?
What's the use of ACTUAL_APPROVAL_INDEX?
Thank you so much!!
Cindy Sy
cindyaimeesy@yahoo.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Disha,
Thank you so much for replying. But your reply wasnt that to helpful because you return it with a question thus does not directly answer the question.
yes I have implemented BBP_WFL_APPROV_BADI
Because, I initially created approval for PO and Contracts only having header n-level approval of the whole PO/Contract reading only the header level.
But for Shopping Cart, The requirement involves item based. I have read the sample implementation code but is still clueless on 2 items which is what to pass the BBP_WFL_DIN_APP_OBJ_GET
and what does ACTUAL_APPROVAL_INDEX stands for, when does the value = 2 and more.
Hopefully I can get a light on this
Thanks!
Hi,
Through the BADI you are just passing the Approvers names/user names by populating the table "approval_table".
"actual_approval_index" represents the current WF approval step.
SO the max no of levels can be decided by you and accordingly at each level you can decide who should be the approver as well the no of approvers at each approval step.
BR,
Disha.
Pls reward points for helpful answers.
Hi,
we've implemented BADI for n-step approval, we've also defined a organizational structure for approver determination, and rules for approve requirement in PFAC. In the beginning we want parallel approval, but know there is a specific requirement to have sequential approval.
I've thought this would be possible changing lv_index to the number of steps we need, for example, 3 if it is required the sequential changing of 3 different users. However,this doesn't solved my problem, all the users are determined at the same time, and if one approves the SC get the status approved.
Can any of you help me solving this issue?
Thanks,
Ana
Kannan,
Yes, there is a BADI BBP_WFL_APPROV_BADI for ITEM LEVEL SHOPPING CART APPROVAL. There is a consulting OSS Note 731637 give detail overview of how to use ITEM LEVEL SHOPPING CART APPROVAL workflow using this BADI.
Good Luck.
Thanks,
Jay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your response. have you done Item level approval Workflow ? if yes kindly give me some ideas to start work for Shopping Cart Workflow.
I have gone through the OSS Notes which you gave , but i am new and start from the first. so if you have some documents and screen shots please let me know i'll tell my mail id.
please i hope you will do this.
thanks once again.
thanks,
kannan.
Hi,
I have found a standard workflow for item level SC approval. but can you please tell me how to implement, not workflow but BAdi?
what are you steps i need to carry out to make my workflow active and work after i done BAdi Implement.
can you please give me brief idea about that please.
thanks
Hello Durai,
First you have to make your own BADI implementation (what you've done as I understand)
Then activate the method (your ABAP code), AND the BADI implementation (the magic stick on the BADI implementation screen).
Now you have to manage the starting conditions to have the n-step WF started for all your SC. To do so goto the WF starting conditions definition for the SC and only activate the starting condition for the n-level on item level WF (WS145000015) with a condition like 'doc.type = BUS2121' for it to be true for all SCs.
Regards.
Vadim
Hi Vadim,
i think ur the only person who already implemented n-step item level approval workflow.
please help me. my requirement is based on the material group work item should send for approval.
Example
if SC has 5 line items which is split into two material group ( first three items are same material group and two another items are different material group ), according to this scenario how can i implement that BAdi.
please give me some example coding based on the above scenario.
please this is very urgent one. help me man.
Thanks,
Durai.
Hi Vadim,
i have given below all parameters in that BAdi.
<b>Method Name :</b>
GET_REMAING_APPROVERS
<b>Importing Parameters :</b>
: OBJECT_ID type CRMT_OBJECT_ID_DB ( 10 Char )
: OBJECT_TYPE type CRMT_SUBOBJECT_CATEGORY_DB( 10 Char )
: GUID type BBP_GUID_32 ( Char 32 )
: ACTUAL_APPROVAL_INDEX type SWH_NUMC10 ( Numr 10 )
: APPROVAL_HISTORY_TABLE ( This is structure has 6 fields )
APPROVAL_INDEX component type SWH_NUMC10 ( numc 10 )
APPROVAL_BRANCH component type SWH_NUMC10 ( numc 10 )
APPROVAL_AGENT component type SWP_AAGENT ( char 14 )
NAME component type SWL_AAGT_N ( char 40 )
INITIAL_AGENT component type SWP_AAGENT ( char 40 )
TYPE component type BBP_APPROVER_TYPE ( char 1 )
: DELETE_REJECTED_ITEMS type char1 ( char1 )
<b>Exporting Parameters : </b>
:APPROVAL_TABLE ( This is structure has7 fields )
APPROVAL_INDEX component type SWH_NUMC10 ( numc 10 )
APPROVAL_BRANCH component type SWH_NUMC10 ( numc 10 )
APPROVAL_AGENT component type SWP_AAGENT ( char 14 )
NAME component type SWL_AAGT_N ( char 40 )
APPROVAL_DESCRIPTION component type BBP_STEP_DESCRIPTION ( char 20 )
APPROVAL_OBJECT_GUID component type BBP_GUID_32 ( char 32 )
HIDE_ITEMS_NOT_RESPONSIBLE component type BOOLEAN ( char 1 )
: APPROVAL_ADMINISTRATORS ( This is structure has7 fields )
APPROVAL_INDEX component type SWH_NUMC10 ( numc 10 )
APPROVAL_BRANCH component type SWH_NUMC10 ( numc 10 )
APPROVAL_AGENT component type SWP_AAGENT ( char 14 )
NAME component type SWL_AAGT_N ( char 40 )
APPROVAL_DESCRIPTION component type BBP_STEP_DESCRIPTION ( char 20 )
APPROVAL_OBJECT_GUID component type BBP_GUID_32 ( char 32 )
HIDE_ITEMS_NOT_RESPONSIBLE component type BOOLEAN ( char 1 )
: ITEM_APPROVAL_TABLE ( This is structure has 2 fields )
APPROVAL_OBJECT_GUID component type BBP_GUID_32 ( char 32 )
APPROVAL_ITEM_GUID component type BBP_GUID_32 ( char 32 )
: NO_FURTHER_APPROVAL_NEEDED type BOOLEAN ( char 1 )
<b>Changing Parameters </b>
:ITEM_APPROVAL_OBJ ( This is structure has 8 fields )
SC_GUID component type BBP_GUID_32 ( char 32 )
APP_CRIT_NAME1 ( char 10 )
APP_CRIT_NAME2 ( char 10 )
APP_CRIT_NAME3 ( char 10 )
APP_CRIT_VALUE1 ( char 32 )
APP_CRIT_VALUE2 ( char 32 )
APP_CRIT_VALUE3 ( char 32 )
APPROVAL_OBJECT_GUID ( char 32 )
i hope this is ok for you , if you want any thing else please let me know . i'll do it. please help me.
thanks,
Durai.
Hi Durai,
As mentioned by Vadim, follow the navigation steps, there is a sample implementation. If you know ABAP, you will be able to immediately pick up looking at the code.
Line item worklfow is purely ABAP Driven. Put your logic in your own implementation and configure start condition and activate event linkage.
Good Luck.
Regards,
Jay
Hi Durai,
In the BADI you have to implement your own ABAP code in order to fill the tables <b>APPROVAL_TABLE</b> and <b>ITEM_APPROVAL_TABLE</b>. The example implementation given by SAP will help you a lot in your own development, it gives good vision of what to do.
If you give us your functional need, we may give you some clues on your development.
Regards.
Vadim
Hi,
Thanks for your response. i have couple of clarifications.
<b>1 ). In the Standard Workflow ( WS14500015 ) doesn't have start condition so, do i need to create start condition?
2 ). i have seen sample coding in SE18 . but my part is n-step approval so, how should be coding , if it's one-step or two-step approval ok we can hard code the approval user name , but n-step means how do i need to write code in that Standard BAdi ( BBP_WFL_APPROV_BADI )?</b>
please help me out.
<b>i just started so i'll ask couple of questions in feature , so don't get ten'n even if it's basic doubts please gurus.</b>
thanks,
Durai.
Hi Durai,
Basically, you need to populate i think APPROVAL_AGENT table the Export parameter of the BADI with approval Agent.
You will decide what type of approvals you need like eg., Functional, Financial and Spend Limit for Shoppping Cart in what order, in that order you will go on append the APPROVAL_AGENT table with approvers ID.
Eg., If you populate the table with 10 Approvers, Then 10 step aproval. SC will go thru Approval process one after another till tenth approver.
In runtime, a SC will have one or more or no approval based SC Data and how you handle in the BADI. That is why it is called n-step means.
I think You should take look at sample implementation.
Regards,
Jay
Hi,
1) This is a basis for all WFs: <b>YOU MUST ACTIVATE EVENT LINKAGE AND MANAGE STARTING CONDITION FOR ALL THE WFs YOU WANT TO USE</b>
2)For this, I can give you sample code, but please be more precise on what you want. Are you only looking for hierarchical approval, or do you need any other functional approver ?
Regards.
Vadim
Hi,
my scenario is based on my product category workflow needs be trigger.
for example ,
<b>SC has 5 items, first three items are belongs to 'XXXX' product category remaining two items are belongs to 'YYYY' product category.</b>
<b>If XXXX product category means work item should be send to manager1,manager2,manager3.
if yyyy product category means work item should be send to manager4,manager5.</b>
now how should be my coding in BAdi, and for this scenario do i need to set starting condition?
please gurus give me your great suggestion
thanks,
Regards,
Durai.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.