Search over 500+ Posts

Nov 30, 2009

ORA-20002: 3133: Activity instance 'SHIP_LINE' is not a notified activity for item 'OEOL/xxxxx'. in Package OE_Delayed_Requests_PVT Procedure Process_Request_Pvt

Recently I was geeting this error while trying to Run the ITS for order line  ('ATO Item').During my analysis I found that Order line status is 'SUPPLY_ELIGIBLE' and workflow for the order line is "CREATE_SUPPLY_ORDER_ELIGIBLE" Notified status , but to my surprise Delivery details was SHIPPED.
Error that I was geeting was - ORA-20002: 3133: Activity instance 'SHIP_LINE' is not a notified activity for item 'OEOL/xxxxx'. in Package OE_Delayed_Requests_PVT Procedure Process_Request_Pvt .

with the status of
  1. Order line
  2. Workflow and
  3. Delivery Details
It was for sure a case of data corruption and I had noticed that end user try to FORCE the workflow.

Reason for this Error was , at the time of ITS , Order Management expects that Order Line workflow should be at SHIP_LINE - Notified status , but in this case it was not at SHIP_LINE-Notifed.On Further analysis I have noticed that after user progress the Order line from SUPPLY_ELIGIBLE , workflow progressed to SHIP_LINE- Notified and created work order in WIP  , but on completion of WIP workflow was not progress any further rather it was return back to 'CREATE_SUPPLY_ORDER_ELIGIBLE'( Not able to analyze why that has happened, as that was stand alone incident).

First thing I did was advise user not to FORCE the workflow and Secondly open an SR with Oracle to get data-fix.

Nov 25, 2009

Sample Code for oe_order_pub.Process_Order

Got sample code to create Sales Order in Oracle Order Management .Please note that this is not my code , one of my friend has forwaded this .But I have tested it throughly and succesfully created Sales Orders.

create or replace procedure createsalesorder
(p_org_id NUMBER,
p_user_id NUMBER,
p_resp_id NUMBER,
p_appl_id NUMBER,
p_order_type_id NUMBER,
p_sold_to_org_id NUMBER,
p_ship_to_org_id NUMBER,
p_price_list_id NUMBER,
p_curr_code VARCHAR2,
p_flow_status_code VARCHAR2,
p_po_num VARCHAR2,
p_order_source_id NUMBER,
p_inventory_item_id NUMBER,
p_ordered_quantity NUMBER,
p_tax_code VARCHAR2)
IS
 l_api_version_number NUMBER := 1;

l_return_status VARCHAR2(2000);
l_msg_count NUMBER;
l_msg_data VARCHAR2(2000);
/*****************PARAMETERS****************************************************/
l_debug_level number := 1; -- OM DEBUG LEVEL (MAX 5)
l_org number := p_org_id;--204; -- OPERATING UNIT
l_user number := p_user_id;--1318; -- USER
l_resp number := p_resp_id;--21623; -- RESPONSIBLILTY
l_appl number := p_appl_id;--660; -- ORDER MANAGEMENT
/***INPUT VARIABLES FOR PROCESS_ORDER API*************************/
l_header_rec oe_order_pub.header_rec_type;
l_line_tbl oe_order_pub.line_tbl_type;
l_action_request_tbl oe_order_pub.Request_Tbl_Type;
/***OUT VARIABLES FOR PROCESS_ORDER API***************************/
l_header_rec_out oe_order_pub.header_rec_type;
l_header_val_rec_out oe_order_pub.header_val_rec_type;
l_header_adj_tbl_out oe_order_pub.header_adj_tbl_type;
l_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type;
l_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type;
l_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type;
l_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type;
l_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type;
l_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type;
l_line_tbl_out oe_order_pub.line_tbl_type;
l_line_val_tbl_out oe_order_pub.line_val_tbl_type;
l_line_adj_tbl_out oe_order_pub.line_adj_tbl_type;
l_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type;
l_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type;
l_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type;
l_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type;
l_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type;
l_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type;
l_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type;
l_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type;
l_action_request_tbl_out oe_order_pub.request_tbl_type;
l_msg_index NUMBER;
l_data VARCHAR2(2000);
l_loop_count NUMBER;
l_debug_file VARCHAR2(200);
-- book API vars

