on 2016 Feb 11 6:11 PM
Hi,
I am looking for an option to restrict end user to make operation text changes once operation is confirmed.
We are not able to achieve this functionality by writing the code in user exit IWO10009, since it's being table control once any of the operation is confirmed it's not allowing to change in other (non confirmed) operations text changes of same work order.
I tried to configure user status for operations, and selected "CHANGE" as forbidden for one of the user status, still system is allowing to operation text changes in spite having relevant user status. What does this CHANGE represents?
I have checked on final confirmation config too, did not help!
I understand that the change log for operations displays all the changes related to operation text.
Please let me know your thoughts.
Thanks,
N.Nagaraju
Hello Nagaraju,
Here is the solution.
Objective:
This code prevents changes in Operation text if the Operation is in confirmed status.
Notes:
The following code to be used in the include ZXWOCU07 of user-exit IWO10009 .
IF caufvd_imp-iphas <> '0' AND sy-tcode = 'IW32'.
DATA: vbkz TYPE afvgb-vbkz.
DATA: i_afvc TYPE STANDARD TABLE OF viauf_afvc,
wa1 LIKE LINE OF i_afvc.
SELECT * FROM viauf_afvc INTO TABLE i_afvc WHERE aufnr = caufvd_imp-aufnr.
DATA: BEGIN OF i_afvg OCCURS 100.
INCLUDE STRUCTURE afvgd.
DATA:END OF i_afvg.
DATA: wa2 LIKE LINE OF i_afvg.
CALL FUNCTION 'CO_BO_AFVGBT_GET'
EXPORTING
aufnr_imp = caufvd_imp-aufnr
TABLES
afvgbt_exp = i_afvg[].
LOOP AT i_afvc INTO wa1.
READ TABLE i_afvg INTO wa2 WITH KEY objnr = wa1-objnr.
IF sy-subrc = 0.
DATA:i_stat LIKE jstat OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'STATUS_READ'
EXPORTING
objnr = wa1-objnr
only_active = 'X'
TABLES
status = i_stat.
LOOP AT i_stat.
IF i_stat-stat = 'I0009'.
IF wa1-ltxa1 <> wa2-ltxa1.
MESSAGE: 'You can not make changes in texts of confirmed Operations'
TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDIF.
This triggers the following error pop-up, while saving the Order, in case some text changes are found in any one of the confirmed operations of the Order.
Upon hitting the Enter key the popup goes away and user gets access to correct the changes made and Save the Order.
Believe this is the solution you are looking for. Implement with support of ABAPer, if you are not one.
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.
User | Count |
---|---|
106 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.