40: begin
41:
42:
43:
44: FND_FILE.PUT_LINE(FND_FILE.LOG, 'batch_id='||p_batch_id||', instance_id='||p_instance_id||', dblink='||p_dblink);
45:
46: retcode :=0;
47:
48: -- release so with source_type = null thru oe package
90: p_so_table(a).orig_inventory_item_id,
91: p_so_table(a).inventory_item_id;
92: EXIT WHEN so_cursor%NOTFOUND;
93: so_count := so_count +1;
94: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
95: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
96: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
91: p_so_table(a).inventory_item_id;
92: EXIT WHEN so_cursor%NOTFOUND;
93: so_count := so_count +1;
94: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
95: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
96: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
92: EXIT WHEN so_cursor%NOTFOUND;
93: so_count := so_count +1;
94: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
95: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
96: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
93: so_count := so_count +1;
94: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
95: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
96: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
94: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
95: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
96: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
95: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
96: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
96: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
97: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_so_table(a).line_id);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
98: FND_FILE.PUT_LINE(FND_FILE.LOG,'Ship_from_org_id='||p_so_table(a).Ship_from_org_id);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
106: FND_FILE.PUT_LINE(FND_FILE.LOG,'firm_demand_flag='||p_so_table(a).firm_demand_flag);
99: FND_FILE.PUT_LINE(FND_FILE.LOG,'delivery_lead_time='||p_so_table(a).delivery_lead_time);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
106: FND_FILE.PUT_LINE(FND_FILE.LOG,'firm_demand_flag='||p_so_table(a).firm_demand_flag);
107: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_inventory_item_id='||p_so_table(a).orig_inventory_item_id);
100: FND_FILE.PUT_LINE(FND_FILE.LOG,'shipping_method_code='||p_so_table(a).shipping_method_code);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
106: FND_FILE.PUT_LINE(FND_FILE.LOG,'firm_demand_flag='||p_so_table(a).firm_demand_flag);
107: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_inventory_item_id='||p_so_table(a).orig_inventory_item_id);
108: FND_FILE.PUT_LINE(FND_FILE.LOG,'inventory_item_id='||p_so_table(a).inventory_item_id);
101: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_ship_date='||to_char(p_so_table(a).orig_schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
106: FND_FILE.PUT_LINE(FND_FILE.LOG,'firm_demand_flag='||p_so_table(a).firm_demand_flag);
107: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_inventory_item_id='||p_so_table(a).orig_inventory_item_id);
108: FND_FILE.PUT_LINE(FND_FILE.LOG,'inventory_item_id='||p_so_table(a).inventory_item_id);
109: if p_so_table(a).header_id is null then
102: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_schedule_arrival_date='||to_char(p_so_table(a).orig_schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
106: FND_FILE.PUT_LINE(FND_FILE.LOG,'firm_demand_flag='||p_so_table(a).firm_demand_flag);
107: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_inventory_item_id='||p_so_table(a).orig_inventory_item_id);
108: FND_FILE.PUT_LINE(FND_FILE.LOG,'inventory_item_id='||p_so_table(a).inventory_item_id);
109: if p_so_table(a).header_id is null then
110: OPEN header_c(p_so_table(a).line_id);
103: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ship_from_org_id='||p_so_table(a).orig_ship_from_org_id);
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
106: FND_FILE.PUT_LINE(FND_FILE.LOG,'firm_demand_flag='||p_so_table(a).firm_demand_flag);
107: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_inventory_item_id='||p_so_table(a).orig_inventory_item_id);
108: FND_FILE.PUT_LINE(FND_FILE.LOG,'inventory_item_id='||p_so_table(a).inventory_item_id);
109: if p_so_table(a).header_id is null then
110: OPEN header_c(p_so_table(a).line_id);
111: FETCH header_c INTO p_so_table(a).header_id;
104: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_shipping_method_code='||p_so_table(a).orig_shipping_method_code);
105: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_ordered_quantity='||p_so_table(a).orig_ordered_quantity);
106: FND_FILE.PUT_LINE(FND_FILE.LOG,'firm_demand_flag='||p_so_table(a).firm_demand_flag);
107: FND_FILE.PUT_LINE(FND_FILE.LOG,'orig_inventory_item_id='||p_so_table(a).orig_inventory_item_id);
108: FND_FILE.PUT_LINE(FND_FILE.LOG,'inventory_item_id='||p_so_table(a).inventory_item_id);
109: if p_so_table(a).header_id is null then
110: OPEN header_c(p_so_table(a).line_id);
111: FETCH header_c INTO p_so_table(a).header_id;
112: CLOSE header_c;
109: if p_so_table(a).header_id is null then
110: OPEN header_c(p_so_table(a).line_id);
111: FETCH header_c INTO p_so_table(a).header_id;
112: CLOSE header_c;
113: FND_FILE.PUT_LINE(FND_FILE.LOG,'header_id='||p_so_table(a).header_id);
114: end if;
115:
116:
117: -- populating correct OU
117: -- populating correct OU
118: OPEN populate_ou(p_so_table(a).line_id);
119: FETCH populate_ou INTO p_so_table(a).org_id;
120: CLOSE populate_ou;
121: FND_FILE.PUT_LINE(FND_FILE.LOG,'org_id='||p_so_table(a).org_id);
122:
123: a := a+1;
124: END LOOP;
125: CLOSE so_cursor;
149: p_crm_so_table(a).org_id,
150: p_crm_so_table(a).quantity_by_due_date;
151: EXIT WHEN so_cursor%NOTFOUND;
152: crm_so_count := crm_so_count +1;
153: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_crm_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
154: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_crm_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
155: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_crm_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
156: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_crm_so_table(a).order_line_id);
157: FND_FILE.PUT_LINE(FND_FILE.LOG,'org_id='||p_crm_so_table(a).org_id);
150: p_crm_so_table(a).quantity_by_due_date;
151: EXIT WHEN so_cursor%NOTFOUND;
152: crm_so_count := crm_so_count +1;
153: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_crm_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
154: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_crm_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
155: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_crm_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
156: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_crm_so_table(a).order_line_id);
157: FND_FILE.PUT_LINE(FND_FILE.LOG,'org_id='||p_crm_so_table(a).org_id);
158: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty='||p_crm_so_table(a).quantity_by_due_date);
151: EXIT WHEN so_cursor%NOTFOUND;
152: crm_so_count := crm_so_count +1;
153: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_crm_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
154: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_crm_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
155: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_crm_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
156: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_crm_so_table(a).order_line_id);
157: FND_FILE.PUT_LINE(FND_FILE.LOG,'org_id='||p_crm_so_table(a).org_id);
158: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty='||p_crm_so_table(a).quantity_by_due_date);
159: a := a+1;
152: crm_so_count := crm_so_count +1;
153: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_crm_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
154: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_crm_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
155: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_crm_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
156: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_crm_so_table(a).order_line_id);
157: FND_FILE.PUT_LINE(FND_FILE.LOG,'org_id='||p_crm_so_table(a).org_id);
158: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty='||p_crm_so_table(a).quantity_by_due_date);
159: a := a+1;
160: END LOOP;
153: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_ship_date='||to_char(p_crm_so_table(a).schedule_ship_date,'MM-DD-RRRR HH24:MI:SS'));
154: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_crm_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
155: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_crm_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
156: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_crm_so_table(a).order_line_id);
157: FND_FILE.PUT_LINE(FND_FILE.LOG,'org_id='||p_crm_so_table(a).org_id);
158: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty='||p_crm_so_table(a).quantity_by_due_date);
159: a := a+1;
160: END LOOP;
161: CLOSE so_cursor;
154: FND_FILE.PUT_LINE(FND_FILE.LOG,'schedule_arrival_date='||to_char(p_crm_so_table(a).schedule_arrival_date,'MM-DD-RRRR HH24:MI:SS'));
155: FND_FILE.PUT_LINE(FND_FILE.LOG,'earliest_ship_date='||to_char(p_crm_so_table(a).earliest_ship_date,'MM-DD-RRRR HH24:MI:SS'));
156: FND_FILE.PUT_LINE(FND_FILE.LOG,'line_id='||p_crm_so_table(a).order_line_id);
157: FND_FILE.PUT_LINE(FND_FILE.LOG,'org_id='||p_crm_so_table(a).org_id);
158: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty='||p_crm_so_table(a).quantity_by_due_date);
159: a := a+1;
160: END LOOP;
161: CLOSE so_cursor;
162:
208: ' and batch_id = :p_batch_id '||
209: ' and line_id = :p_line_id ';
210: if nvl(p_so_table(a).x_return_status, FND_API.G_RET_STS_ERROR) <>
211: FND_API.G_RET_STS_SUCCESS then
212: FND_FILE.PUT_LINE(FND_FILE.LOG,'update fails for line id '||p_so_table(a).line_id||', om return status ='||p_so_table(a).x_return_status);
213: p_status := 2; -- fails
214: retcode :=2;
215: else
216: FND_FILE.PUT_LINE(FND_FILE.LOG,'atp override for line id'||p_so_table(a).line_id);
212: FND_FILE.PUT_LINE(FND_FILE.LOG,'update fails for line id '||p_so_table(a).line_id||', om return status ='||p_so_table(a).x_return_status);
213: p_status := 2; -- fails
214: retcode :=2;
215: else
216: FND_FILE.PUT_LINE(FND_FILE.LOG,'atp override for line id'||p_so_table(a).line_id);
217: p_status := 1; -- override
218: end if;
219: EXECUTE IMMEDIATE sql_stmt using p_status, p_instance_id, p_batch_id,
220: p_so_table(a).line_id;
219: EXECUTE IMMEDIATE sql_stmt using p_status, p_instance_id, p_batch_id,
220: p_so_table(a).line_id;
221: p_need_notify := true;
222: else
223: FND_FILE.PUT_LINE(FND_FILE.LOG,'update scceeds for line id'||p_so_table(a).line_id);
224: end if;
225:
226: end loop;
227:
237: ' and source_type = 100 ';
238: EXECUTE IMMEDIATE sql_stmt using p_status, p_instance_id, p_batch_id;
239: commit;
240: for a in 1..crm_so_count loop
241: FND_FILE.PUT_LINE(FND_FILE.LOG,'update fails for line id '||p_crm_so_table(a).order_line_id);
242: end loop;
243: ELSE
244: for a in 1..crm_so_count loop
245: FND_FILE.PUT_LINE(FND_FILE.LOG,'update successfully for line id '||p_crm_so_table(a).order_line_id);
241: FND_FILE.PUT_LINE(FND_FILE.LOG,'update fails for line id '||p_crm_so_table(a).order_line_id);
242: end loop;
243: ELSE
244: for a in 1..crm_so_count loop
245: FND_FILE.PUT_LINE(FND_FILE.LOG,'update successfully for line id '||p_crm_so_table(a).order_line_id);
246: end loop;
247: END IF;
248:
249: sql_stmt:=
266: EXECUTE IMMEDIATE sql_stmt using in p_batch_id,in p_instance_id,
267: in p_user_name, out p_request_id ;
268: commit;
269:
270: FND_FILE.PUT_LINE(FND_FILE.LOG,'send workflow notification to planner '||p_user_name||', request id='||p_request_id);
271: end if;
272: exception when others then
273: retcode :=2;
274: raise;