b_return_status VARCHAR2(200);
b_msg_count NUMBER;
b_msg_data VARCHAR2(2000);
BEGIN
dbms_application_info.set_client_info(l_org);
/*****************INITIALIZE DEBUG INFO*************************************/
if (l_debug_level > 0) then
l_debug_file := OE_DEBUG_PUB.Set_Debug_Mode('FILE');
oe_debug_pub.initialize;
oe_debug_pub.setdebuglevel(l_debug_level);
Oe_Msg_Pub.initialize;
end if;
/*****************INITIALIZE ENVIRONMENT*************************************/
fnd_global.apps_initialize(l_user, l_resp, l_appl); -- pass in user_id, responsibility_id, and application_id
/*****************INITIALIZE HEADER RECORD******************************/
l_header_rec := oe_order_pub.G_MISS_HEADER_REC;
/***********POPULATE REQUIRED ATTRIBUTES **********************************/
l_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
l_header_rec.order_type_id := p_order_type_id;--1430;
l_header_rec.sold_to_org_id := p_sold_to_org_id;--1006;
l_header_rec.ship_to_org_id := p_ship_to_org_id;--1026;
l_header_rec.price_list_id := p_price_list_id;--1000;
l_header_rec.pricing_date := SYSDATE;
l_header_rec.transactional_curr_code := p_curr_code;--'USD';
l_header_rec.flow_status_code := p_flow_status_code;--'ENTERED';
l_header_rec.cust_po_number := p_po_num;--'06112009-08';
l_header_rec.order_source_id := p_order_source_id;--0 ;
--l_header_rec.attribute1 := 'ABC';
/*******INITIALIZE ACTION REQUEST RECORD*************************************/
l_action_request_tbl(1) := oe_order_pub.G_MISS_REQUEST_REC;
l_action_request_tbl(1).request_type := oe_globals.g_book_order;
l_action_request_tbl(1).entity_code := oe_globals.g_entity_header;
/*****************INITIALIZE LINE RECORD********************************/
l_line_tbl(1) := oe_order_pub.G_MISS_LINE_REC;
l_line_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
l_line_tbl(1).inventory_item_id := p_inventory_item_id;--149 ;
l_line_tbl(1).ordered_quantity := p_ordered_quantity;--1;
l_line_tbl(1).ship_to_org_id := p_ship_to_org_id;--1026 ;
l_line_tbl(1).tax_code := p_tax_code;--'Location' ;
/*****************CALLTO PROCESS ORDER API*********************************/
dbms_output.put_line('Calling API');
oe_order_pub.Process_Order( p_api_version_number => l_api_version_number,
p_header_rec => l_header_rec,
p_line_tbl => l_line_tbl,
p_action_request_tbl => l_action_request_tbl,
--OUT variables
x_header_rec => l_header_rec_out,
x_header_val_rec => l_header_val_rec_out,
x_header_adj_tbl => l_header_adj_tbl_out,
x_header_adj_val_tbl => l_header_adj_val_tbl_out,
x_header_price_att_tbl => l_header_price_att_tbl_out,
x_header_adj_att_tbl => l_header_adj_att_tbl_out,
x_header_adj_assoc_tbl => l_header_adj_assoc_tbl_out,
x_header_scredit_tbl => l_header_scredit_tbl_out,
x_header_scredit_val_tbl => l_header_scredit_val_tbl_out,
x_line_tbl => l_line_tbl_out,
x_line_val_tbl => l_line_val_tbl_out,
x_line_adj_tbl => l_line_adj_tbl_out,
x_line_adj_val_tbl => l_line_adj_val_tbl_out,
x_line_price_att_tbl => l_line_price_att_tbl_out,
x_line_adj_att_tbl => l_line_adj_att_tbl_out,
x_line_adj_assoc_tbl => l_line_adj_assoc_tbl_out,
x_line_scredit_tbl => l_line_scredit_tbl_out,
x_line_scredit_val_tbl => l_line_scredit_val_tbl_out,
x_lot_serial_tbl => l_lot_serial_tbl_out,
x_lot_serial_val_tbl => l_lot_serial_val_tbl_out,
x_action_request_tbl => l_action_request_tbl_out,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);

