DBA Data[Home] [Help]

TYPE BODY: APPS.PO_CHANGES_REC_TYPE

Source


1 TYPE BODY po_changes_rec_type AS
2   /**
3   * Name: create_object
4   * Function:
5   *   Creates a PO_CHANGES_REC_TYPE object for the given document with the
6   *   given line, shipment, and distribution changes.
7  **/
8   STATIC FUNCTION create_object (
9     p_po_header_id         NUMBER,
10     p_po_release_id        NUMBER,
11     p_line_changes         PO_LINES_REC_TYPE,
12     p_shipment_changes     PO_SHIPMENTS_REC_TYPE,
13     p_distribution_changes PO_DISTRIBUTIONS_REC_TYPE
14   ) RETURN po_changes_rec_type
15   AS
16     l_changes PO_CHANGES_REC_TYPE;
17   BEGIN
18     l_changes := PO_CHANGES_REC_TYPE (
19       po_header_id         => p_po_header_id,
20       po_release_id        => p_po_release_id,
21       line_changes         => p_line_changes,
22       shipment_changes     => p_shipment_changes,
23       distribution_changes => p_distribution_changes
24     );
25 
26     IF (l_changes.line_changes IS NULL) THEN
27       l_changes.line_changes := PO_LINES_REC_TYPE.create_object();
28     END IF;
29 
30     IF (l_changes.shipment_changes IS NULL) THEN
31       l_changes.shipment_changes := PO_SHIPMENTS_REC_TYPE.create_object();
32     END IF;
33 
34     IF (l_changes.distribution_changes IS NULL) THEN
35       l_changes.distribution_changes :=
36         PO_DISTRIBUTIONS_REC_TYPE.create_object();
37     END IF;
38 
39     RETURN l_changes;
40   END;
41 
42   /**
43   * Name: dump_to_log
44   * Function:
45   *   Writes the contents of this object to the FND log.
46   * Notes:
47   * This procedure is for debugging purposes only.
48   **/
49   MEMBER PROCEDURE dump_to_log
50   IS
51     l_msg VARCHAR2(2000);
52   BEGIN
53     l_msg := 'PO_CHANGES_REC_TYPE: ';
54     l_msg := substrb(l_msg || 'po_header_id ' || po_header_id, 1, 2000);
55     l_msg := substrb(l_msg || '; po_release_id ' || po_release_id, 1, 2000);
56 
57     FND_LOG.string( FND_LOG.LEVEL_STATEMENT,
58                     'po.plsql.PO_CHANGES_REC_TYPE.dump_to_log',
59                     l_msg );
60 
61     line_changes.dump_to_log;
62     shipment_changes.dump_to_log;
63     distribution_changes.dump_to_log;
64   END dump_to_log;
65 
66 END;