Saturday, May 7, 2011

Reservation Creation and Importance of MTL_SALES_ORDERS

We can use following Standard API to create reservation programatically.
INV_RESERVATION_PUB.CREATE_RESERVATION(
                               x_return_status             => x_return_status,
                               x_msg_count                 => x_msg_count,
                               x_msg_data                  => x_msg_data,
                               x_serial_number             => l_dummy_sn,
                               x_quantity_reserved       => l_quantity_reserved,
                               x_reservation_id             => l_reservation_id,
                               p_api_version_number     => 1.0,
                               p_init_msg_lst                => FND_API.G_FALSE,
                               p_rsv_rec                      => l_reservation_record,
                               p_partial_reservation_flag => FND_API.G_TRUE,
                               p_force_reservation_flag  => FND_API.G_TRUE,
                               p_serial_number              => l_dummy_sn,
                               p_validation_flag             => FND_API.G_TRUE);

Following are two important input parameters:
l_reservation_record.demand_source_header_id  :=  ??;
l_reservation_record.demand_source_line_id       :=  line_id;

While calling above procedure, one must pass SALES_ORDER_ID from MTL_SALES_ORDERS table instead of Order HEADER_ID from OE_ORDER_HEADERS_ALL for input parameter l_reservation_record.demand_source_header_id


About  MTL_SALES_ORDERS Table from Oracle ETRM:

MTL_SALES_ORDERS stores Inventory's local definition of sales orders.

Unlike account numbers which are stored as flexfields in GL_CODE_COMBINATIONS, or purchase orders which are stored in PO_HEADERS, sales orders are not assumed to originate in any particular application. MTL_SALES_ORDERS exists for the purpose of mapping sales orders between other applications and Inventory.

MTL_SALES_ORDERS is a key flexfield table with no structure defining column or set defining column. The flexfield code for this table is MKTS. Only one structure for the flexfield may be defined for any installation of Inventory. Inventory demand interface and demand manager will validate sales orders on segment values, and will create a new SALES_ORDER_ID when necessary.
Related Posts Plugin for WordPress, Blogger...