In Oracle EBS Asset Management, Work Order is the foundation for all maintenance organizations. Work orders define the resources and items that are needed to conduct work. Enterprise Asset Management Work Orders are created for assets and rebuildable inventory items. They are defined manually, or generated automatically based on a scheduled Activity. Sometimes we want to create follow-up work orders based on the data entered on the work order or from other applications. We can use APIs provided by Oracle to create these follow-up work order. You can manually create the follow-up work order on the Work Order’s tab of the Asset Management application as show in the user’s guide screen.
To create these Follow-up Work Orders using the API, you need to make sure that you have relation attributes set properly to establish the relation setup correctly between the parent and child Work Orders.
Here are the few details about the API and how to use this API.
- The EBS API, we use for this is EAM_PROCESS_WO_PUB
- The procedure is PROCESS_MASTER_CHILD_WO
- You need to make sure initialize user for a database session using the FND_GLOBAL.APPS_INITIALIZE procedure before invoking the EAM API.
Fnd_global.apps_initialize(user_id => p_user_id, resp_id => p_resp_id, resp_appl_id => p_appl_id)
- The tricky part is setting the relation attributes properly as described below:
- Set PARENT_RELATION_TYPE of relation record as desired (4 for Follow-up)
l_EAM_WO_RELATIONS_REC.PARENT_RELATIONSHIP_TYPE := 4;
- Set the Header Id of Work Order record and Parent Header Id of relation record different numbers. You can set Parent Header Id as WIP_ENTITY_ID of the parent work order and +1 to the new Work Order record
l_EAM_WO_REC.HEADER_ID := p_PARENT_WIP_ENTITY_ID + 1; l_EAM_WO_RELATIONS_REC.PARENT_HEADER_ID := p_PARENT_WIP_ENTITY_ID;
- Set same Header value for Work Order record and CHILD_HEADER_ID of relations record
l_EAM_WO_REC.HEADER_ID := p_PARENT_WIP_ENTITY_ID + 1; l_EAM_WO_RELATIONS_REC.CHILD_HEADER_ID := l_EAM_WO_REC.HEADER_ID;
- Set PARENT_OBJECT_ID of relation record to parent WO WIP_ENTITY_ID
l_EAM_WO_RELATIONS_REC. PARENT_OBJECT_ID := p_PARENT_WIP_ENTITY_ID;
- Set the TRANSA CTION_TYPE for both WO record and relations record to 1 (create new)
l_EAM_WO_RELATIONS_REC.TRANSACTION_TYPE := 1; l_EAM_WO_REC.TRANSACTION_TYPE := 1;
- set OBJECT_TYPE for both WO record and relations record to 1
l_EAM_WO_RELATIONS_REC. OBJECT_TYPE := 1; l_EAM_WO_REC. OBJECT_TYPE := 1;
- Invoke the PROCESS_MASTER_CHILD_WO API
EAM_PROCESS_WO_PUB.PROCESS_MASTER_CHILD_WO ( P_BO_IDENTIFIED => ‘EAM’, P_API_VERSION_NUMBER => 1.0, P_INIT_MST_LIST => TRUE, P_EAM_WO_RELATIONS_TBL => l_EAM_WO_RELATIONS_TBL P_EAM_WO_TBL => l_EAM_WO_TBL, ... ... );
That’s it. If you get these correct, the relationship would be established properly. Below are the queries to verify the relations. You need to make sure both the queries return results and relationships query shows correct details.
SELECT * FROM APPS.EAM_WO_RELATIONSHIPS WHERE PARENT_OBJECT_ID = :p_PARENT_WIP_ENTITY_ID SELECT PARENT_WIP_ENTITY_ID from APPS.EAM_WORK_ORDERS_V where WIP_ENTITY_ID= :p_CHILD__WIP_ENTITY_ID;
7 thoughts on “How to create Follow-up Work Order using APIs in Oracle Enterprise Asset Management”
can any one help me how to upload work order operations.
If you just want to export the data, you can export from the tables. No need to use APIs when you are not going to modify the data. You can start with EAM_OPERATIONS_DETAILS_V view. If you need resources for the operations, you can take a look at EAM_RESOURCES_V.
Hope this helps. Let me know, if you need help with queries.
I need some help on ASSET management. We are getting SOA messages, we need to insert/update using API. Can you please help me understand how the flow works, what is the use of staging table in this scenario?
it would be really helpful.
thanks a lot!
Please check https://docs.oracle.com/cd/E18727_01/doc.121/e13671/T282740T282716.htm for the available APIs to start with and let me know, if you need help with any of these APIs.
thanks Rama! Really appreciate it. Sorry I couldn’t check earlier. I will send you my questions.
In a manufacturing plant which uses Oracle EBS, where will be work orders used/created? Also, what is the difference between a work order, Job order and job work?
Thanks in advance.
Work orders created in eAM module. I am sure you would have checked EBS documentation on this, if not you can check at https://docs.oracle.com/cd/E18727_01/doc.121/e13670/T259967T259972.htm#T260030