We got a Issue that the Sales order was stuck in Deferred status. We get this Issue sometimes as shown in the below screenshot.
What we used to do is we will submit a Concurrent Program called Workflow Background Process with below parameters
Process Deferred = Yes
Process Timeout = Yes
Process Stuck = Yes.
But After running the process still we were having the Same Problem.
So we just checked the Workflow manager as below
Workflow Administrator Web Applications –> Oracle Applications Manager –> Workflow Manager and I was able to see all was up.
So I raised a SR with Oracle and they started to Analyze and then we came to know that
To Close the order header as soon as the line is closed one needs to customize workflow . This will affect only new orders that uses this newly modified Flow. For the existing orders, one needs to wait till the end of the month – the month in which the Sales Order was created. Please note that this happens only for the month the Sales order is created.
Use Workflow Builder to change the Node Attribute of Wait Mode to a value of
Relative Time and then set Relative Time to a constant.
Below is the note
How to Change the Wait Mode in WorkFlow to Process Order Headers with Closed Lines to Close Before the End of the Month ( Doc ID 145011.1 )
So below are the steps that has been provided by Oracle
Please perform the following steps in test instance:
1. Connect to the database using the Work flow Builder.
2. Go to OM order header work flow.
3. In work flow builder , this needs to be done from to enable the customization,
Help — About Oracle Work flow Builder, Check to allow customization.
4. Open Work-flow Process – Order Flow – Generic, Close – Order
5. Copy ‘Order Flow – Generic’ and ‘Close – Order’ and rename them, for example, ‘XX Order Flow – Generic’ and ‘XX Close – Order’, respectively.
6. Right click activity ‘Wait’ (labeled WAIT-1) that is just before activity ‘Close – Wait For Line’ in process ‘XX Close – Order’. In the Properties, choose Node Attributes tab and place cursor on the “Day of the month” and remove the Value that is currently set as “Last”.
7. Change the following appropriate values as below
Changing the Relative Time parameter of activity WAIT-1 to calculated time as mentioned below
Wait Mode = “Relative Time”
Day of Month = none
Click apply button
Save the work flow activity
Relative time can be calculated by following method
To Close immediately – 0
After one hour- 1/24 – 0.0416
After two hour – 2/24 – 0.0833
One day – 1
Two day – 2
Please note that setting Relative Time to 0 will cause an order that is booked with no lines at the time of booking to close almost immediately. This is usually not desired.
8. Replace the process ‘Close Order’ in ‘XX Order Flow – Generic’ with ‘XX Close – Order’ .
9. Save the Workflow process
10. Navigate to Setup -> Transaction Type
Query the Order Type ‘XX Standard’.
Attach the new process to the transaction type ‘XX Standard’.
Order Workflow = ‘XX Order Flow – Generic’
Retest the issue as below:
1. Create an order and one line for any item for transaction type XX Standard. Book the order.
2. Go to line information
3. Cancel the line
5. Re query the order
5. Check whether the line is canceled
6. Run the “Workflow Background Process” concurrent program with the following parameters.
Parameters –> Item type — OM Order Line,
Process deferred – Yes
Time out – No
7. Check whether the request ends successfully.
8. Run the “Workflow Background Process” concurrent program with the following parameters.
Parameters –> Item type — OM Order Header
Process deferred – Yes
Process Time out – No
9. Check whether the request ends successfully.
10. Query the order.
Now the line will be closed as per the calculated time set at relative time values.