Stop Confirming TECOed PM Order: User-Exit Way
Stop Confirming TECOed PM Order: User-Exit Way
Introduction
Years ago, while SAP-PM implementation, one of the several questions about Standard SAP process is this too. i.,e., Why system allows Operation Confirmations after Order was Technically Completed?. Answers were known to such questions as time passed on. But, we needed to satisfy our requirements, For this like many others we too had to do something in Customization or Enhancements.
Here I want to mention few words about the advantage and significance of User-Exits. In situations like above, where the solutions were always not available in Customization, then a simple few line codes in User-exits always made impossibles, possible. Out of several such cases I remember one here discussed recently:
. Many times, we treat the Enhancements to be the objects of someone-else’s jurisdiction. The way Customization is a part of Development, Workbench is also a part of Development, where a functional person need to know a small, very small coding to reap big benefits out of User-Exits. In my view for a Functional person conversant with this, Enhancements will be more confident, comfortable and effective way of finding solutions. Often only simple few line codes need to be written, the way we give codes in Objects like the Dependencies (CU01), Codes in Infoset Extras etc. In case one is unable to, no problem, it is a tiny task for your ABAPer.
Objective of this post
To share my knowledge about the ‘User-Exit way of Preventing Confirmations in TECO’d Orders‘.
Finding proper User-Exit for our issue is the main thing. This can be easily done by searching queries in SCN etc. In the present case more than one Transactions involved i.e., IW41, IW42 and IW44 the confirmation Tcodes. We are going to use 2 User Exits, as shown below.
1. To prevent user from Confirming the Operation using Tcode ‘IW41’.
User-Exit is CONF0001 ( Include ZXCOCU01 ). Just put the following code in this include.
DATA: V_LINE TYPE J_STEXT.
CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
FLG_USER_STAT = 'X'
OBJNR = I_CAUFVD-OBJNR
ONLY_ACTIVE = 'X'
SPRAS = SY-LANGU
IMPORTING
LINE = V_LINE
EXCEPTIONS
OBJECT_NOT_FOUND = 01.
IF V_LINE+0(4) = 'TECO'.
MESSAGE: ' Confirmation not possible as the Order has already been Completed.' TYPE 'E'.
ENDIF.
Now, when user tries to confirm operation of a TECOed order through Tcode IW41, he will get the error shown in this picture IW41 error
2. To prevent user from Confirming the Operation/s using Tcodes ‘IW42’ and ‘IW44’.
User-Exit is CONFPM02 ( Include ZXCOFU02 ). Put the following code in this include.
DATA: V_LINE TYPE J_STEXT.
CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
FLG_USER_STAT = 'X'
OBJNR = CAUFVD_IMP-OBJNR
ONLY_ACTIVE = 'X'
SPRAS = SY-LANGU
IMPORTING
LINE = V_LINE
EXCEPTIONS
OBJECT_NOT_FOUND = 01.
IF V_LINE+0(4) = 'TECO'.
MESSAGE: ' Confirmation not possible as the Order has already been Completed.' TYPE 'E' .
ENDIF.
Now, when user tries to confirm operation/s of a TECOed order through Tcode IW44, he gets the error shown in the this picture IW44 error
Hope this post too helps many.
Thank you
Jogeswara Rao K
Hi
i think we can also control through user status which forbids the confirmation after TECO. Correct me if it is wrong
Regards
Thyagarajan
Thank you for the Review Sir 🙂
My post is a way to achieve this through User-Exits., A document has just been posted illustrating how this happens with Status Profile, Means it is Yes to your Query.
Regards
Jogeswara Rao K
I would suggest to go by user exit because we can use only one status profile for a order types.So we can use user status for some other fucntionality usage..
Exactly. I missed this angle.
Thank you BAIJU KUMAR
Very good document..
Thank you BAIJU KUMAR
Excellent document - thanks for sharing 🙂
Hi Gary,
Thank you very much !
🙂
Hello Sir.
I think simple config change will be sufficient to stop TECOed order confirmations.
In my system, it has been configured so.
Yes you are right, This has been already discussed. Please go through the document and comments. Also give attention to the Title of the document.