61: AND interface_line_id = p_intf_line_id
62: ORDER BY interface_distribution_id;
63:
64: BEGIN
65: IF (PO_LOG.d_proc) THEN
66: PO_LOG.proc_begin(l_log_head);
67: PO_LOG.proc_begin(l_log_head, 'p_intf_line_id', p_intf_line_id);
68: PO_LOG.proc_begin(l_log_head, 'p_ship_to_org_id', p_ship_to_org_id);
69: PO_LOG.proc_begin(l_log_head, 'p_deliver_to_loc_id', p_deliver_to_loc_id);
62: ORDER BY interface_distribution_id;
63:
64: BEGIN
65: IF (PO_LOG.d_proc) THEN
66: PO_LOG.proc_begin(l_log_head);
67: PO_LOG.proc_begin(l_log_head, 'p_intf_line_id', p_intf_line_id);
68: PO_LOG.proc_begin(l_log_head, 'p_ship_to_org_id', p_ship_to_org_id);
69: PO_LOG.proc_begin(l_log_head, 'p_deliver_to_loc_id', p_deliver_to_loc_id);
70: END IF;
63:
64: BEGIN
65: IF (PO_LOG.d_proc) THEN
66: PO_LOG.proc_begin(l_log_head);
67: PO_LOG.proc_begin(l_log_head, 'p_intf_line_id', p_intf_line_id);
68: PO_LOG.proc_begin(l_log_head, 'p_ship_to_org_id', p_ship_to_org_id);
69: PO_LOG.proc_begin(l_log_head, 'p_deliver_to_loc_id', p_deliver_to_loc_id);
70: END IF;
71:
64: BEGIN
65: IF (PO_LOG.d_proc) THEN
66: PO_LOG.proc_begin(l_log_head);
67: PO_LOG.proc_begin(l_log_head, 'p_intf_line_id', p_intf_line_id);
68: PO_LOG.proc_begin(l_log_head, 'p_ship_to_org_id', p_ship_to_org_id);
69: PO_LOG.proc_begin(l_log_head, 'p_deliver_to_loc_id', p_deliver_to_loc_id);
70: END IF;
71:
72: l_progress :='010';
65: IF (PO_LOG.d_proc) THEN
66: PO_LOG.proc_begin(l_log_head);
67: PO_LOG.proc_begin(l_log_head, 'p_intf_line_id', p_intf_line_id);
68: PO_LOG.proc_begin(l_log_head, 'p_ship_to_org_id', p_ship_to_org_id);
69: PO_LOG.proc_begin(l_log_head, 'p_deliver_to_loc_id', p_deliver_to_loc_id);
70: END IF;
71:
72: l_progress :='010';
73:
78: p_deliver_to_loc_id;
79:
80: CLOSE c_ship_to_info;
81:
82: IF (PO_LOG.d_proc) THEN
83: PO_LOG.proc_return(l_log_head, p_ship_to_org_id);
84: PO_LOG.proc_return(l_log_head, p_deliver_to_loc_id);
85: PO_LOG.proc_end(l_log_head);
86: END IF;
79:
80: CLOSE c_ship_to_info;
81:
82: IF (PO_LOG.d_proc) THEN
83: PO_LOG.proc_return(l_log_head, p_ship_to_org_id);
84: PO_LOG.proc_return(l_log_head, p_deliver_to_loc_id);
85: PO_LOG.proc_end(l_log_head);
86: END IF;
87:
80: CLOSE c_ship_to_info;
81:
82: IF (PO_LOG.d_proc) THEN
83: PO_LOG.proc_return(l_log_head, p_ship_to_org_id);
84: PO_LOG.proc_return(l_log_head, p_deliver_to_loc_id);
85: PO_LOG.proc_end(l_log_head);
86: END IF;
87:
88: EXCEPTION
81:
82: IF (PO_LOG.d_proc) THEN
83: PO_LOG.proc_return(l_log_head, p_ship_to_org_id);
84: PO_LOG.proc_return(l_log_head, p_deliver_to_loc_id);
85: PO_LOG.proc_end(l_log_head);
86: END IF;
87:
88: EXCEPTION
89: WHEN No_Data_Found THEN
987: --default the distribution for non req backing negotiations.The above
988: --insert only takes care of the interface lines which are backed by
989: --requisitions.
990: IF (PO_AUTOCREATE_PARAMS.g_interface_source_code='SOURCING') THEN
991: IF (PO_LOG.d_stmt) THEN
992: PO_LOG.stmt(g_log_head || l_api_name, l_progress, 'Defaulting dists interface for sourcing.');
993: END IF;
994:
995: l_progress:='120';
988: --insert only takes care of the interface lines which are backed by
989: --requisitions.
990: IF (PO_AUTOCREATE_PARAMS.g_interface_source_code='SOURCING') THEN
991: IF (PO_LOG.d_stmt) THEN
992: PO_LOG.stmt(g_log_head || l_api_name, l_progress, 'Defaulting dists interface for sourcing.');
993: END IF;
994:
995: l_progress:='120';
996:
996:
997: FOR i IN c_default_distribution
998: LOOP
999: --
1000: IF (PO_LOG.d_stmt) THEN
1001: PO_LOG.stmt(g_log_head || l_api_name, 190, 'i.interface_line_id', i.interface_line_id);
1002: END IF;
1003:
1004: IF (PO_AUTOCREATE_PARAMS.g_is_complex_work_po) THEN
997: FOR i IN c_default_distribution
998: LOOP
999: --
1000: IF (PO_LOG.d_stmt) THEN
1001: PO_LOG.stmt(g_log_head || l_api_name, 190, 'i.interface_line_id', i.interface_line_id);
1002: END IF;
1003:
1004: IF (PO_AUTOCREATE_PARAMS.g_is_complex_work_po) THEN
1005: l_progress:='121';
1050: i.ship_to_location_id ,
1051: l_ship_to_org_id
1052: );
1053:
1054: IF(PO_LOG.d_stmt) THEN
1055: PO_LOG.stmt( g_log_head || l_api_name, 190, 'Num rows inserted', SQL%ROWCOUNT);
1056: END IF;
1057:
1058: ELSE
1051: l_ship_to_org_id
1052: );
1053:
1054: IF(PO_LOG.d_stmt) THEN
1055: PO_LOG.stmt( g_log_head || l_api_name, 190, 'Num rows inserted', SQL%ROWCOUNT);
1056: END IF;
1057:
1058: ELSE
1059: -- non-complex work po from sourcing