/*****************CHECK RETURN STATUS***********************************/
if l_return_status = FND_API.G_RET_STS_SUCCESS then
dbms_output.put_line('Return status is success ');
dbms_output.put_line('debug level '
l_debug_level);
if (l_debug_level > 0) then
dbms_output.put_line('success');
end if;
commit;
else
dbms_output.put_line('Return status failure ');
if (l_debug_level > 0) then
dbms_output.put_line('failure');
end if;
rollback;
end if;

/*****************DISPLAY RETURN STATUS FLAGS******************************/
if (l_debug_level > 0) then
 DBMS_OUTPUT.PUT_LINE('process ORDER ret status IS: '
l_return_status);
DBMS_OUTPUT.PUT_LINE('process ORDER msg data IS: '
l_msg_data);
DBMS_OUTPUT.PUT_LINE('process ORDER msg COUNT IS: '
l_msg_count);
DBMS_OUTPUT.PUT_LINE('header.order_number IS: ' to_char(l_header_rec_out.order_number));
DBMS_OUTPUT.PUT_LINE('header.return_status IS: ' l_header_rec_out.return_status);
DBMS_OUTPUT.PUT_LINE('header.booked_flag IS: ' l_header_rec_out.booked_flag);
DBMS_OUTPUT.PUT_LINE('header.header_id IS: ' l_header_rec_out.header_id);
DBMS_OUTPUT.PUT_LINE('header.order_source_id IS: ' l_header_rec_out.order_source_id);
DBMS_OUTPUT.PUT_LINE('header.flow_status_code IS: ' l_header_rec_out.flow_status_code);
end if;
/*****************DISPLAY ERROR MSGS*************************************/
if (l_debug_level > 0) then
FOR i IN 1 .. l_msg_count LOOP
Oe_Msg_Pub.get(
p_msg_index => i
,p_encoded => Fnd_Api.G_FALSE
,p_data => l_data
,p_msg_index_out => l_msg_index);
DBMS_OUTPUT.PUT_LINE('message is: ' l_data);
DBMS_OUTPUT.PUT_LINE('message index is: ' l_msg_index);
END LOOP;
end if;
if (l_debug_level > 0) then
DBMS_OUTPUT.PUT_LINE('Debug = ' OE_DEBUG_PUB.G_DEBUG);
DBMS_OUTPUT.PUT_LINE('Debug Level = ' to_char(OE_DEBUG_PUB.G_DEBUG_LEVEL));
DBMS_OUTPUT.PUT_LINE('Debug File = ' OE_DEBUG_PUB.G_DIR'/'OE_DEBUG_PUB.G_FILE);
DBMS_OUTPUT.PUT_LINE('****************************************************');

OE_DEBUG_PUB.DEBUG_OFF;
end if;
--END;
end createsalesorder;

Nov 24, 2009

ORA-01422: exact fetch returns more than requested number of rows in Package OE_Purchase_Release_PVT Procedure Process_DropShip_CMS_Requests

This is very frequent error,we have noticed in DropShip orders.One of the reason for this error is DUPLICATE records in OE_DROP_SHIP_SOURCES.

Scheduling in Oracle Order Management

Scheduling on order management determines source (warehouse) for the sales order line.
If we enter the warehouse manually or with defaulting rules on Sales Order , scheduling action uses the requested warehouse and derive the scheduling results are based on it.

It derives
   1.  Schedule ship date.
   2. Schedule arrival date
   3. Delivery lead time and
   4. Shipping method.

But If the warehouse is blank, the scheduling action determines the best warehouse based on the sourcing rules.
Scheduling also set the VISIBLE_DEMAND_FLAG to Yes and makes order line visible to the planning applications .If the reservation time fence is set and the schedule ship date is within the reservation time fence, automatically reserves the line.

We can schedule the line automatically by setting either of below options
  1. Setting Profile option - OM:AutoSchedule
  2. Set the Autoscheduling check box while defining the Order Transaction type.
  3. From Order UI , Sales order line Tools > Autoschedule.

Or Set scheduling Manually by

  1. Right click the line and then Select  progress Order.
  2. Run Concurrent Program "Schedule Orders".
  3. Use workflow to schedule line.
  4. Select the Order line then Tools > Scheduling from Sales Order form

Nov 23, 2009

Why My Sales Order Header is closed where lines are still Open.

Beleive me guys , thats not the normal behaviour and it woudn't happens at its own.
There are many reason if that happens with your sales Order .
1.Some is updated the Sales Orders and set the open flag = N , as well as FORCE the Workflow.

