Account alias receiving Transaction Processing

Source: Internet
Author: User
Zookeeper

-- Account alias reception
Select mtl_material_transactions_s.nextval
Into l_mtl_txn_itf_rec.transaction_interface_id
From dual;
L_mtl_txn_itf_rec.transaction_header_id: = l_mtl_txn_itf_rec.transaction_interface_id;
L_mtl_txn_itf_rec.transaction_mode: = 3;
L_mtl_txn_itf_rec.process_flag: = 1;
L_mtl_txn_itf_rec.transaction_type_id: = 41;
L_mtl_txn_itf_rec.transaction_source_id: = I. disposition_id;
L_mtl_txn_itf_rec.organization_id: = I. organization_id;
L_mtl_txn_itf_rec.inventory_item_id: = I. n_inventory_item_id; -- l_mtl_txn_int_rec.inventory_item_id;
L_mtl_txn_itf_rec.subinventory_code: = I. n_subinventory_code; -- l_mtl_txn_int_rec.subinventory_code;
L_mtl_txn_itf_rec.locator_id: = I. n_locator_id; -- l_mtl_txn_int_rec.locator_id;
L_mtl_txn_itf_rec.transaction_quantity: = I. n_onhand_quantity; -- l_mtl_txn_int_rec.transaction_quantity;
L_mtl_txn_itf_rec.transaction_uom: = I. uom_code; -- l_mtl_txn_int_rec.uom_code;
L_mtl_txn_itf_rec.transaction_date: = nvl (I. transaction_date, sysdate); -- l_mtl_txn_int_rec.onhand_creation_date/* g_date */

/* L_mtl_txn_itf_rec.source_header_id: = NULL; -- l_mtl_txn_itf_rec.transaction_header_id;
L_mtl_txn_itf_rec.source_line_id: = NULL; -- l_mtl_txn_itf_rec.transaction_header_id;
L_mtl_txn_itf_rec.source_code: = NULL; -- 'cux _ wms_mtl_txn_in ';*/

-- Who Column
L_mtl_txn_itf_rec.last_update_date: = sysdate;
L_mtl_txn_itf_rec.last_updated_by: = g_user_id;
L_mtl_txn_itf_rec.creation_date: = sysdate;
L_mtl_txn_itf_rec.created_by: = g_user_id;
L_mtl_txn_itf_rec.last_update_login: = g_login_id;

L_mtl_txn_itf_rec.source_code: = p_source_code;
L_mtl_txn_itf_rec.source_header_id: = p_source_line_id;
L_mtl_txn_itf_rec.source_line_id: = p_source_line_id;
Insert into mtl_transactions_interface values l_mtl_txn_itf_rec;

-- Batch
L_mtl_txn_lot_rec.transaction_interface_id: = l_mtl_txn_itf_rec.transaction_header_id;
L_mtl_txn_lot_rec.lot_number: = I. n_lot_number;
L_mtl_txn_lot_rec.transaction_quantity: = I. n_onhand_quantity;
L_mtl_txn_lot_rec.last_update_date: = sysdate;
L_mtl_txn_lot_rec.last_updated_by: = g_user_id;
L_mtl_txn_lot_rec.creation_date: = sysdate;
L_mtl_txn_lot_rec.created_by: = g_user_id;
L_mtl_txn_lot_rec.last_update_login: = g_login_id;
Insert into mtl_transaction_lots_interface values l_mtl_txn_lot_rec;

-- Account alias receiving Transaction Processing
X_retval: = inv_txn_manager_pub.process_transactions (p_api_version => 1,
P_init_msg_list => fnd_api.g_true,
P_commit => fnd_api.g_false, -- not commit
P_validation_level => fnd_api.g_valid_level_full,
X_return_status => l_return_status,
X_msg_count => l_msg_count,
X_msg_data => l_msg_data,
X_trans_count => x_trans_count,
P_table => 1,
P_header_id => l_mtl_txn_itf_rec.transaction_interface_id );

If x_retval <> 0 then
Select MTI. error_explanation
Into l_error_explanation
From mtl_transactions_interface MTI
Where 1 = 1
And MTI. transaction_interface_id =
L_mtl_txn_itf_rec.transaction_interface_id
And rownum = 1;
X_msg_data: = 'error in inv_txn_manager_pub.process_transactions: '|
'Transaction header ID: '|
L_mtl_txn_itf_rec.transaction_interface_id | '. Receiving failed.' |
Rochelle _ explanation;
Raise transaction_error;
End if;

Account alias receiving Transaction Processing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.