Sale Order interface example

---Header

INSERT INTO oe_headers_iface_all
            (transactional_curr_code,
             sold_to_org_id,
             sold_from_org_id,
             ship_to_org_id,
             shipping_method_code,
             freight_terms,
             salesrep_id,
             price_list_id,
             payment_term_id,
             orig_sys_document_ref,
             org_id,
             order_type_id,
             order_source_id,
             order_number,
             order_category,
             ordered_date,
             operation_code,
             last_update_login,
             last_update_date,
             last_updated_by,
             creation_date,
             created_by,
             invoice_to_org_id,
             booked_flag,
             attribute2,
             attribute3,
             attribute4,
             CONTEXT)
          VALUES
            (l_currency_code,
             l_sold_to_org_id,
             l_org_id,
             l_ship_to_org_id,
             l_shipping_method_code,
             'Prepay & Add',
             l_salesrep_number,
             l_price_list_id,
             l_payterm_id,
             'OE_ORDER_HEADERS_ALL00' || l_pii_no,
             l_org_id,
             l_transaction_type_id,
             l_source_id,
             l_pii_no,
             'ORDER',
             r.received_date,
             'INSERT',
             -1,
             l_start_time,
             -1,
             l_start_time,
             -1,
             l_invoice_to_org_id,
             l_booked_flag,
             r.oppty_row_id,
             r.sales_region,
             r.oppty_p_and_l,
             'OG_PII_EDEL_NOSHIP_US');

---Line

 INSERT INTO oe_lines_iface_all
                  (order_source_id,
                   orig_sys_document_ref,
                   orig_sys_line_ref,
                   -- orig_sys_shipment_ref,
                   org_id,
                   line_number,
                   shipment_number,
                   line_type_id,
                   inventory_item_id,
                   ordered_quantity,
                   order_quantity_uom,
                   invoice_to_org_id,
                   price_list_id,
                   unit_selling_price,
                   unit_list_price,
                   payment_term_id,
                   shipping_method_code,
                   freight_terms,
                   attribute2,
                   attribute3,
                   attribute5,
                   attribute6,
                   request_date,
                   schedule_ship_date,
                   operation_code,
                   last_update_login,
                   last_update_date,
                   last_updated_by,
                   creation_date,
                   created_by,
                   CONTEXT,
                   calculate_price_flag)
                VALUES
                  (l_source_id,
                   'OE_ORDER_HEADERS_ALL00' || l_pii_no,
                   --  'OE_ORDER_LINES_ALL999995001',
                   'OE_ORDER_LINES_ALL' || l_pii_no || '00' ||
                   l_line_number || '00' || 1,
                   l_org_id,
                   l_line_number, -- line number
                   1, --- shipment number
                   l_transaction_type_id,
                   l_item_id,
                   1,
                   'EA',
                   l_invoice_to_org_id,
                   l_price_list_id,
                   r.cms_price, -- selling amount
                   0, -- list amount
                   l_payterm_id,
                   l_shipping_method_code,
                   'Prepay & Add',
                   r.section, -- section
                   r.line_description,
                   decode(r.product_status,
                          'Won-LOI',
                          'WON_LOI',
                          'LOI',
                          'WON_LOI',
                          'Won-PO',
                          'WON_PO',
                          'Abandoned',
                          'CANCELLED',
                          r.product_status), -- status
                   l_offering_id, --- offering id
                   l_start_time,
                   r.expected_delivery_date,
                   'INSERT',
                   -1,
                   l_start_time,
                   -1,
                   r.creation_date,
                   -1,
                   'OG_PII_EDEL_NOSHIP_US_LINE',
                   'N');

---Submit the Interface request.

v_request_id := apps.fnd_request.submit_request('ONT',
                                                    'OEOIMP',
                                                    NULL,
                                                    SYSDATE,
                                                    FALSE,

                                                    L_ORG_ID, --Add for r12
                                                     l_source_id,
                                                    NULL,
                                                    NULL,
                                                    'N',
                                                    1,
                                                    4,
                                                    NULL,
                                                    NULL,
                                                    NULL,
                                                    'Y',
                                                    'N',
                                                    'Y'

                                                    l_org_id,-- add for r12

                                                     'Y' ---Add for r12

                                                     );
    COMMIT;
    IF v_request_id <> 0 THEN
      v_finished := apps.fnd_concurrent.wait_for_request(request_id => v_request_id,
                                                         INTERVAL   => v_interval,
                                                         max_wait   => 0,
                                                         phase      => v_phase,
                                                         status     => v_status,
                                                         dev_phase  => v_request_phase,
                                                         dev_status => v_request_status,
                                                         message    => v_message);
      COMMIT;
    END IF;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/269025/viewspace-1226371/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/269025/viewspace-1226371/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值