2.WAITFORDETAIL attribute for Order header is 0 , where as there are still open lines .
---
select number_value from wf_item_attribute_values w
where name ='#WAITFORDETAIL'
and item_type='OEOH'
and item_key = '&Enter_Order_header_id'
and exists
(select 1 from oe_order_lines_all
where header_id = to_number(w.item_key)
and open_flag ='N');
---

3.Last but not the least , someone has purged the workflow for the order lines , and that leads to close of order header workflow

Nov 21, 2009

How to Design BPEL Process With Pick ( OnMessage and On Alarm) Activity.

In this blog I will discuss BPEL to BPEL Interaction With Timeout.
A client sends a request to a service and waits until it receives a reply, or until a certain time limit is reached, whichever comes first.

In this Example - A BPEL process(Process1) client: uses an Invoke to send an asynchronous request to the service (BPEL Process 2), and a Pick activity with:
- An onMessage branch to receive the response (callback)
- An onAlarm branch to manage the timeout condition if it occurs before the response is
received.

Step # 1 - Drag and Drop the BPEL process and Name them 1 and Process 2.Import the Message Type "OrderInfo" and assign them to Input and output variable, please refer my other blogs on BPEL to get more details about How to Import Message Type.



Step #2 - Design the BPEL Process 1.
  1. BPEL Process 1 is a Synchronous Process.
  2. Add Invoke activity to Call BPEL Process 2.
  3. Add Pick activity.Pickout activity has 2 type of outcome , OnMessage and OnAlarm. Set An onMessage branch to receive the response (callback) and an onAlarm branch to manage the timeout condition if it occurs before the response is received.
  4. Add Assign Activity Assign_2 with OnMessage branch and Assign activity Assign_3 with the OnAlarm activity.
  5. In Assign_2 activity , asign Satus element of "OrderInfo" MessageType with value  'OnMsg' and  Status2 element with value 'BP Pick'
  6. In Assign_2 activity , asign Satus element of "OrderInfo" MessageType with value  'T Out' that indicate that it is Time out Activity.



Step # 3 - Design BPEL Process 2.In this Process Drop Assign activity between Receive and Callback and a delay activity (Waiit_1) between Assign and Callback.Assign activity just assign input to output.



Step # 4 - Configure the Wait activity to 5 seconds.It Means after Assign_1 activity there will be a delay of 5 seconds.



Step # 5 - Configure OnMessage activity of BPEL Process 1 and set the BPEL Process 2 as partner link (that means OnMessage activity in BPEL Process 1 will receive the call from the BPEL Process 2) and also associate the input variable as shown below.



Step # 6 - Configure the OnAlarm activity of Pick activity and set the tine = 59 seconds.That means if the OnMessage Branch has not been process within 59 seconds that BPEL will trigger the OnAlaram branch of theflow.



Step # 7 - Run the BPEL Process .Please note that in BPEL Process we have a delay of 5 seconds and OnAlaram branch in Process1 will trigger only if OnMessage will not get any response with in 59 seconds.
In Our case since delay in Process 2 is 5 seconds , On Message will get response in 5seconds and output will Print the variable assign in Assign activity_2 .
Satus = 'OnMsg' and  Status2 = 'BP Pick'


Step # 18- Once again configure the delay (Wait_1) activity of the BPEL process 2 and set the dealy time = 2 minutes .That means Process2 will take 2 minutes of dealy  between Assign and callback.
Run the BPEL Process .


Please note that in BPEL Process 1we have a delay of 2 Minutes and OnAlaram branch in Process1 will trigger if OnMessage will not get any response with in 59 seconds.In this case sinceProcess 2 will take more than 2 minutes , On Alarm branch will Triggers .


As shown below(Input)



OutPut , Status - TOut that indicates that On Alarm branch triggered.

Nov 17, 2009

BPEL to BPEL Synchronous Interaction.

