Requirement : Restrict TECO if UD for 04 inspection lot is pending.
I have created status profile in BS02 selected objects 1) PP/PM order header, 2) Process order 3) Insp. lot with plan and char.
Then in the 1st status, I have added business function technically completed and it is forbidden. and then assigned this status profile to 04 inspection type 04. Then I have made GR and insp lot created, now I am trying to do TECO and system is not restricting the TECO.
Please let me know how address this using status profile..
TECO is not a relevant status for inspection lots. It is for the process/prod orders.
User statuses assigned to an object do not work across objects. Even if the objects are linked like an inspection lot and order. If you look at the JEST table at the statuses, you'll see objects do not share the same status records.
The whole status functionality is a generic process that is utilized by many, many areas of SAP. Just because a status appears to be available in the list to pick from, doesn't mean it applies to your object.or that your object can affect that status.
So it's not possible to do what you want the way you are trying to do it.
Also, in most of the clients I've worked with, the logic should be the other way around. We don't allow a UD until the order has a status of TECO. I know several companies that have written code in various user exits to make sure the UD is not done until the TECO status is set. The main reson being is that until TECO is set, additional confirmations can be done and in some cases, (especially with 04 early lot creation), additional amounts posted after the inspection lot is UD'd either go right to unrestricted or against the UD'd inspection lot into QI. Either way, that can result in bad stuff happenning.
So in most pharma firms it would be considered a bad business practice to do the UD before the TECO is done. I don't know about your business but I would recommend you have the client serioulsy look at this requirement again.