Extending of Two Step Approval WF (WS10000031) up to four steps
Hi Experts,
I try to extend the WS10000031 WF by copy of second step (TS10008127 2nd approval task in two-step approval of SC) as 3th and 4th step. The WF starts without problem and works until 3th step. User can't execute this step because of error generated on web side and short dump in ST22.
Is the above described ides correct?
Thanks in Advance
Adam
SAP recommends the custmers to use N-STEP badi , if you have approver levels greater than two.
Similar Messages
-
Is N level workflow in SRM suitable for BRF rather than the two step approv
Could anybody give some information about N level workflow in SRM abt whether it is more suitable for BRF (business rule framework) for agent determination rather than the two step approval workflow ?
Hi Rita,
BRF is process level configuration. You will have to define a schema and it will be tied to a Business object (say BUS2121). Schema consists different process steps. Each process step can be tied to a work flow (Task id). So, it doesn't matter whether 2 step or N step WF in BRF for the process step. Agent determination will happen regardless.
Regards,
DV -
SC 1-step approval with Deadline
Hi Folks,
Is there any standard workflow for SC 1-step approval with deadline escalation?
I found 10400047 Two Step Approval with Deadline but can not find a 1-step.
I tried to extend the standard 1-step to include deadline without succes.
Is there anything I have to pay attention to?
Thanks in advance,
ThomasHi,
You can copy WS10400047 and delete 2nd approval step.
Transaction PFTC_COP, PFTC_CHG and SWDD.
Regards,
Masa -
Hello all,
I have a problem where user is holds first and second level approval position in hierarchy. Shopping cart with two step approval (WS10000031). Starting condition is that user do not belongs to approver group.
Example:
ORG1 - approver USER1
subordinates of ORG1
ORG2 - approver USER1, requestor EMP1
ORG2 - approver USER2, requestor EMP2
Case1:
requestor is EMP2 approvers are:
frist step USER2
second step USER1
Case2:
requestor is EMP1 approvers should be:
first step USER1
second step USER1 (again).
Of course workflow cannot set USER1 as second step approver in case2.
How this can be achieved, or is there any other solution (i.e. change in starting conditions)
TIA
GordanHello Pierre,
I am aware of limitations in note 683782, and this is not possible if you are trying to do it manually. But I made it possible via ALE with HR. I do not know if this is bug or feature in the system :o))).
In HR it is possible that user belongs to several positions (based on percentage) and this is correctly transferred to SRM 4.0 (EBP 5.0).
I can even post a picture somewhere if you would like to see or mail it to you. :o)))
We are starting with HR integration which will send positions and users with infotype 0105/0001 to create BPs and EBP users.
For now, with manual org structure, we are using copied users as forwarding agents, but after integration start this will not be possible anymore because all of the settings coming from HR to SRM.
Gordan -
Function module (FM) to read budget to be used in n-step approval badi
We have SRM 5.0 with ECC 6.0 (extended classic). For capital expenses we are going to have budget check in SRM based of account assignment internal orders in R/3. In shopping cart line item approval workflow, it is required to read the budget available for that internal order and compare with shopping cart value...what is the function module to read budget assigned to that internal order, that will used in n-step approval badi at every step??
Thanks,
Kim r.Hi
<b>Please try the related SRM function modules, which will definitely help -></b>
B470_BUDGET_READ
BBP_PD_USER_BUDGET_AMOUNTSPENT
BBP_PD_USER_BUDGET_CHECK
BBP_PD_USER_BUDGET_DEFINED_GET
BBP_PD_USER_BUDGET_SAVE
BBP_PD_USER_BUDGET_SCVALUE_GET
BBP_REQREQ_CHECK_BUDGET
META_BUDGET_READ
META_BUDGET_READ Function module in turn calls RFC-enabled 'BBP_BUDGET_READ' Function module in the R/3 or the ECC System.
Hope this will definitely help.
Do let me know.
Regards
- Atul -
Leave Request two layer approval
Dear Experts,
I'm trying to implement two layer approval leave request workflow by copying and modifying standard workflow WS12300111.
I follow the guide from this link:
http://wiki.sdn.sap.com/wiki/display/ERPHCM/CustomizingtheESSLeaveApprovalusingBusiness+Workflow
My workflow step is as follow:
1. first approver has approve the request
2. reset req object status to SENT
3. set next approver using method if_pt_req_request->set_next_processor
4. send the request to the second approver
I have implement badi PT_GEN_REQ to set first approver (method IF_EX_PT_GEN_REQ~FIND_RESP_AND_DEFAULT_NEXT_PRC) so that the first approver name shown correctly when requestor create the request.
Now there are 3 problems I'm facing:
1. After the FIRST approver approve the request, the note he input is shown twice. I found out this is because the status change create new version of the document. I have tried to clear this note when changing the status using method if_pt_req_request->set_notice. However, the method ignore if the notice is set to blank. Is there anyway to hadle this?
2. When SECOND approver reject the request, I want the request to be revised by the requestor, and then forwared to FIRST approver after that. For this purpose, before send the workitem to requestor back, I put step to set approver back to FIRST approver again using method if_pt_req_request->set_next_processor. But it seems this doesn't work and the request is sent to SECOND approver after revised. The supervisor name that is shown when requestor revise the request also show the SECOND approver name instead the FIRST approver.
3. I find difficulties to create email notification if the request is changed by the requestor during approval process, since there are no event triggered. Is there anyway to trigger this event or is there any workaround?
Thank you.
Regards,
PontyHi Ponty,
I am trying to implement two layer approval for leave request, too.
I took a copy of standard WS12300111 as you did.
I followed the guide, you mentioned. For one level approval this works nearly out of the box.
But I don't understand the second half of the guide.
For me it will be the first time to implement a BAdI. I never did this before.
Can you please explain me, how to do it and how you enhanced the workflow for two layer approval?
Some screenshots might be useful. Eventually you can enhance the guide you mentioned.
Regarding the numerous questions on multi level approval, these hints might be useful for a large number of users.
I would be very happy, If somebody can help me, becaus I didn't know any workflow experts who can help me implementing the BAdI.
Thank you. -
Two level approval in workflows
Dear All,
I am making a workflow which trigger when the Maintenance Order get RELEASED, the functionality of the workflow is as follows :-
1. A recipient should get workflow in his/her SAP inbox for Approval or Rejection of maint. Order. release.
2. When he approves then the maint. Order should go to Second Recipient for firther Approval.
3. After the second approval the workflow Initiator get the main that his request has been approved.
4. At any point if the approver rejects his Request the application should get back to Workflow Initiator.
Now my first problem is that how can i make the logic for the two level approval.
What i have done is that i have taken one decision Step with the Outcomes
Approve
Reject
On the approve outcome i have added another Decision Step for second approval but htis is not working.
My Second Problem is how can i know that the request has been approved or not. Is there any status Field from where i can know that the request has been approved or not so that i can use condition step.
Please help as i m struck beacause of these two problems.
Thanks!!!!> On the approve outcome i have added another Decision Step for second approval but htis is not working.
>
Up until this point I was very happy with your explanation, it was thorough, and included the functional need. However, it is quite important to know <u>how</u> 'it is not working'. Are you getting an error when you try to activate the workflow? Is the workflow going to ERROR status during runtime after the first approver has approved? Is there perhaps an error message? Someone might recognize that error message and say 'yes, I had this problem once, and here's how you fix it'. -
Two level approval workflow not working
Hi Experts,
I am making a workflow which have two level approval , now the problem is that the first level approver is going only to workflow initiator and if I use any other ID it is not working , it just hangs there.
Secondly if I send the first approval to workflow Initiator and it approves it then it hangs with second decision step.
I have made the agent assignment as general task. I have also checked SWU3 and all the things in that are activated.
Kindly help me in this issue.
Edited by: Rachit Khanna on Aug 19, 2009 9:51 AMDear Rachit,
There is a dedicated forum for Workflow i.e. SAP Business Workflow
Post your thread there, you will get fast response.
I can suggest you one thing check the agent assignment is done or not
Regards,
Chandra -
1 step approval good receipt with different Good Recipient
Hi gurus,
We have implemented SRM 5.5 (SAPKIBKT09).
We are using standard WF's for goods receipt:WS10400002 1 step approval + WS10400010 Goods receipt without approval. This WF is working perfectly since using shop on behalf.
Managers don't want to create any shopping cart neither confirm them. So, EMPLOYEE creates a shopping cart on behalf MANAGER throught Screen "Shopping Cart Full Functionallity" selecting "MANAGER" in field SHOP FOR and "EMPLOYEE" in field good recipient.
After PO creation, Goods receipt without approval is working because EMPLOYEE is able to confirm the SC.
However, when there is an internal dispacther that confirms and the 1 step approval WF is triggered, the item is going to MANAGER inbox, not EMPLOYEE's. Remember that the good recipient is the EMPLOYEE not the MANAGER, the MANAGER is only the Requester.
Do you know why this is not working?
Many thanks!
Regards
PatríciaChriastian,
It is possible only by using split valuation or by creating two different material master.
Sorry i could not found any other way.
Regards,
Manish -
How to determine N Step Approval process through Process Controlled workflow
HI
For SC approval process after 4th level of approval the workflow keep go N step till the approval determine. If no approval find then go for WF Exceptions.
In PCW we have process level like 100, 200, 300 and so on. What would be the procedure for Nth process level determination in SRM process controlled workflows settings.
Regards
KharabelaHi,
From SRM 7.0 PCW, requestor of SC or creator(buyer) of the PO can't be in the approval list.. this is standard...
create two custom events like zev_po_schema_eva and zev_po_sl_approval
create two custom expression.. one with constants as zev_po_schema_def and other one is formula interpreter(0FB001)..
assign zev_po_schema_eva as schema evaluation for PO.. MAKE SURE YOU LINK THE zev_po_sl_approval
with as zev_po_schema_def..
now create schema definition entry and specify as zev_po_schema_def..
now create process level
100 approval / approval with completion ( Your chooice ) .. maintain zev_po_sl_approval as evaluation id in the process level... maintain RR_SPENDING_LIMIT_APPROVER as Resp.Resolver...
maintain formula interperter value as (OV_SC_PREVAPPROVALIMI < 0V_PO_POTOTALVALUE ) AND (OV_SC_SPNDNGLMTFRQST < 0V_PO_POTOTALVALUE).
Saravanan -
About N-step approve for SC item issue
Dear all,
We used application controll workflow,And active the WS14500015 N-step approve for SC item,and imp the BADI,Now our issue:
SC have two items,there are approve step:
item1 approver01 approver02 approver03 3 step approve,
item2 approver11 approver12 2 step approve.
When order the SC,user approver01 can receive the task about item1, user approver11 can receive the tast about item2,Now user approver01 approve his task,if user approver11 didn't approve his task,then about item1's workflow will hold it,the system didn't triger the next step to user approver02,if user approver11 approve his task,then item1 's workflow triger the next step to user approver02 and item2's workflow tiger the next step to user approver12.
who can help me,why the system flow this logic?
We need the logic's :user approver01 approve his task,if user approver11 didn't approve or did approve his task,then about item1's workflow allways triger the next step to user approver02.
Edited by: bill yang on Apr 29, 2011 2:45 PMHi,
It is designed that way.
When item 2 is rejected, requester may want to change item 1. So WF should wait for creating next level workitem until all items are rejected/approved.
Regards,
Masa -
N-step approval process for PO in SRM 7
Here are a couple of questions I have regarding N-Step approval configuration for PO in SRM 7 Process Controlled Workflow:
1) It's our business requirement that the last-change person of the PO is defined as the first approver in the chain. I tested with RR_EMPLOYEE and a hard-coded user BP number (my own), but got error "Strategy RR_EMPLOYEE did not determine any approver". Changing to any other user's BP number worked. So I am guessing the buyer himself can not be an approver. Since this is a business requirement, we wouldn't mind developing enhancement to work around this restriction. If you could point me to the place where this is checked, that would help me.
2) I have set up the process level configuration as such:
100 ZEV_PO_SL_APPR_001 PO approval level 1 RR_EMPLOYEE Specify Employee for Approval
200 ZEV_PO_SL_APPR_002 PO approval level 2 RR_MANAGER Get Creator's Line Manager for Approval
300 ZEV_PO_SL_APPR_003 PO approval level 3 RR_MANAGER Get Creator's Line Manager for Approval
The corresponding expressions are simply checking against the PO total value, such as -
0V_PO_POTOTALVALUE >= 0 AND 0V_PO_POTOTALVALUE < 1,000
0V_PO_POTOTALVALUE >= 1,000 AND 0V_PO_POTOTALVALUE < 25,000
0V_PO_POTOTALVALUE >= 25,000
But when I checked the Approver list with a PO with total value > 50,000, only the first level is triggered and listed. And once approved, the PO went into "Ordered" status. But it should have gone through 3 levels of approval. I'd greatly appreciate it if you could point out what might have been wrongly defined in my configuration.
Thanks!Hi,
1) It's our business requirement that the last-change person of the PO is defined as the first approver in the chain. I tested with RR_EMPLOYEE and a hard-coded user BP number (my own), but got error "Strategy RR_EMPLOYEE did not determine any approver". Changing to any other user's BP number worked. So I am guessing the buyer himself can not be an approver. Since this is a business requirement, we wouldn't mind developing enhancement to work around this restriction. If you could point me to the place where this is checked, that would help me.
SAP recently released the consultant OSS note to handle this issue.. when the release the SRM 7.0 , SC requestor or PO creator ( Buyer ) cant be in the approval list.. later on they release a OSS note to handle this issue.. 1551561\
2) I have set up the process level configuration as such:
100 ZEV_PO_SL_APPR_001 PO approval level 1 RR_EMPLOYEE Specify Employee for Approval
200 ZEV_PO_SL_APPR_002 PO approval level 2 RR_MANAGER Get Creator's Line Manager for Approval
300 ZEV_PO_SL_APPR_003 PO approval level 3 RR_MANAGER Get Creator's Line Manager for Approval
The corresponding expressions are simply checking against the PO total value, such as -
0V_PO_POTOTALVALUE >= 0 AND 0V_PO_POTOTALVALUE < 1,000
0V_PO_POTOTALVALUE >= 1,000 AND 0V_PO_POTOTALVALUE < 25,000
0V_PO_POTOTALVALUE >= 25,000
But when I checked the Approver list with a PO with total value > 50,000, only the first level is triggered and listed. And once approved, the PO went into "Ordered" status. But it should have gone through 3 levels of approval. I'd greatly appreciate it if you could point out what might have been wrongly defined in my configuration.
once you implement the OSS note Q1, you can build the custom RR resolver to handle this issue with in one process level.. but you have to implement the process level BADI as well.. please refer /SAPSRM/BD_WF_PROCESS_PO badi for more details
Saravanan -
How to use rules in BADI for 3 step approval SRM WF
Hi all,
i am working on three step approval workflow...based on the costcentre and product category it has to be approved...i have defined rule responsibility for this...now i need to bring this rule responility values to my BADI bbp_wfl_approv_badi...i think there is a std function module available for this..can anyone tell me what is the fm or else is there anyother way to do that..
Thanks&Regards,
HariHi,
Please refer the foll link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/95/ed94ee764c11d3b535006094b9c9b4/frameset.htm
You can try the foll FM's:
RH_GET_STRUCTURE
SWY_DEMO_GET_MANAGER
BR,
Disha.
Pls reward points for useful answers. -
Problem in N-STEP Approval BADI
Hi ,
I'am new to Workflows,I need your guidance in finishing
the Item_level Approval BADI.
I'am working on N-Step Approval Badi(Item Level Implementation)
I have pasted the code here.There will be Multiple levels(Max 15 Levels) of Approvals.
When a new Shopping cart is created this BADI is not working.
Can you please suggest me, am i missing something in the code.?.I'am also new to ABAP but i hope i'am managing with it.
Please Help me out.
METHOD if_ex_bbp_wfl_approv_badi~get_remaing_approvers .
Interface parameters:
OBJECT_ID TYPE CRMT_OBJECT_ID "Import
OBJECT_TYPE TYPE CRMT_SUBOBJECT_CATEGORY "Import
GUID TYPE BBP_GUID_32 "Import
ACTUAL_APPROVAL_INDEX TYPE SWH_NUMC10 "Import
APPROVAL_HISTORY_TABLE TYPE BBP_WFL_APPROVAL_HISTORY_BADI "Import
APPROVAL_TABLE TYPE BBPT_WFL_APPROVAL_TABLE_BADI "Export
NO_FURTHER_APPROVAL_NEEDED TYPE BOOLEAN "Export
INCLUDE <swfcntn01>. "Workflow
DATA:
ls_header TYPE bbp_pds_sc_header_d,
lt_item TYPE TABLE OF bbp_pds_sc_item_d,
ls_item TYPE bbp_pds_sc_item_d,
lt_account TYPE TABLE OF bbp_pds_acc,
ls_account TYPE bbp_pds_acc,
lt_partner TYPE TABLE OF bbp_pds_partner,
ls_partner TYPE bbp_pds_partner,
lc_partner TYPE but000-partner,
lt_result_tab TYPE TABLE OF swhactor,
ls_result_tab TYPE swhactor,
lc_cost_ctr TYPE bbp_pds_acc-cost_ctr,
lv_co_code TYPE bbp_pds_sc_item_d-be_co_code,
lt_prodcat TYPE TABLE OF zmwfprodcat,
ls_prodcat TYPE zmwfprodcat,
Inserted by Rakesh Palle for Assets DR # D0001055958
lt_asset TYPE TABLE OF zmwfprodcat,
lt_final TYPE TABLE OF zmwfprodcat,
ls_asset TYPE zmwfprodcat,
ls_final TYPE zmwfprodcat,
lv_asset TYPE c,
End of insertion DR # D0001055958
Being D0001055958
lt_order TYPE TABLE OF zmwfprodcat,
ls_order TYPE zmwfprodcat,
lv_order TYPE c,
End D0001055958
lt_sets TYPE TABLE OF zmwf_sets,
ls_sets TYPE zmwf_sets,
lt_roles TYPE TABLE OF str_agr2,
ls_roles TYPE str_agr2,
lt_users TYPE TABLE OF str_agrs,
ls_users TYPE str_agrs,
lc_persnumber TYPE usr21-persnumber,
ls_approver TYPE bbp_wfl_approval_table_badi,
ls_approver_check TYPE bbp_wfl_approval_table_badi,
lv_guid TYPE crmd_orderadm_h-guid,
lv_call_value1 TYPE bbp_wfl_app_property,
ev_app_obj_guid TYPE bbp_guid_32,
lc_sobid TYPE req_name,
lc_objid TYPE hrp1001-objid,
lc_objid_s type hrp1001-objid,
lt_appr_def TYPE TABLE OF bbpt_wfl_lia_def,
lt_approver TYPE TABLE OF bbp_wfl_approval_table_badi,
lc_slapprover TYPE hrv1222a-low,
li_limit TYPE bbp_limit,
li_last_level TYPE zmwfprodcat-appr_level,
li_stepno TYPE i,
lv_index type i,
lc_stepno(3) TYPE c,
lc_first(1) TYPE c,
lc_pass(1) TYPE c,
li_last_setid LIKE ls_prodcat-setid,
c_cost_centre TYPE bbp_wfl_app_criterion VALUE 'COST_CTR',
li_stop_amt LIKE ls_header-total_value,
li_set_amt LIKE li_stop_amt,
lt_cost_ctr type table of zitem_costctr,
ls_cost_ctr type zitem_costctr,
ls_approval_item TYPE bbps_wfl_item_approval,
lt_approval_items TYPE TABLE OF bbps_wfl_item_approval.
Business objects type (local constants)
CONSTANTS:
c_shop TYPE crmt_subobject_category VALUE 'BUS2121',
c_aprover_value TYPE zmwf_setty VALUE 'AV',
c_comp_value TYPE zmwf_setty VALUE 'CD',
**// Begin D0001055958
c_ac_value TYPE zmwf_setty VALUE 'AC',
c_ad_value TYPE zmwf_setty VALUE 'AD',
c_oc_value TYPE zmwf_setty VALUE 'OC',
c_od_value TYPE zmwf_setty VALUE 'OD',
**// End D0001055958
c_yes(1) TYPE c VALUE 'X',
c_no(1) TYPE c VALUE ' ',
c_requisitioner TYPE bbp_pds_partner-partner_fct VALUE '00000016'.
**********begin of change D0001034557
TYPES : BEGIN OF ty_swhactor,
otype TYPE otype,
objid TYPE actorid,
END OF ty_swhactor.
DATA : lt_user TYPE TABLE OF ty_swhactor,
ls_user TYPE ty_swhactor,
v_guid TYPE BBP_GUID_32.
***********end of change D0001034557
***********begin of change D0001043944
DATA : lt_prodcat2 TYPE TABLE OF zmwfprodcat,
new_approval_table TYPE BBPT_WFL_APPROVAL_TABLE_BADI,
wa_new_approval_table TYPE BBP_WFL_APPROVAL_TABLE_BADI.
***********end of change D0001043944
*****Change by suresh D0001110145
data ws_set type zmwf_sets.
data cd_flag.
*****End of change by suresh D0001110145
DEFINE set_approval_level.
if lc_first = 'X' or
ls_prodcat-appr_level gt li_last_level or
ls_prodcat-setid ne li_last_setid. "D0001055958
add 1 to li_stepno.
clear lc_first.
endif.
ls_approver-approval_index = li_stepno.
END-OF-DEFINITION.
DEFINE set_approval_level_2.
if lc_first = 'X' or
ls_asset-appr_level gt li_last_level.
add 1 to li_stepno.
clear lc_first.
endif.
ls_approver-approval_index = li_stepno.
END-OF-DEFINITION.
DEFINE set_approval_description.
write li_stepno to lc_stepno left-justified.
concatenate 'Approval step #'
lc_stepno
into ls_approver-approval_description.
END-OF-DEFINITION.
CLEAR: lt_prodcat[], ls_approver.
CLEAR: li_stepno.
break-point.
map input data to local data
map char32 to raw16
MOVE guid TO lv_guid.
break-point.
IF object_type = c_shop.
get the details of the shopping cart
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
i_guid = lv_guid
i_object_id = object_id
IMPORTING
e_header = ls_header
TABLES
e_item = lt_item
e_account = lt_account
e_partner = lt_partner.
Modification for Item-Level Approval-Start
select * from zitem_costctr
into table lt_cost_ctr.
lv_index = actual_approval_index.
if lv_index = 0.
lv_index = 1.
endif.
LI_STOP_AMT = LS_HEADER-TOTAL_VALUE.
Modification for Item-Level Approval-End
LOOP AT lt_item INTO ls_item.
Modification for Item-Level Approval-Start
if actual_approval_index le lv_index.
ls_approval_item-approval_item_guid = ls_item-guid.
READ TABLE lt_account INTO ls_account
WITH KEY p_guid = ls_item-guid.
if sy-subrc is initial.
READ TABLE LT_COST_CTR INTO LS_COST_CTR
WITH KEY COST_CENTER_NO = LS_ACCOUNT-COST_CTR.
LV_CALL_VALUE1 = LS_ACCOUNT-COST_CTR.
CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
EXPORTING
sc_guid = ls_header-guid
criterion1 = 'COST_CTR'
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.
LS_APPROVAL_ITEM-APPROVAL_ITEM_GUID = LS_ITEM-GUID.
APPEND ls_approval_item TO lt_approval_items.
approval_table[] = lt_approver[].
Get the Object ID of user
SELECT SINGLE objid
INTO lc_objid
FROM hrp1001
WHERE sobid = ls_cost_ctr-CC_MANAGER_ID
AND otype = 'CP'
AND plvar = '01'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
SELECT SINGLE objid
INTO lc_objid_s
FROM hrp1001
WHERE sobid = lc_objid
AND otype = 'S'
AND plvar = '01'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
Get the Approver's Limit
CLEAR li_limit.
lc_sobid = ls_cost_ctr-CC_MANAGER_ID.
CALL FUNCTION 'BBP_BW_GET_APPR_LIMIT'
EXPORTING
i_userid = lc_sobid
IMPORTING
e_appr_limit = li_limit.
IF LI_LIMIT > LS_ITEM-VALUE. "LI_STOP_AMT.
SELECT SINGLE persnumber
INTO lc_persnumber
FROM usr21
WHERE bname = lc_sobid.
IF sy-subrc IS INITIAL.
SELECT name_text
INTO ls_approver-name
FROM adrp
UP TO 1 ROWS
WHERE persnumber = lc_persnumber
AND date_from LE sy-datum
AND date_to GE sy-datum.
ENDSELECT.
ENDIF.
ADD 1 TO li_stepno.
ls_approver-approval_index = li_stepno.
ls_approver-approval_agent = lc_SOBID.
set_approval_description.
APPEND ls_approver TO approval_table.
CLEAR ls_approver.
ELSE.
do.
Get the Object ID of user
CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
EXPORTING
sc_guid = ls_header-guid
criterion1 = 'COST_CTR'
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.
LS_APPROVAL_ITEM-APPROVAL_ITEM_GUID = LS_ITEM-GUID.
APPEND ls_approval_item TO lt_approval_items.
CLEAR : LC_OBJID,LC_OBJID_S.
SELECT SINGLE objid
INTO lc_objid
FROM hrp1001
WHERE sobid = ls_cost_ctr-CC_MANAGER_ID
AND otype = 'CP'
AND plvar = '01'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
SELECT SINGLE objid
INTO lc_objid_s
FROM hrp1001
WHERE sobid = lc_objid
AND otype = 'S'
AND plvar = '01'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
Get the SL Approver
SELECT SINGLE low
INTO lc_slapprover
FROM hrv1222a
WHERE plvar = '01'
AND otype = 'S'
AND objid = lc_objid_s
AND begda LE sy-datum
AND endda GE sy-datum
AND attrib = 'SLAPPROVER'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
Get the Approver's Limit
CLEAR li_limit.
lc_sobid = lc_slapprover+2.
CALL FUNCTION 'BBP_BW_GET_APPR_LIMIT'
EXPORTING
i_userid = lc_sobid
IMPORTING
e_appr_limit = li_limit.
SUBTRACT '.01' FROM li_limit. "D0001093425
IF li_limit GT 0.
Add the approver to the list
SELECT SINGLE persnumber
INTO lc_persnumber
FROM usr21
WHERE bname = lc_sobid.
IF sy-subrc IS INITIAL.
SELECT name_text
INTO ls_approver-name
FROM adrp
UP TO 1 ROWS
WHERE persnumber = lc_persnumber
AND date_from LE sy-datum
AND date_to GE sy-datum.
ENDSELECT.
ENDIF.
ADD 1 TO li_stepno.
ls_approver-approval_index = li_stepno.
ls_approver-approval_agent = lc_slapprover.
set_approval_description.
APPEND ls_approver TO approval_table.
CLEAR ls_approver.
ENDIF.
If the limit is greater than the stop amount, exit - we are finished
IF li_limit GE li_stop_amt.
EXIT.
ENDIF.
ENDDO.
endif.
endif.
ENDIF.
endloop.
data : cc type BBP_STEP_DESCRIPTION value 'CoCentre_Approvers'.
if actual_approval_index le lv_index.
CALL FUNCTION 'BBP_WFL_DIN_FILL_APPROVER'
EXPORTING
iv_approval_index = lv_index
ic_step_description = cc
iv_criterion1 = 'COST_CTR'
TABLES
it_approval_def = lt_appr_def
it_approval_object = item_approval_obj
et_approver = lt_approver
it_approval_items = lt_approval_items.
endif.
item_approval_table[] = lt_approval_items[].
approval_table[] = lt_approver[].
endif.
Modification for Item-Level Approval-End
Use the product category to link to the Product Category Approval
table and use the corresponding approver(s) for the total shopping
cart value.
SELECT *
INTO TABLE lt_prodcat
FROM zmwfprodcat.
WHERE catid LIKE ls_item-category_id.
IF sy-subrc IS INITIAL.
****begin of change D0001034557
***//Buyer to be the first approver
MOVE lv_guid TO v_guid.
READ TABLE lt_account INTO ls_account
WITH KEY p_guid = ls_item-guid.
****Begin of change by suresh for adding codition for buyer determination
****for company codes 7000 and greater D0001110145
clear cd_flag.
select single * into ws_set
from ZMWF_SETS
where setid = 'FCD1'.
if ( ls_item-be_co_code GE ws_set-val_low and
ls_item-be_co_code LE ws_set-val_high ).
cd_flag = 'X'.
endif.
IF ( ls_item-itm_type = 'LIMI' OR
ls_item-product_type = '02' OR
ls_account-acc_cat = 'AS' ) AND
cd_flag is initial.
*****end of changes by suresh D0001110145
Begin of changes by Suresh-EBDK902401
Added the Object Type and Object ID
CALL FUNCTION 'BBP_PDH_WFL_GET_PURCHASER_LIST'
EXPORTING
IV_GUID = v_guid
IV_OBJECT_TYPE = 'BUS2121'
IV_OBJECT_ID = OBJECT_ID
IV_GET_FIRST_PURCH_FROM_GROUP = 'X'
TABLES
ET_USER = lt_user.
***End of changes by Suresh-EBDK902401
LOOP AT lt_user INTO ls_user.
LOOP AT lt_prodcat INTO ls_prodcat.
IF NOT ls_prodcat-bname IS INITIAL.
CONCATENATE 'US' ls_user-objid INTO
ls_approver-approval_agent.
READ TABLE approval_table INTO ls_approver_check
WITH KEY approval_agent =
*ls_approver-approval_agent
IF SY-SUBRC NE 0.
set_approval_level.
set_approval_description.
ls_approver-name = ls_approver-approval_agent.
APPEND ls_approver TO approval_table.
CLEAR ls_approver-name.
ENDIF.
ENDIF.
CLEAR ls_prodcat.
ENDLOOP.
CLEAR ls_user.
ENDLOOP.
ENDIF.
CLEAR ls_account.
****end of change D0001034557
****begin of change D0001043944
**//Special Approvers to be right after the buyer
IF NOT ls_item-z_spl_approval IS INITIAL.
SELECT * INTO TABLE lt_prodcat2
FROM zmwfprodcat
WHERE setid = ls_item-z_spl_approval.
SORT lt_prodcat2 BY catid appr_level.
LOOP AT lt_prodcat2 INTO ls_prodcat.
IF NOT ls_prodcat-bname IS INITIAL.
CONCATENATE 'US' ls_prodcat-bname INTO
ls_approver-approval_agent.
READ TABLE approval_table INTO ls_approver_check
WITH KEY approval_agent = ls_approver-approval_agent.
IF SY-SUBRC NE 0.
set_approval_level.
set_approval_description.
ls_approver-name = ls_approver-approval_agent.
APPEND ls_approver TO approval_table.
CLEAR ls_approver-name.
li_last_level = ls_prodcat-appr_level.
li_last_setid = ls_prodcat-setid.
ENDIF.
ENDIF.
CLEAR: ls_prodcat,ls_approver_check.
ENDLOOP.
ENDIF.
****end of change D0001043944
LOOP AT lt_prodcat INTO ls_prodcat.
IF NOT ls_item-category_id CP ls_prodcat-catid.
DELETE TABLE lt_prodcat FROM ls_prodcat.
ENDIF.
ENDLOOP.
Inserted by Rakesh Palle for Assets DR # D0001055958
LOOP AT lt_prodcat INTO ls_asset WHERE setid = 'AS01'.
APPEND ls_asset TO lt_asset.
ENDLOOP.
Begin D0001055958
LOOP AT lt_prodcat INTO ls_order WHERE setid = 'OR01'.
APPEND ls_order TO lt_order.
ENDLOOP.
End D0001055958
DELETE lt_prodcat WHERE setid = 'AS01' OR setid = 'OR01'.
"D0001055958
End of insertion DR # D0001055958
SORT lt_prodcat BY catid setid appr_level ASCENDING.
lc_first = 'X'.
SELECT *
INTO TABLE lt_sets
FROM zmwf_sets
FOR ALL ENTRIES IN lt_prodcat
WHERE setid = lt_prodcat-setid.
SORT lt_prodcat BY catid setid appr_level ASCENDING.
lc_first = 'X'.
LOOP AT lt_prodcat INTO ls_prodcat.
Check the set data
IF NOT ls_prodcat-setid IS INITIAL.
READ TABLE lt_account INTO ls_account
WITH KEY p_guid = ls_item-guid.
***// Changed by Rakesh Palle to get ACC_STR & COST OBJ
***// if cost ctr is initial DR # D0001055958
IF ls_account-cost_ctr IS INITIAL.
IF ls_account-acc_str IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ls_account-cost_obj
IMPORTING
output = lc_cost_ctr.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ls_account-acc_str
IMPORTING
output = lc_cost_ctr.
ENDIF.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ls_account-cost_ctr
IMPORTING
output = lc_cost_ctr.
ENDIF.
***// End of insertion DR # D0001055958
Check for valid Cost Center (set type = space)
lc_pass = c_no.
LOOP AT lt_sets INTO ls_sets
WHERE setid = ls_prodcat-setid
AND setty = space.
IF ls_sets-val_low = lc_cost_ctr OR
( ls_sets-val_low LE lc_cost_ctr AND
ls_sets-val_high GE lc_cost_ctr ).
lc_pass = c_yes.
EXIT.
ENDIF.
ENDLOOP.
IF sy-subrc IS INITIAL AND
lc_pass = c_no.
CONTINUE.
ENDIF.
***// Inserted by Rakesh Palle for Company code verification
Check for valid Company Code (set type = CC)
LOOP AT lt_sets INTO ls_sets
WHERE setid = ls_prodcat-setid
AND setty = c_comp_value.
IF ls_sets-val_low = ls_item-be_co_code OR
( ls_sets-val_low LE ls_item-be_co_code AND
ls_sets-val_high GE ls_item-be_co_code ).
lc_pass = c_yes.
EXIT.
ENDIF.
ENDLOOP.
IF sy-subrc IS INITIAL AND
lc_pass = c_no.
CONTINUE.
ENDIF.
***// End of Insertion for Company code verification
***// Inserted by Rakesh Palle for Asset Company code verification
Check for valid Asset Company Code (set type = AD)
DR # D0001055958
IF lv_asset = 'X'.
LOOP AT lt_sets INTO ls_sets
WHERE setid = ls_prodcat-setid
AND setty = c_ad_value.
IF ls_sets-val_low = ls_item-be_co_code OR
( ls_sets-val_low LE ls_item-be_co_code AND
ls_sets-val_high GE ls_item-be_co_code ).
lc_pass = c_yes.
EXIT.
ENDIF.
ENDLOOP.
IF sy-subrc IS INITIAL AND
lc_pass = c_no.
CONTINUE.
ENDIF.
***// End of Asset Company code verification
***// Check for valid Cost Center (set type = AC)
LOOP AT lt_sets INTO ls_sets
WHERE setid = ls_prodcat-setid
AND setty = c_ac_value.
IF ls_sets-val_low = lc_cost_ctr OR
( ls_sets-val_low LE lc_cost_ctr AND
ls_sets-val_high GE lc_cost_ctr ).
lc_pass = c_yes.
EXIT.
ENDIF.
ENDLOOP.
IF sy-subrc IS INITIAL AND
lc_pass = c_no.
CONTINUE.
ENDIF.
ENDIF.
***// End of Asset Cost Center
***// Inserted by Rakesh Palle for Order Company code verification
Check for valid Order Company Code (set type = OD)
IF lv_order = 'X'.
LOOP AT lt_sets INTO ls_sets
WHERE setid = ls_prodcat-setid
AND setty = c_od_value.
IF ls_sets-val_low = ls_item-be_co_code OR
( ls_sets-val_low LE ls_item-be_co_code AND
ls_sets-val_high GE ls_item-be_co_code ).
lc_pass = c_yes.
EXIT.
ENDIF.
ENDLOOP.
IF sy-subrc IS INITIAL AND
lc_pass = c_no.
CONTINUE.
ENDIF.
***// End of Order Company code verification
***// Check for valid Order Cost Center (set type = OC)
LOOP AT lt_sets INTO ls_sets
WHERE setid = ls_prodcat-setid
AND setty = c_oc_value.
IF ls_sets-val_low = lc_cost_ctr OR
( ls_sets-val_low LE lc_cost_ctr AND
ls_sets-val_high GE lc_cost_ctr ).
lc_pass = c_yes.
EXIT.
ENDIF.
ENDLOOP.
IF sy-subrc IS INITIAL AND
lc_pass = c_no.
CONTINUE.
ENDIF.
ENDIF.
***// End of Order Cost Center
***// DR # D0001055958
Check for SL Approver Value
LOOP AT lt_sets INTO ls_sets
WHERE setid = ls_prodcat-setid
AND setty = c_aprover_value.
IF NOT ls_sets-val_low CN '1234567890 .'.
TRANSLATE ls_sets-val_low USING ', '.
CONDENSE ls_sets-val_low NO-GAPS.
li_set_amt = ls_sets-val_low.
IF ls_header-total_value LT li_set_amt AND
li_set_amt GT li_stop_amt.
li_stop_amt = li_set_amt.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
CHECK ls_prodcat-val_from LE ls_header-total_value
AND ls_prodcat-val_to GE ls_header-total_value.
Begin D0001055958
IF lc_pass = c_no.
CONTINUE.
ENDIF.
End D0001055958
Handle Approver Name - Explicit
IF NOT ls_prodcat-bname IS INITIAL.
CONCATENATE 'US' ls_prodcat-bname INTO
ls_approver-approval_agent.
READ TABLE approval_table INTO ls_approver_check
WITH KEY approval_agent = ls_approver-approval_agent.
IF sy-subrc NE 0.
set_approval_level.
set_approval_description.
ls_approver-name = ls_prodcat-name_text.
APPEND ls_approver TO approval_table.
CLEAR ls_approver-name.
li_last_level = ls_prodcat-appr_level.
li_last_setid = ls_prodcat-setid. "D0001055958
ENDIF.
ENDIF.
Handle Approver Names - Derive from Role
IF NOT ls_prodcat-agr_name IS INITIAL.
ls_roles-agr_name = ls_prodcat-agr_name.
APPEND ls_roles TO lt_roles.
CALL FUNCTION 'BBP_READ_USERS_OF_ROLES'
TABLES
roles = lt_roles
users_of_roles = lt_users
EXCEPTIONS
no_users_available = 1
OTHERS = 2.
IF sy-subrc IS INITIAL.
LOOP AT lt_users INTO ls_users.
SELECT SINGLE persnumber
INTO lc_persnumber
FROM usr21
WHERE bname = ls_users-uname.
IF sy-subrc IS INITIAL.
SELECT name_text
INTO ls_approver-name
FROM adrp
UP TO 1 ROWS
WHERE persnumber = lc_persnumber
AND date_from LE sy-datum
AND date_to GE sy-datum.
ENDSELECT.
ENDIF.
CONCATENATE 'US' ls_users-uname INTO
ls_approver-approval_agent.
READ TABLE approval_table INTO ls_approver_check
WITH KEY approval_agent = ls_approver-approval_agent.
IF sy-subrc NE 0.
set_approval_level.
set_approval_description.
APPEND ls_approver TO approval_table.
CLEAR ls_approver-name.
li_last_level = ls_prodcat-appr_level.
li_last_setid = ls_prodcat-setid. "D0001055958
ENDIF.
ENDLOOP.
ENDIF.
REFRESH: lt_roles, lt_users.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
Add the SL approvers
CLEAR lc_sobid.
Get the requisioner - in case the cart is created 'on behalf of'
READ TABLE lt_partner INTO ls_partner
WITH KEY partner_fct = c_requisitioner.
IF sy-subrc IS INITIAL.
SELECT SINGLE partner INTO lc_partner
FROM but000
WHERE partner = ls_partner-partner_id.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'BP'
act_objid = lc_partner
act_wegid = 'BP_US'
TABLES
result_tab = lt_result_tab
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
READ TABLE lt_result_tab INTO ls_result_tab WITH KEY otype = 'US'.
lc_sobid = ls_result_tab-objid.
ENDIF.
If the above code failed for any reason use the Created By user as the
requisioner
IF lc_sobid IS INITIAL.
lc_sobid = ls_header-created_by.
ENDIF.
Set the stop amount to the total value of the cart
IF li_stop_amt IS INITIAL.
li_stop_amt = ls_header-total_value.
ENDIF.
DO.
Get the Object ID of user
SELECT SINGLE objid
INTO lc_objid
FROM hrp1001
WHERE sobid = lc_sobid
AND otype = 'S'
AND plvar = '01'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
Get the SL Approver
SELECT SINGLE low
INTO lc_slapprover
FROM hrv1222a
WHERE plvar = '01'
AND otype = 'S'
AND objid = lc_objid
AND begda LE sy-datum
AND endda GE sy-datum
AND attrib = 'SLAPPROVER'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
**break-point.
Get the Approver's Limit
CLEAR li_limit.
lc_sobid = lc_slapprover+2.
CALL FUNCTION 'BBP_BW_GET_APPR_LIMIT'
EXPORTING
i_userid = lc_sobid
IMPORTING
e_appr_limit = li_limit.
SUBTRACT '.01' FROM li_limit. "D0001093425
IF li_limit GT 0.
Add the approver to the list
SELECT SINGLE persnumber
INTO lc_persnumber
FROM usr21
WHERE bname = lc_sobid.
IF sy-subrc IS INITIAL.
SELECT name_text
INTO ls_approver-name
FROM adrp
UP TO 1 ROWS
WHERE persnumber = lc_persnumber
AND date_from LE sy-datum
AND date_to GE sy-datum.
ENDSELECT.
ENDIF.
ADD 1 TO li_stepno.
ls_approver-approval_index = li_stepno.
ls_approver-approval_agent = lc_slapprover.
set_approval_description.
APPEND ls_approver TO approval_table.
CLEAR ls_approver.
ENDIF.
If the limit is greater than the stop amount, exit - we are finished
IF li_limit GE li_stop_amt.
EXIT.
ENDIF.
ENDDO.
ENDIF.
Inserted by Rakesh Palle for Order
DR # D0001055958
IF lv_order = 'X'.
lc_first = 'X'.
LOOP AT lt_order INTO ls_order.
CHECK ls_order-val_from LE ls_header-total_value
AND ls_order-val_to GE ls_header-total_value.
Handle Approver Name - Explicit
IF NOT ls_order-bname IS INITIAL.
CONCATENATE 'US' ls_order-bname INTO
ls_approver-approval_agent.
READ TABLE approval_table INTO ls_approver_check
WITH KEY approval_agent = ls_approver-approval_agent.
IF sy-subrc NE 0.
set_approval_level_2.
set_approval_description.
ls_approver-name = ls_order-name_text.
APPEND ls_approver TO approval_table.
CLEAR ls_approver-name.
li_last_level = ls_order-appr_level.
ENDIF.
ENDIF.
Handle Approver Names - Derive from Role
IF NOT ls_order-agr_name IS INITIAL.
ls_roles-agr_name = ls_order-agr_name.
APPEND ls_roles TO lt_roles.
CALL FUNCTION 'BBP_READ_USERS_OF_ROLES'
TABLES
roles = lt_roles
users_of_roles = lt_users
EXCEPTIONS
no_users_available = 1
OTHERS = 2.
IF sy-subrc IS INITIAL.
LOOP AT lt_users INTO ls_users.
SELECT SINGLE persnumber
INTO lc_persnumber
FROM usr21
WHERE bname = ls_users-uname.
IF sy-subrc IS INITIAL.
SELECT name_text
INTO ls_approver-name
FROM adrp
UP TO 1 ROWS
WHERE persnumber = lc_persnumber
AND date_from LE sy-datum
AND date_to GE sy-datum.
ENDSELECT.
ENDIF.
CONCATENATE 'US' ls_users-uname INTO
ls_approver-approval_agent.
READ TABLE approval_table INTO ls_approver_checkhi,
let me know the following things
1) how many levels are working ? is the workitem send to the second approver (or) not?
is the issue occuring with the first approver?
2) are you using the index value correctly in your approval badi? please check out.
Badi is called during each approval stage
3) what is the value of approval_state in the workflow container ?
if the value is 5 --> it will go to the next approver.
4) have you been able to debug --> the approval process --> this will enable you to find root cause of the issue.
check out FM
BBP_WFL_DIN_APPR_CONTAINER_SET --> this is the point where the approval update happens --> when the approver approves (or) rejects the cart. -
Single Step approval BRF Workflow for RFx.
Hi,
I am facing one problem in process controlled workflow for RFx. I have the scenario where I have only one approver but 7-8 reviewer are there in between of approver and initiator for example:
Initiator >reviewer1>reviewer2->reviewer3->....reviewer8-->approver.
For acheiving this I have activated standard single step approval workflow.
But while I am trying to add reviewers to the RFx at the time of creation of RFx the system is not shwing the reviewers. it gets refreshed only reviewers line is added to the reviewers Tab but system did not display any reviewer.
And while I publish the RFx it directly goes to the approver and while i tried to add the reviewer from approver end the same problem is coming.
Please help me. How I cam achieve this functionality.
Thanks & Regards,
SachinHello Ashutosh,
Thanks For your reply. I want to add reviewers at the time of creation of RFx not ad-hoc approvers.
As I explain in my question that I have only one approver in whole approval process rest all are the reviewers only who only do the review and add comments not the approving authority.
Thanks,
Sachin
Maybe you are looking for
-
Create a pdf with no background, is it possible?
I'm trying to have some t shirts made up for my company, with a simple text on the front. I used Pages, saved as a pdf then converted the file to a jpeg. The problem is that when I upload the file I get a white block rather than just the text. I h
-
Two nonlinear fitting's function in one
We bought the LabView 6.1 and I have no clue how to make the Lev-Mar work (and many other functions as well). There are some tasks in the 'getting start' manual that tells you step-by-step of doing things. I appreciate any body can tell me how to 'wr
-
Hello, In the recent weeks, I've noticed that when my MAC's screen saver's comes on, that when I log back in that I often get a message that there is an IP address conflict. It is annoying because I have to re authenticate to all my open RDP and Citr
-
Hi Adobe InDesign Scripters/Employee, I have very big doubt? Why not shown the correct answer points Tick Mark and helpful answer start symbol not shown in my Profile why. I was give the correct answer last two things one is "Delete facing pages in I
-
Migrate a project from BPM Studio to enterprise server
Hi can anyone can help me and explain me how to migrate or deploy a project from BPM studio to the BPM enterprise server???????? thanks