oracle中的flag,MMT 表中的 Cost_Flag=E,如何解决?

原帖由 dkyo 于 2008-2-18 09:12 发表 thread-940221-1-1.html

上面那段update语句和重新提交效果是一样的。但依照你所说的,应该是仍然有错,处理不过去,不仅仅是costed_flag的问题了。再仔细查查原因

如LZ所说执行那段update语句和重新提交效果是一样的,处理不过去,查看“實際成本工作程式”运行情况出现警告,日志如下:

+---------------------------------------------------------------------------+

物料管理系統: Version : 11.5.0

Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.

CMCACW module: 實際成本工作程式

+---------------------------------------------------------------------------+

目前的系統時間是 18-02-2008 12:00:04

+---------------------------------------------------------------------------+

debug_level = 0

CM_EXTENDED_DEBUG = 2

After select into - parent_txn_id = 140085052

The transfer pricing option = 2

In inliar.lpc, inargtp()

... 建立移轉價格         txnId is 4114338

invOrgId is 120

itemId is 1348446

shipOrgId is 114

sellOrgId is 109

priceListId is 8100

internalOrderFlag is 1

baseItemId is 0

tmpIncrCurr is -1219838113

atoFlag is No

returned from External API...

calling QP API...

returned from QP API...

QP API returnStatus=E

取得移轉價格時發生錯誤

取得移轉價格時發生錯誤

Failing Transaction ID is 4114338

DS - Exit while loop.

+---------------------------------------------------------------------------+

從 FND_FILE 開啟日誌訊息

+---------------------------------------------------------------------------+

******** New Session:6265694****18-02-08:11.59.32 **********

[18-02-08 11:59:32] 9: QP is installed

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: Enabling QP debug option...

******** New Session:6265694****18-02-08:11.59.32 **********

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: QP trace file is /usr/tmp/l5112998.dbg

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: QP Version : /* $Header: QPXGPREB.pls 115.643.11510.16 2005/04/28 08:38:25 nirmkuma ship $ */

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Selecting Line Identifier...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_Transfer_price: p_transaction_id = 4114338

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_Transfer_price: p_order_line_id = -9999

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_Transfer_price: p_inventory_item_id = 1348446

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_Transfer_price: p_uom_code = 個

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_Transfer_price: p_cto_item_flag = N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_Transfer_price: p_organization_id = 120

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Selecting Header Identifier...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Selecting Primary UOM...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Building Global Structure...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: l_base_item_id is 0

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: p_cto_item_flag is N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.G_Hdr_Initialize: Populating G_HDR...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.G_Line_Initialize: Populating IC fields...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.G_Line_Initialize: Populating G_LINE...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.G_Line_Initialize: InventoryItemId=1348446

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: Ship From=120

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: Ship To=1074

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Build Context for line...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Populating Lines temp table...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: ORDER

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: -----------------------------------------------

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: line_index               => 49287

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: pricing_effective_date   => 25-01-08

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_first        =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_first_type   =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_second       =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_second_type  =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: line_quantity            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: line_uom_code            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: request_type_code        => IC

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICED_QUANTITY          =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICED_UOM_CODE          =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: CURRENCY_CODE            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: UNIT_PRICE               =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PERCENT_PRICE            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: UOM_QUANTITY             =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: ADJUSTED_UNIT_PRICE      =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: UPD_ADJUSTED_UNIT_PRICE  =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PROCESSED_FLAG           => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: price_flag               => Y

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: LINE_ID                  => 49287

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PROCESSING_ORDER         =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: pricing_status_code      => X

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICING_STATUS_TEXT      =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: ROUNDING_FLAG            => Y

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: ROUNDING_FACTOR          =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: QUALIFIERS_EXIST_FLAG    => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICING_ATTRS_EXIST_FLAG => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICE_LIST_ID            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: VALIDATED_FLAG           => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICE_REQUEST_CODE       => IC

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: USAGE_PRICING_TYPE       => REGULAR

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: LINE_CATEGORY            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: LINE

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: -----------------------------------------------

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: line_index               => 132855

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: pricing_effective_date   => 25-01-08

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_first        =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_first_type   =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_second       =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: active_date_second_type  =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: line_quantity            => 2

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: line_uom_code            => 個

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: request_type_code        => IC

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICED_QUANTITY          => 2

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICED_UOM_CODE          => 個

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: CURRENCY_CODE            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: UNIT_PRICE               =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PERCENT_PRICE            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: UOM_QUANTITY             =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: ADJUSTED_UNIT_PRICE      =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: UPD_ADJUSTED_UNIT_PRICE  =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PROCESSED_FLAG           => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: price_flag               => Y

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: LINE_ID                  => 83568

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PROCESSING_ORDER         =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: pricing_status_code      => X

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICING_STATUS_TEXT      =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: ROUNDING_FLAG            => Y

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: ROUNDING_FACTOR          =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: QUALIFIERS_EXIST_FLAG    => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICING_ATTRS_EXIST_FLAG => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICE_LIST_ID            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: VALIDATED_FLAG           => N

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: PRICE_REQUEST_CODE       => IC

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: USAGE_PRICING_TYPE       => REGULAR

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: LINE_CATEGORY            =>

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.Populate_Temp_Table: Calling QP:Bulk insert routine...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.Populate_Temp_Table: No. of records inserted in QP_PREQ_LINES_TMP=2

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Initializing control record...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: Calling QP:Price Request routine ...

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: QP_PREQ_PUB.PRICE_REQUEST error

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: x_return_status_text=QP_PREQ_PUB.Initialize_Constants Error : Currency can not be null

