on 05-05-2016 6:29 PM
Dear Experts,
I want various levels of release based on the planned cost of the maintenance orders using permits?. The idea is to set a criteria based on planned cost of the orders. Let's say if the planned cost is USD 2000 approval from ABC is required.
Please help setting that criteria!
Thanks & Regards
Rubab Zehra
HI Rubab,
You can achieve this many ways. One of it is as below. You need to take ABAP help.
1) Exit IWO10002. This exit is for specific check during order release.
2) Create a Ztable where you will maintain user'id in following format
USER ID Release level Description
ABC 1 ( More that 1000 USD)
2) You need to write a code in include ZXWO1U02, such that if an order planed cost is greater than 1000 USD, program will check logon user ID SY-UNAME = user ID maintained against release level 1. If true, system will set NO_RELEASE = Blank else NO_RELEASE = X.
Regards,
Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rubab,
This solution is not using permit. As I mentioned, you can achieve this using many ways, this solution is one of it.
My answers to your questions
1) This exit has an include inside it. If you go to SMOD, and open this customer exit, you will see this include where you can write your own code as per your business requirement.
2) No role of permit here
3) This is ABAP job, You need to consult ABAP person, explain him this requirement. ABAP'er will take care of this task
Regards,
Amol
Complete solution with improvised code has been documented here Release strategy for Work Orders based on Plan Cost (user-exit IWO10002)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rubab
Here is the complete solution using IWO10002 . (All this your ABAPer needs to understand and execute)
Step1.
Create Ztable like this. (with TMG to maintain table entries)
Maintain Table entries like below
Now code to put in the include ZXWO1U02 of user-exit IWO10002.
DATA: v_stat TYPE char1.
SELECT SINGLE iphas FROM afih INTO v_stat WHERE aufnr = caufvd_imp-aufnr.
IF v_stat = '0'.
DATA:v_cost TYPE bp_wpl,
v_wrt TYPE bp_wpl.
SELECT SINGLE cost FROM zplancost INTO v_cost WHERE uname = sy-uname.
SELECT SINGLE wrt01 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
IF v_wrt IS INITIAL.
SELECT SINGLE wrt02 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt03 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt04 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt05 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt06 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt07 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt08 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt09 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt10 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt11 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ELSEIF v_wrt IS INITIAL.
SELECT SINGLE wrt12 FROM pmco INTO v_wrt WHERE objnr = caufvd_imp-objnr.
ENDIF.
IF v_wrt > v_cost.
MESSAGE: 'Plan costs exceed your DOP limit, Order can not be released.' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
ENDIF.
It is done. Here on if the user ABCD_EFGH tries to release an Order (with CRTD status) whose plan cost is more than 5000 the system will throw below error (when clicked on REL flag).
Means he will not be able to release.
IMPORTANT
We are talking about Plan costs , means we are talking about things after the Order is Saved. If someone tries to Release at the time of Order creation itself with excessive plan costs the code will not stop.
For this puprose you need to put the following code in the include ZXWOCU07 of user-exit IWO10009, which stops the user from Releasing an Order during its Creation (IW31).
IF sy-tcode = 'IW31' AND caufvd_imp-iphas = '2'.
MESSAGE: 'Order can not be Released at creation time.' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
Note:
Your ABAPer will give yo facility to update the Ztable as and when required
That's all.
Good luck
KJogeswaraRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rubab,
Two ways have come-up. But none of them is using your word Permits. Because your requirement is not necessarily be using Permits . So focusing on the requirement and not on the word Permit...
My opinion is
About your conceptual question on 'How are we relating ZXWO1U02 to IWO10002?'
Regards
KJogeswaraRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Rubab,
Ztable can be defined seperately. It need not be defined within include.
Within include you just need to call the table
Pseudocode for reference - Irs just guideline for ABAP'er.
-----------------------------------------------------------------------------------------------------------
IF
planned cost > 1000 USD,
Set flag " REL STR = 1
Else,
planned cost > 2000 USD
set flag REL STR = 2.
ENDIF.
CASE REL STR
When 1,
Business Operation BFRE shoud be done by USER ID - ABC
When 2
Business operation BFRE should be done by user ID - DEF
----------------------------------------------------------------------------------------------------------
Dear,
In our business we have set the approvals for maintenance order based on user status if the maintenance order cost is above 1 lakh, plant head needs to be approved before they close the order technically.
You can use the user exit where system triggers the assignment of user status while saving the order.
Here i assigned transaction control for GMAR status as
You can set control here ,as per your business requirement for each status.
Even you can set these with permits, but What i feel is using USER STATUS is more convenient.
Regards,
Pardhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.