AP发票导入(发票头行)

本文详细介绍了如何进行AP发票导入,包括将发票头数据插入ap_invoices_interface表,发票行数据插入ap_invoice_lines_interface表,以及运行APXIIMPT请求来完成导入流程。文中提供了一个具体的操作示例。
摘要由CSDN通过智能技术生成

     1.将发票头插入ap_invoices_interface中

     2.将发票行插入ap_invoice_lines_interface中

     3.运行发票导入请求 APXIIMPT


具体示例:

1.往接口表中插入数据

DECLARE
  l_iface_rec       ap_invoices_interface%ROWTYPE;
  l_iface_lines_rec ap_invoice_lines_interface%ROWTYPE;
  TYPE l_invoice_tbl_type IS TABLE OF cur_invoice%ROWTYPE INDEX BY BINARY_INTEGER;
  l_invoice_tbl l_invoice_tbl_type;
  CURSOR cur_invoice IS
  --1. 支付类型:非纯支付   收款方式:单收   
    SELECT temp.record_flag,
           temp.org_id,
           temp.req_number,
           temp.req_header_id,
           temp.vendor_id,
           temp.vendor_site_id,
           temp.req_coa_reg_code,
           temp.group_type_code,
           temp.doc_type_id,
           temp.req_apply_date,
           temp.req_emp_dept_code,
           temp.req_employee_id,
           temp.ebs_type_key,
           temp.doc_type_name,
           temp.src_system_id,
           temp.short_code,
           temp.src_system_name,
           temp.ap_terms_id,
           temp.terms_start_date,
           temp.currency_code,
           temp.comments,
           temp.payment_method_code,
           temp.pay_group_code,
           temp.payment_flag,
           temp.accts_pay_code_combination_id,
           temp.invoice_amount
      FROM (** ** 此处略去n行代码 ** **) temp
     ORDER BY temp.req_employee_id ASC;
BEGIN
  OPEN cur_invoice;
  LOOP
    FETCH cur_invoice BULK COLLECT
      INTO l_invoice_tbl LIMIT 5000;
    EXIT WHEN l_invoice_tbl.count = 0;
  
    FOR k IN l_invoice_tbl.first .. l_invoice_tbl.last
    LOOP
      --头
      l_iface_rec.org_id                   := l_invoice_tbl(k).org_id;
      l_iface_rec.invoice_type_lookup_code := l_invoice_type_lookup_code; --发票类型(CREDIT/STANDARD/PREPAYMENT/MIXED)
      l_iface_rec.invoice_date             := l_invoice_tbl(k)
                      
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值