As a continutation to my earlier 2 blogs about for Interaction b/w Mediator and BPEL Process (
Interaction1 
Interaction2
I will explain Interaction between BPEL 2 BPEL Process with simple example.

Complete Process -
BPEL Process 1 will call BPEL Process 2.Both are Synchronous processess.


In this example I will use Message Type "OrderInfo"  Message Type Element.Please Refer http://eoracleapps.blogspot.com/2009/11/how-to-call-synchronous-bpel-process.html for More Information on "OrderInfo" Message Type.

Import theMessage type in your Project and assign that to input and output variable of BPEL Process 1.


BPEL Process -1
Design BPEL Process 1 with simple Assign activity b/w input and output variables.


Design BPEL Process 2 , with simple Assign activity b/w input and output variables.Assign the message structure "OrderInfo" to input and output variable of BPEL Process 2.


Configure the Assign activity of Process 2 , by Double Click > Copy Operations > Copy i/p to o/p and copy Constant Expression "BPEL 2" to Status2 filed of message structure as shown below.






Open the BPEL Process 1 again and add INVOKE actvity in flow to call the BPEL process 2(BPELProcess3).



Configure the Invoke activity as shown below.



In Assign_1 activity in Process 1 , assign the input variable to input of the invoke activity as shown below.



Add another Assign activity in Process 1 , right below the invoke actity and assign the outcome of the invoke activity to output of BPEL Process.



Compile your Project and Deploy.

Testing - Run the BPEL Process and add the Input data ( Based on Order Info Element).


Verify the output.

How to Call Asynchronous BEPL Process from Mediator

In this blog I will explain in details about how to built the interactions between Mediator and ASynchronous BPEL Process.(Request and Callback Pattern)
Please Note that both BPEL as well as Mediator are the complementary components and do similar tasks.
BPEL is process based and Mediator is routing based.
BPEL is usually for long running process where as Mediator is for short and fast messages.


As stated this blog is about design Interaction Pattern between Mediator and ASynchronous BPEL process .
Example -In this example we have WebService that will take Input for Sales Order and call Mediator process.
If Order Price is < 50 Mediator route the flow to Partner link Service  to Insert the data into Sales Order Table.
If Order Price is > 50 Mediator route flow to BPEL Process , BPEL process just assign the Input Variable to output variables. We can also define Callback Reply in Mediator Process.In My example I define ASysnchorous reply as SERVICE to Insert the Sales Order Data in table.

Complete Flow . -
Below is complete flow of my Process. I have Web service to received Input , Mediator to Route the process.BPEL to just to assign the i/p to o/p and 1 database Adaptor to validate the data.



Step #1
Define your Message Structure ( Structure for your Input data).In my case I have defined a simple Order Structure with few elements, as shown below.


Save it as OrderInfo.xsd


Step # 2
My Requirements
  1. Let user Enter Sales Order data Manually.
  2. Insert Data into Sales Order Table  if Order less than 50.
  3. Call BPEL Process if Order More than 50 and then Insert into Sales  Order table.
Requirement #1
Create a Web Service by Dragging "Web Service" Service Adapters from Component Palette and the associate "Order Info" Schema " by populating the OrderInfo.xsd in URL field in Request. Tab



Requirement #2
Define a Partner Link by Dragging "Database Adapter"  from Component Palette , drop it in External References, name it "InsertOrder".
Configure this database adapter to Insert the data into so_info table.Please note that in my example structure of so_info database table and "OrderInfo.xsd" file is same.

Requirement #3
Drag Mediator Service component in Component and link "WebService" and Database Adaptor. (Pls refer Complete flow diagram)
Configure the Mediator component to Insert data accepted as Input in webService  to "InsertOrder" partner link as shown below.



Requirement #3
As part of requirement 3 , I need to validate the customer rating if Order amount is MORE than 50.For that I have designed a BPEL Process which will take "OrderInfo.xsd" as input and then cassign that to Output variable.
While designing the BPEL Process make sure that you assign "OrderInfo" Message type to

  1. Input - Process Request Message
  2. Output - Process Response Message
 Step A -
Import "OrderInfo" Message structure in BPEL Process shown Below. -
Click the BPEL Process > Click the Schema and then > Import Schema


Step B -

Once you imported your Message Type .Assigin it to Input and Output variable of your Process.In my Example I want my Input and Output Variable should be of same structure , so I associate same message structure with input and output variable.




To fuilfill my requirement , I have bulit a filter in Mediator process and called a BPEL process to ASSIGN i/p to o/p if Order is More than 50.Also I want to pass the same "OrderInfo"Message Structure to BPEL Process.For that I have already assign "OrderInfo" Messaage type to
  1. Process Request Message
  2. Process Response Message  , please verify that.If it is not assigned yet , assign that as shown below.
  3. (Refer muy blog http://eoracleapps.blogspot.com/2009/10/how-to-create-bpel-process-to-insert.html to learn more).


As shown above I have selected -Message Type  > Process WSDL >  Assign the OrderInfo Structure to Request and Response Message Type.
Below is the BPEL Process ,that just take the i/p variable and then assign same to o/p variable by means of ASSIGN activity.



Once BPEL Proces is ready configure Mediator to Call the BPEL Process if Order Total is Greate than 50 as shown below.

Mediator Structure . - Here I set the Routing Rules

In Mediator we can define all routing rules as shown below.




How to Define the Payment Terms for Supplier in Oracle Purchasing

In this blog I will explain "How to define Payment Terms for Supplier in Oracle Purchasing" .

Step#1
Define a Supplier


Step#2
Define Supplier Site



Step#3
Click on the Payment Tab and define your Payment terms for Supplier /Supplier Site combination.

 

Save your data.

Step #4
Create Purchase Order



Step #5
Press the Terms Button on Purchase Order ad it will reflect the payment Trems that you have defined in Step#3.


Interface Trip Stop (ITS) in Order Management

Interface Trip Stop - Interface Trip stop plays very critical part in Oracle Order management application.
It is concurrent program that you can triggered from Interface > Submit Request . Interface Trip Stop.
Or you can also trigger this concurrent program at the time of ship confirm by uncheck the ?Defer Interface? checkbox. By Default this check box is uncheck only.

Interface trip stop has 2 parts
1.It process the data related to Order Management.
2.It Process data related to Inventory.(and we have separate CP for this too ?Inventory Interface?).

In First part it make update on oe_order_lines_all table as well as wsh-delivery_details and once this part executed successfully only then SECOND phase of ITS has triggered. If FIRST part error out for some reason then 2nd part will not be triggered, and even if you try to submit ?Inventory Interface?, it will not pick up you data. Reason ? it will validate and check if oe_interfaced_flag in wsh_delivery_details table is Y or not. If it is N or X ?inventory Interface? will not pick that record for processing.

I have observed that in most of time user submit the interface trip stop while doing the ship confirm, but there are considerable cases when customer preferred to run this as a scheduled process without specifying the delivery# or Trip #, because their volume of order processing is very high and they want to run this process during some particular time of the day.

Please make a note that unless this process execute, workflow for Order line is remain at SHIP_LINE Notified and will not progress to Fulfill and finally Invoicing .So while deciding when to trigger this program you have to make sure that when you want to Invoice customer.

One piece of advice that I will give here is, Never try to stop execution of this program, unless you have a very valid reason. Any halt in ITS will result in piling of data in SHIP_LLINE notified workflow status and once you start executing again after a stop it will take a deep dive in terms of your performance.

Nov 16, 2009

ORA-01422: exact fetch returns more than requested number of rows inPackage OE_Line_Fullfill Procedure Get_Activity_Result

This is bit Intrestng Error.It is very easy to guess from the Error name/message that it is because our query in pl/sql code is returning more than 1 row and expecation is query should return only one Row.
On My Analysis I found that this Error appears when we have duplicate data in wf_item_activity_statuses.Let me be honest this is very unrealistic situation to have duplicate data in this table unless some one really took this table for ride(and most common reason is when user try to retry/skip workflow activity from the workflow admin). So to avoid this explain your end use not to skip/retry workflow activity from workflow admin , rather talk to IT department.


Now best option to fix this is Delete duplicate data ..

Nov 13, 2009

How to Setup ATP Override Option in Oracle Order Management.

In Oracle Order management Scheduling Interact with the MRP Engine and drive the Available to Promise date for an Item.
But for above to true we have to make sure that ATP rules should be define .These rules will determine the SUPPLY and DEMAND of an item.

ATP Rules should be associated with an Item and/or Inventory Organization.
But some time there is business requirement to schedule an item even if there is NO SUPPLY for that item.With this I mean to say that we still want to derive the Schedule Ship date even if the SUPPLY details are not cleared.For that we need to OVERRIDE ATP.

Below are the Setup to Override ATP in OM.
  1. Set Profile Option OM:Authorized to Override ATP
Different ways to Override ATP.
  • Check the Override check box in Order lines
  • Enter Schedule Ship date manually.

Nov 10, 2009

How to customized Oracle "Close line" Workflow subprocess

In this blog I will explain how to customized Close Sub Process Oracle Order management Workflow .

Problem Statement - Customer has Sales Order with
1.One Ship Line
1. One RMA Line

Ship line is close , but RMA line is open.Both the lines are created from Non-Oracle Order Management System(I will refere that system asNOOS in this blog ) .Now any Change NOOS will cancel the RMA line and Insert New RMA line.My Order Header workflow is setup is "Close the Order Header , once all lines are closed".

Now when user make a change in NOOS , it cancel existing RMA line and Insert NEW RMA line.Below are the sequence of events that are triggered by any change in NOOS.
1.In Order Management  once OLD/existing  RMA line got cancelled , line workflow progress to Close and then pogress "Close -Continue Header" and finally let Order header Close.
2.Insert New RMA line , but before that has happened Order header has already progressed to Close -Order workflow activity , so user getting Error "Order Header is Closed".

Solution - To Fix the issue , I have suggested customer to customized the RMA line workflow , and a BLOCK workflow activity between "CLOSE_LINE" workflow activity and "Close-Continue Header" activity and Set the Relative Time for Block activity to 1 minutes.
With this fix , their will be dealy of 1 minute before the cancelled RMA line progress from "CLOSE_LINE" to  "Close-Continue Header"  and by this line NEW RMA line got created and thus avoid the Error "Order Header is Close".

Existing Order Line Close Line Process.


Created Block Activity with 1 Minute Delay.



Copy pasted and Rename the Oracle Standard Close Line Sun Process and then Insert Block activity b/w CLOSE_LINE and Close-Continue Header in that.
 

NOTE - Please Note that Oracle Order Management/Workflow user guide always suggest to create a new Process/Sub process by Copy existing standard process/sub process and make your changes.Please do not make changes directly in Standard workflow process/sub process.

Nov 9, 2009

Processing Constraints in Oracle Order Management

This blog about the functionality of Processing Constraint available in Oracle Order Management and how to do Setup for PC.


Processing Constraints –Processing constraints is a common security framework in Order Management where you can define and build security rules around sales entities (Line, header , line payments etc).

Using processing constraints in Order Management you can define the conditions and status at which an update can be made to an entity. For example a line cannot be cancelled after it has been shipped. This can be seeded as a system constraint to prevent data corruptions. Similarly you can define constraints that suit your business practices and prevent changes. These constraints can be defined at the entity level and for each attribute.

When you attempt to make changes to an order, Order Management validates the changes against processing constraints enabled. In addition, Order Management validates the order changes based on your user responsibility.

You can check these constraints from Setup->Rules->Processing Constraints
In My example, I will define a processing constraint where salesrep can be change as ling as order is not booked, but once order is booked system should not allow user to change the Processing Constraints.

Setup for Processing Constraints
Step # 1 - Select the Attribute for which you want to define the PC.



Step # 2 - Select the User Actions

The order in which constraints will be evaluated would be the following and only one constraint may take effect for a change
User Action:
1. Not Allowed
2. Requires Reason & Generate Version
3. Generate Versions Only
4. Require Reason & History
5. Require History Only


For example: If multiple constraints are setup for Price List and operation = UPDATE so conditions for both versioning and audit constraint apply, only versioning will be captured.




 
 
 
 
Step # 3 - Select the Entity for which you want to define PC.

Step # 4 - Choose Record Set



Step # 5- Select the Validation Template , you can define your own Validation template.



Step # 6 – Choose Validation Template

While defining the Validation Template, we have three Options
1.Template based on API
2.Template based on Workflow
3.Template based on Table

Step # 6 – Choose Validation Template




While defining the Validation Template, we have three Options

1.Template based on API

2.Template based on Workflow

3.Template based on Table

1.Template based on API – here we can use and pl/sql procedure for validations.


2.Template based on Workflow



3.Template based on Table - As shown below.
 

Once you define the validations, generate the constraints.



Example of Processing Constraints - In My example, I will define a processing constraint where salesrep can be change as long as order is not booked, but once order is booked system should not allow user to change the Processing Constraints









Check the screen # 2 to see how to define custom message for a Processing Constraint.