码迷,mamicode.com
首页 > 其他好文 > 详细

账户别名杂出事务处理

时间:2014-09-25 01:19:07      阅读:455      评论:0      收藏:0      [点我收藏+]

标签:杂出   事务处理   账户   oracle ebs   transactions   


账户别名杂出事务处理

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   := 31;
        l_mtl_txn_itf_rec.organization_id       := i.organization_id;
        l_mtl_txn_itf_rec.inventory_item_id     := i.inventory_item_id; --l_mtl_txn_int_rec.inventory_item_id;
        l_mtl_txn_itf_rec.subinventory_code     := i.subinventory_code; --l_mtl_txn_int_rec.subinventory_code;
        l_mtl_txn_itf_rec.locator_id            := i.locator_id; --l_mtl_txn_int_rec.locator_id;
        l_mtl_txn_itf_rec.transaction_quantity  := i.onhand_quantity * -1; --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‘;*/
     
        l_mtl_txn_itf_rec.transaction_source_id := i.disposition_id; --l_mtl_txn_int_rec.transaction_source_id; -- 214 --账户别名 81: 12140  707: 12381  84: 1334
        -- 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;
     
        l_mtl_txn_lot_rec.transaction_interface_id := l_mtl_txn_itf_rec.transaction_header_id;
        l_mtl_txn_lot_rec.lot_number               := i.lot_number;
        l_mtl_txn_lot_rec.transaction_quantity     := i.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;
     
        --杂出事务处理
        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 ||
                     ‘ . 杂出处理失败.‘ || l_error_explanation;
       RAISE transaction_error;
     END IF ;

账户别名杂出事务处理

标签:杂出   事务处理   账户   oracle ebs   transactions   

原文地址:http://blog.csdn.net/gh320/article/details/39530131

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!