Ashok,
I feel it is notIWO10002 but we need to try with User Exit for IWO10009 foryour task. I'm unable to test the solution for you at present.
Clues are:
You need to use Function Module STATUS_CHANGE_INTERN in the Exit coding. The logic would be, when you release the Main Order and Save, system checks the System Status of Main Order, i.e., field CAUFVD_IMP-IPHAS. '2' is the value for REL status.
So the code will be like:
If CAUFVD_IMP-IPHAS = '2' .
CALL FUNCTION 'STATUS_CHANGE_INTERN'
.....................
.......................
......................
ENDIF.
In this FM, you will be passing the OBJNRvalue of SubOrderno. (get from AUFK table) and target status (perhaps I0002). (verify in TJ02 table).
*(Also you might need to use Function Module 'BAPI_TRANSACTION_COMMIT' in continuation to the above FM, for desired change to take place)
Best of Luck
KJogeswaraRao