[18-02-08 11:59:32] INV_INTERCOMPANY_INVOICING: MTL_QP_PRICE.get_transfer_price: EXCEP G_EXC_ERROR

[18-02-08 11:59:32] 9: unitPrice is 0

+---------------------------------------------------------------------------+

從 FND_FILE 關閉日誌訊息

+---------------------------------------------------------------------------+

+---------------------------------------------------------------------------+

未請求任何完成選項.

輸出結果沒有印出, 因為:

此報表的列印選項已停用.

正在刪除輸出檔.

+---------------------------------------------------------------------------+

並行請求已完成

目前的系統時間是 18-02-2008 12:00:05

+---------------------------------------------------------------------------+

优化sql:SELECT we.organization_id ,we.wip_entity_id ,case when wl.line_id is null then we.wip_entity_name else '' end wip_entity_name ,we.primary_item_id ,mtt.transaction_type_name ,mmt.transaction_date ,bd.department_code ,mmt.inventory_item_id ,mmt.subinventory_code ,mta.reference_account ,br.resource_code ,lu2.meaning as line_type_name ,mta.base_transaction_value ,mta.cost_element_id ,flv.meaning as cost_element ,wdj.class_code job_type_code ,ml.meaning job_type_name FROM (select * from gerp.mtl_material_transactions where substr(transaction_date,1,7) >= '2023-06' and transaction_source_type_id = 5) mmt inner join gerp.wip_entities we on mmt.organization_id = we.organization_id inner join gerp.mtl_transaction_accounts mta on mta.transaction_source_id = we.wip_entity_id and mta.transaction_id = mmt.transaction_id and mta.transaction_source_type_id = 5 inner join gerp.mtl_transaction_types mtt on mtt.transaction_type_id = mmt.transaction_type_id inner join mfg_lookups lu2 on lu2.lookup_code = mta.accounting_line_type and lu2.lookup_type = 'CST_ACCOUNTING_LINE_TYPE' inner join gerp.mtl_system_items_b msi on msi.inventory_item_id = mmt.inventory_item_id and msi.organization_id = mta.organization_id left join gerp.bom_departments bd on bd.department_id = mmt.department_id left join gerp.bom_resources br on br.resource_id = mta.resource_id left join gerp.wip_lines wl on wl.line_id = mmt.repetitive_line_id left join gerp.wip_discrete_jobs wdj on wdj.wip_entity_id = mta.transaction_source_id left join gerp.fnd_lookup_values_vl flv on cast(mta.cost_element_id as string) = flv.lookup_code and flv.lookup_type = 'CST_COST_CODE_TYPE' left join mfg_lookups ml on ml.lookup_code = wdj.job_type and ml.lookup_type = 'WIP_DISCRETE_JOB' 。其mmt,we,mta,msi,wdj数据量很大
06-10
优化以下Oracle语句: SELECT SUBSTR(msn.serial_number, 1, 10) genset_sn, msi2.segment1 Genset_BOM_NUM, msi2.inventory_item_id, msi.segment1 key_component, mut1.serial_number component_sn, msi.description component_desc, wdj.date_completed, (SELECT MAX(aps.vendor_name) FROM ap_suppliers aps, bom_resources bor, mtl_unit_transactions mut, po_headers_all poh, po_lines_all pol, wip_osp_resources_val_v wor WHERE aps.vendor_id = poh.vendor_id AND bor.resource_id = wor.resource_id AND poh.po_header_id = pol.po_header_id AND pol.item_id = bor.purchase_item_id AND wor.wip_entity_id = mut.transaction_source_id AND mut.serial_number = mut1.serial_number AND mut.inventory_item_id = mut1.inventory_item_id AND mut.organization_id = mut1.organization_id AND mut.receipt_issue_type = 2 AND mut.transaction_source_type_id = 5 ) supplier FROM mtl_material_transactions mmt1, mtl_material_transactions mmt2, mtl_parameters mpa, mtl_serial_numbers msn, mtl_system_items msi, mtl_system_items msi2, mtl_transaction_types mtt1, mtl_transaction_types mtt2, mtl_unit_transactions mut1, mtl_unit_transactions mut2, wip_discrete_jobs_v wdj WHERE mmt1.inventory_item_id = mut1.inventory_item_id AND mmt1.organization_id = mut1.organization_id AND WDJ.PRIMARY_ITEM_ID = msi2.INVENTORY_ITEM_ID AND mmt1.transaction_id = mut1.transaction_id AND mmt1.transaction_source_id = wdj.wip_entity_id AND mmt1.transaction_type_id = mtt1.transaction_type_id AND mtt1.transaction_type_name = 'WIP Issue' AND NOT EXISTS (SELECT 'WIP Negative Issue or WIP Return' FROM mtl_material_transactions mmt3, mtl_transaction_types mtt3, mtl_unit_transactions mut3 WHERE mmt3.transaction_id = mut3.transaction_id AND mmt3.transaction_type_id = mtt3.transaction_type_id AND mmt3.transaction_date > mmt1.transaction_date AND mtt3.transaction_type_name IN ('WIP Negative Issue', 'WIP Return') AND mut3.serial_number = mut1.serial_number AND mut3.inventory_item_id = mut1.inventory_item_id) AND mmt2.transaction_id = mut2.transaction_id AND mmt2.transaction_source_id = wdj.wip_entity_id AND mmt2.transaction_type_id = mtt2.transaction_type_id AND mtt2.transaction_type_name = 'WIP Completion' AND mpa.organization_code = 'WHP' AND msn.current_organization_id = mpa.organization_id AND LENGTH(msn.serial_number) >= 10 AND msi.inventory_item_id = mmt1.inventory_item_id AND msi.organization_id = mmt1.organization_id AND (msi.planning_make_buy_code = 2 OR msi.segment1 LIKE 'SO%') AND mut2.serial_number = msn.serial_number AND mut2.inventory_item_id = msn.inventory_item_id AND mut2.organization_id = mpa.organization_id AND msi2.ORGANIZATION_ID = '323'
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值