此种问题多数为COGS(Cost of Goods Sold:销售成本)不存在导致的.
首先要检查订单中的ITEM对应的COGS,目前本系统(Account Generator)生成COGS是这样的
Sales person. transaction type. item,故采取如下SQL来检查/
==================================
SELECT oeh.order_number "Order_Number", item.segment1 "Item_Code",
ool.line_number || '.' || ool.shipment_number "Line_Number",
( gcc2.segment1
|| '.'
|| gcc2.segment2
|| '.'
|| gcc2.segment3
|| '.'
|| gcc1.segment4
|| '.'
|| gcc3.segment5
) "CCID",
DECODE ((SELECT 'TRUE'
FROM gl.gl_code_combinations gcc4
WHERE ( gcc2.segment1
|| '.'
|| gcc2.segment2
|| '.'
|| gcc2.segment3
|| '.'
|| gcc1.segment4
|| '.'
|| gcc3.segment5
) =
( gcc4.segment1
|| '.'
|| gcc4.segment2
|| '.'
|| gcc4.segment3
|| '.'
|| gcc4.segment4
|| '.'
|| gcc4.segment5
)),
'TRUE', 'Exists',
'Not Exists'
) "CCID_Status"
FROM ont.oe_order_headers_all oeh,
ont.oe_order_lines_all ool,
jtf.jtf_rs_salesreps sp,
ont.oe_transaction_types_all oet,
gl.gl_code_combinations gcc1,
gl.gl_code_combinations gcc2,
gl.gl_code_combinations gcc3,
inv.mtl_system_items_b item
WHERE oeh.salesrep_id = sp.salesrep_id
AND oeh.order_type_id = oet.transaction_type_id
AND oet.cost_of_goods_sold_account = gcc1.code_combination_id
AND sp.gl_id_rev = gcc2.code_combination_id
AND item.cost_of_sales_account = gcc3.code_combination_id
AND oeh.header_id = ool.header_id
AND ool.inventory_item_id = item.inventory_item_id
AND oeh.order_number = '&order_number '
AND oeh.org_id = '&ou'
AND item.organization_id = '&org_id' --订单行中的ITEM对应的ORG
如果反复接收不成功时,会在po.rcv_transactions_interface中产生错误记录,一般都要手工删除.
如果SQL返回值有'Not Exists',则需要定义该行返回的Account Combination,
然后重新接收即可完成.
阅读(2329) | 评论(0) | 转发(0) |