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,
Thomas
Hi,
You can copy WS10400047 and delete 2nd approval step.
Transaction PFTC_COP, PFTC_CHG and SWDD.
Regards,
Masa
Similar Messages
-
Problem with One-Step Approval of Contracts ws14000088
Hi, I have a problem with the One-Step Approval of Contracts ws14000088, the workflow can't find approverat the task TS14007969
regards
DayanaHi
<b>Please go through these links, which will definitely help -></b>
Which SRM version are you using ?
Re: Problem with one step approval contract workflow
Re: No Approver(s) Found
Reminders for work item
Re: How to add a new field to the notification mail
Do let me know.
Regards
- Atul -
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 -
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 -
Single step workflow with multiple approvers (without using a group)
Hi,
is it possible to have a single step workflow with multiple approvers without using a group? This is for a contract document.
i want to add a number of users based on particular logic. The approvers are random and do not belong to any particular group.
DO let me know if it is possible or if any of you have done that.
thanks in advance.
regards,
rubioHi Rubio,
I believe the behavior would be, if individual users are added as approvers then the system would require each approver to approve the document. However, if you use the user group, you could set the role so that it would be either ALL or ANY.
Regards,
Vikram -
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 -
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. -
Process Controlled Workflow - 1-step approval for shopping cart approval
Hi,
I have configured a one-level approval for SC (Process Controlled Workflow):
Object Type: BUS2121
Additional 1 level under schema: 3C_SC_600_000 (the last level is the automatic approval)
Level Type: Approval with completion
Eval ID: 0EV_SC_SL1
RR Name: RR_SPENDING_LIMIT_APPROVER
RR Param: USTONY.Y (I hardcoded it using my user ID, for the moment)
Task ID: 40007953 (I have checked, it's generalized as well)
Decision Type: Item-based decision for entire document
For PPOMA_BBP:
Under my org unit (Position):
Approval Limit: 1000
Output Limit: 1000
I didn't do any BADI implementations yet.
During creation of SC by other user, before "Order" the SC, the approval preview can show correctly that the Processor is as indicated in the config.
Once the SC is ordered, the whole step is gone and the event linkage becoming delinked (because there is error, and according to the config in SWEQADM).
However, I cannot find the workitem (no workitem generated) and SLG1 does not give any clue whatsoever.
I tried debugging method APPROVAL_LIMIT, and it seems fine as well.
Please help, what did I do wrong here?
Thanks,
Tony YHi Sahil,
I even changed to first process level to:
Level Type: Approval
Eval ID: 0EV000
RR Name: RR_MANAGER
RR Param: (Blank)
Task ID: 40007953 (I have checked, it's generalized as well)
Decision Type: Decision for entire document
Under PPOMA_BBP:
I made myself as a head of the org unit with the role manager.
The requester is "Exclude" the role manager.
The agent can be determined now.
But the workitem ID is still cannot be generated. It's always no workitem generated.
Please everyone, any help?
Thanks in advance,
Tony -
How to Work with DeadLine Monitoring : Basic understanding required
Hi my scenario is ,
The user needs to approve the process . if he is not approve with in 5 mins , it should a mail to him again as requesting to approve .
In order to meet this scenario , i have created a user Decision in my workflow , in decision tab for the user decision i have mentioned my username in agents.
Then in the Latest end tab , i have selected refer.Date/time in the Workitem creation tab , and 5 mins i choosed in the time text box.
in display text i assigned my user name again .
inoutcomes tab i have activated the processing obsolete ( But i am not clear what is the use of this )
after the userdecision i created a sendmail step below of approved and rejected.
and workflow completed , no error ...
when i exected this workflow , it is not sending any escalation mail as i mentioned .
what could be the problem ?? it is still showing the inprocess status in the workflow log... workitem is there in my inbox.
Message was edited by:
Prakash NHi Prakash,
Do you want to send an email notification or a message in the business workplace of the agent, if you want to send a message in business workplace then what you have is done is correct and you dont need to activate processing obsolete also but if you want to send an email notification then go for a modeled outcome instead of display text and define a mail send step in the flow, also check your configuration settings.
Hope this helps,
Regards
Saurabh
PS: please reward points if this helps you. -
Shopping cart's One step approval workflow activation
Hi Gurus,
Please reply me for, how to create a shopping cart with One step approval workflow activation?
regards,
George.Hi George,
The creation of the SC stays the same. Only the event linkage and the start conditions determine which workflow will be started.
Regards,
Martin -
WS14000088 one-step Approval of contracts
Dear SRM Friends,
I have problem with finding the right approver for my workflow 14000088 one-step approval of contracts.
The process is easy:
My purchaser with user role: SAP_EC_BBP_PURCHASER should create the contract. Afterwards my Manager1 with user role: SAP_BBP_STAL_PURCHASER_MANAGER should approve this contract.
Beside I have to say, that my Manager stands above serval organisational units - but he is the only one - who has this role SAP_BBP_STAL_PURCHASER. And in my workflow this role ist determined.
So I aspect that my Manager1 will be displayd in Approval Preview - but it didn´t. Instead of that there appears the Manager2 of the organisational unit of my Purchaser.
But how can that be? Manager2 did´nt have the role SAP_BBP_STAL_PURCHASER.
I have checked following transaktions:
bbppd with BUS2000113_
with result:
workflow item:
workitem - ID: 79856
Task: WS14000088
Text: one-step approval of contracts
Status: started
Statustext: in process
Node ID: 000000023
Agent: Mr xyz
User: Manager2
State: Ready
Workitem:79856
Created at: 18.09.2009
Finished at: "Blank"
Discription: First Approval
Node ID: 000000092
Agent. "Blank"
User: "Blank"
State / Worktitem:No workitem found
Created at: "Blank"
Finished at: "Blank"
Discription: New Approval
OOCU ( Assign Agents ):
WS14000088
Role: SAP_BBP_STAL_PURCHASE_MANAGER
SWDD ( Workflow Builder ):
WS14000088
TS14007969 first approval
here I wanted to add my Agent "Manager1" but I get following message:
"general task can be edited by all user"
PPOSABBP ( organisational Model ):_
Attributes for my Manager1
User Role: SAP_BBP_STAL_PURCHASER_MANAGER
Transaction Type: Contracts / ID: CT_PROC_TY / Value: PCTR
So - I don´t have any ideas what to do.
I would be glad If someone have any ideas.....
Best RegardsHi,
The approver for one-step approval of contracts is determined from the org structure as the manager of the user that creates the contract. So this is working correctly for you since manager2 is the org manager. The check on the agents of the task also occurs and since this is set to general, then manager2 will always be selected. Basically the intersection between the agents of the task and the org unit manager will be selected. If you change the agent of the task to have the SAP_BBP_STAL_PURCHASER role, then you will get an error when creating the contract since no approver will be found.
If you want to have the approver determined in a different way then you would need to use the n-step approval badi workflow for contract, WS14000148. This will allow you to determine the approver using your own code.
By the way, if you want to change the agents for the task, then display the task in PFTC. Goto
Additional Data ->
Agent Assignment ->
Maintain ->
Click on Attrributes ->
Select radio button -> Forwarding not allowed ->
Now Select from the menu -> Agent Assignment -> Create
You should now be able to add a role.
Hope this helps.
Kind regards,
Siobhan -
How mail can be send to superior if not approved within deadline
Hi firends,
I'm a little new 2 workflows and i have 2 issues
1) If the approver doesnot act with a time limit a mail has to be send to his superior regarding the delay approver is creating. How can i achieve this scnerio? will the tab 'LatestEnd' has to be used? and if yes how can i use it?
and the approver should still be able to approve it and the flow should not be altered.
2) If the approver does not act within the time limit, the approval process should be assigned to another user. But in this case also the flow should not be altered exept that the approver has changed. How can i achieve this scnerio??
Kindly reply soon.
Thanks & Regards,
Ajo JohnHi Ajo,
May b u can try the following.
1) If the approver doesnot act with a time limit a mail has to be send to his superior regarding the delay approver is creating. How can i achieve this scnerio? will the tab 'LatestEnd' has to be used? and if yes how can i use it?
and the approver should still be able to approve it and the flow should not be altered.
Yes. You are right u can use the "Latest End" tab
Choose "workflow Item Creation" in the Refer Date / Time field
and in the Time field enter the "x" days after which the Superior must recieve the mail.
and in the bottom half of the page.
enter the Supervisor as the Recipient of the when last end date missed.
u can choose "user" and then enter the Superior User id
or u can use "Expression" and then enter a expression which determines the Superior user id.
2. If the approver does not act within the time limit, the approval process should be
assigned to another user. But in this case also the flow should not be altered exept that the approver has changed. How can i achieve this scnerio??
U can achieve this, by making the Agent determination as a background activity.
U can follow the sequence
U can use a Fork
with 2 inputs and 1 output.
Branch 1
1. Approval Process with Agent1 as the responsible Agent.
2. Approval step set with "Latest end" set as 3 days
Branch 2.
1. Approval Process with Agent2 as the responsible Agent.
2. Approval Step set with "Requested Start" set as 3 days (i.e. the latest end of the previous agent)
May be this answers your question.
Raj -
N-step approval workflow for Shopping Cart-WS14000133
Hi Experts,
We have 5-6 levels of approvals for Shoppoing carts.All the SC needs to be approved by 5-6 managers based on their approval limits.All the approval limits are assigned at the Role level .(We have created Z roles)
Please let me know how and where to define the roles in BADI to activate the N-step approval workflow for Shopping Cart-WS14000133
Thanks,
VenkyTo add to Masa's reply.
This Badi is well documented by the online help and it even comes with example implementations AND it is mentioned in full detail at help.sap.com
Kind regards, Rob Dielemans -
N Step Approval BADI - BBP_WFL_APPROV_BADI
We have implemented this BADI and are having problems with the agent determination.
When creating and ordering the cart the approval preview shows the correct approval agents.
When clicking the 'Agents' button within the workflow log via SWI1, the message 'No selected agents' (Message no. WL795) is shown.
The buffers have been refreshed via SWU_OBUF and the indexes and organisational environment have been refreshed.
Has anyone had this problem before, and if so what steps did you have to undertake to cure it ?
Thanks
KeithHi
<b>Please specify the SRM version(Support packs) details in next reply.</b>
<u>Meanwhile, please go through the following SAP OSS Notes, which will definitely help -></u>
Note 798295 BADI workflow: SRM 3.0 upgrade to 4.0 approver list -> main
Note 748655 SC APPROVAL GRAPHIC PREVIEW NOT CORRECT FOR BADI APPROVERS
Note 843636 PO BADI WORKFLOW does not assign correct approvers
Note 861147 BAdI workflow: Adjusting step name to runtime
Note 883207 BBP_WFL_DIN_APPR_BY_RULE_GET: if BAdI not implemented
Note 713567 SRM-EBP-WFL: Limit is ignored in WS14000109
Note 923463 BAdI n-step approval - Container inconsistent for 1st step
Note 901068 BAdI Workflows: Enhancement of Note 896556
Note 898768 BADI Workflow: Determining current approvers
Note 861147 BAdI workflow: Adjusting step name to runtime
Note 688724 BADI workflow: Problems with substitute
Note 788584 BADI Workflow: empty WI_ID in approver table
Note 780021 BADI Workflow: subsequent approvers after rejection
Do let me know.
Regards
- Atul -
How to activate N-Step Shopping cart approval workflow in Process controlled workflows in SRM7. Is it just activating the BC sets will activate the N-step approval workflow. Please sugggest step by step.
Hi,
Yes - You can activate SL Approval BC using SCPR20 t.code. Before you activate.. you have to make sure the SLAPPROVER attribute has been updated with prefix 'US' and approver user id and also make sure the approval limit and spending limit has been maintained in SU01 user id pernelization tab.
Saravanan
Maybe you are looking for
-
WCF Add Service Reference Not Supported for Windows Phone 8.1 XAML Applications
Windows Phone 8.1 XAML applications does not support the System.ServiceModel namespace, and therefore you are not able to right click references in the project and choose Add Service Reference. The recommended solution is to add a REST endpoint to
-
Aggregation select query in oracle database10.2/linux
Hi friends, I required to build matrix kind of report which should includes segregated and aggregated values in single query and format can be as follows.. i am trying on scott.emp table example: Job/deptno 10 20 30 40 50 total CLERK sum(Sal) sum(sal
-
What plug adapter do I use to connect the new Macbook USB-C port to a cinema display?
What plug adapter do I use to connect the new Macbook USB-C port to a cinema display?
-
What is the use of having process profiles in SPP?
Dear all, what is the use of process profile in spp? it says we use it for specifying packaging methods and packaging sizes, but what are they used for? can someone throw some light on it please? regards, binod
-
Where can i hire 50 iPhones for a video project.
HI all, I was wondering if any one here would have a option or idea on where i could hire 50 iphones for a video project idea. I'm a creative director for a sports company and we have a idea using the video opition on the iphones and making a edit wh