物料事務處理interface與temp解析

MTL_TRANSACTIONS_INTERFACE併發

MTL_TRANSACTIONS_INTERFACE is the interface point betweenapp

non– Inventory applications and the Inventory transaction module.ide

Transaction Manager concurrent program polls this table at aflex

user–specified process interval, and submits the Transaction Workers tothis

process them. Processing consists of data derivation, validation, andspa

transfer of records from MTL_TRANSACTIONS_INTERFACE,code

MTL_TRANSACTION_LOTS_INTERFACE, andorm

MTL_SERIAL_NUMBERS_INTERFACE into their respective TEMP接口

tables, from where they are processed by the transaction processor.事務

MTL_TRANSACTIONS_INTERFACE follows the Inventory standard

for interfacing flexfields. Any parameters which are represented by

flexfields may be entered in the interface table either as code

combination identifiers or as flexfield segment combinations. The

Transaction Worker will validate that any given identifiers are valid

and enabled. If no identifier is given, then the Transaction Worker will

validate and decode the flexfield segment values, and where

appropriate, create new flexfield combinations in the database.

The Transaction Manager picks up the rows to process based on the

LOCK_FLAG, TRANSACTION_MODE, PROCESS_FLAG to

manipulate the records in the table. Only records with

TRANSACTION_MODE of 3, LOCK_FLAG of ’2’, and

PROCESS_FLAG of ’1’ will be picked up by the Transaction Manager

and assigned to a Transaction Worker. If a record fails to process

completely, then PROCESS_FLAG will be set to ’3’ and ERROR_CODE

一、Interface是鏈接非庫存系統與庫存系統的橋樑

二、Interface的數據常常事務管理併發處理後,將插入對應的臨時表,再由事務處理器處理。

三、數據處量條件限制請見左邊

MTL_MATERIAL_TRANSACTIONS_TEMP

MTL_MATERIAL_TRANSACTIONS_TEMP is the gateway for all

material transactions.

Records are processed from this table into Inventory through the

transaction processor. All Inventory transaction forms write directly to

this table. Outside applications must write transaction records to

MTL_TRANSACTIONS_INTERFACE to be processed through

MTL_MATERIAL_TRANSACTIONS_TEMP and the transaction

processor by the Transaction Worker concurrent program.

Lots and serial numbers for a

MTL_MATERIAL_TRANSACTIONS_TEMP(MMTT) record are stored

in the tables MTL_TRANSACTION_LOTS_TEMP(MTLT) and

MTL_SERIAL_NUMBERS_TEMP(MSNT). If the item is under lot

control, then MMTT.TRANSACTION_TEMP_ID joins to

MTLT.TRANSACTION_TEMP_ID. If the item is also under serial

number control, then MTLT.SERIAL_TRANSACTION_TEMP_ID joins

to MSNT.TRANSACTION_TEMP_ID. If the item is only under serial

number control, then MMTT.TRANSACTION_TEMP_ID joins to

MSNT.TRANSACTION_TEMP_ID.

Transfer transactions are stored in this table as a single record. The

transaction processor creates two transactions from the single record.

看看左邊的紅色標識的話:全部事務處理的必經的步驟。

 

全部插入事務處理正式表的數據,都必須通過TEMP表後,(自動)運行Transaction Processor後插入正式表。

 

從Oracle官方給出的解釋,咱們能夠基本上獲得以下一個邏輯圖:

若是照上圖描述,那麼,咱們可否經過一些實例來來講明或者說證實咱們的想法呢?

   

   1、先了解它

 

首先,咱們明確一下這兩個表:

   臨時表: MTL_MATERIAL_TRANSACTIONS_TEMP (如下簡稱TEMP表)

   接口表: MTL_TRANSACTIONS_INTERFACE      (如下簡稱INTERFACE表)

  

  

1)   Interface

·直接插入數據入接口表。這裏面有幾個須要注意的地方:

  

 

字段

描述

Source_code, Source_header_id, Source_line_id

來源行,供追溯使用,能夠隨便填

transaction_source_name

事務處理來源名稱,能夠隨便指定。

PROCESS_FLAG

transaction is ready to be processed by the Transaction

Manager or Worker (’1’ for ready, ’2’ for not ready); if

the transaction fails for some reason, the Transaction Worker sets the value of PROCESS_FLAG to ’3’

TRANSACTION_MODE

the transaction is to be processed in immediate

concurrent processing mode (2) or background processing mode(3)

LOCK_FLAG

Flag indicating whether the transaction is locked by the

Transaction Manager or Workers (’1’ for locked, ’2’ or NULL

for not locked); this prevents two different Workers from

processing the same transaction; You should always specify ’2’

TRANSACTION_TYPE_ID

Transaction type identifier,這裏要注意一下的是,若是你是作作雜項處理,那麼,若是事務處理數據小於0,那麼應該指定爲32(Miscellaneous issue),反之則爲42(Miscellaneous receipt)

Organization_id

Inventory_item_id

subinventory_code

locator_id

revision

transfer_organization

transfer_subinventory

指定傳送倉庫及物品有關的信息,若是這些值有,請指定。

transaction_quantity

transaction_uom

transaction_cost

transaction_date

指定事務處理的數量、單位、成本等信息,成本的話,若是指定爲NULL,系統會以事務處理器運行時的成本出(入)庫。請慎重指定。

distribution_account_id

若是是雜項出入庫,請指定庫存成本賬戶,若是是賬戶別名出入庫,則需指定。

WHO 字段

須要指定

  

插入數據完成後,那麼,按咱們的流程,須要進行TransactionProcessor,進行後續數據處理

簡稱:INCTCM

參數:無

提交語句Sample:

   l_request_id    := fnd_request.submit_request('INV',

                                              'INCTCM',

                                              '',

                                              to_char(sysdate,'YYYY/MM/DDHH24:MI:SS'),

                                              false,

                                              chr(0))

 

1)   TEMP

在INV的內部處理中,系統都會直接將Process插入至TEMP表,再經過自動請求TransactionProcessor,將數據導入至正式表中。

直接插數據入TEMP表通常存在於INV模塊,不過,ORACLE官方並不太支持這種方式,「Load thetransaction records into MTL_TRANSACTIONS_INTERFACE table .Loading thetransaction records directly into MTL_MATERIAL_TRANSACTIONS_TEMP table is notsupported.」

那麼,能不能這麼作呢?

其實,Oracle這句話是正確的,人家是說「你能夠直接插MTI,但你不能直接插數據入MMTT」。

由於這二者有區別的:MMTT表是聯機處理用的,也就是說是form經過API往裏面寫數據並能夠用API直接處理的,MTI表是接口表,裏面的數據是經過Conc Req轉到MMTT中並經過txn worker來處理的。

 

首先來講MMTT的API,咱們隨機打開了一個RORM-雜項事務處理FORM,它的主BLOCK就是基於MMTT的,在Trigger Pre-Insert中,寫了不少前期處理的操做:如取Temp transactionid,若是系統啓用了批次/序列,須要在LOT的BLOCK中先寫入相關的信息。插表的操做即經過標準APIAPP_STANDARD.KEY_COMMIT來完成,將數據保存至MMTT中。

因此,我以爲(沒實驗過)咱們徹底能夠模仿ORACLE標準FORM來往MMTT中插入數據,可是,這前期涉及的針對批次、序列的處理可能會至關煩鎖,若是沒有這些麻煩,往MMTT中插數據可能與MTI中插數據同樣簡單。

在這裏我先將TEMP表幾個關鍵字段列出來:

字段

描述

TRANSACTION_HEADER_ID

TRANSACTION_TEMP_ID

Header_id爲主鍵,即MMTT的KEY,TEMP ID無關緊要,即將來的Transaction ID

TRANSACTION_SOURCE_TYPE_ID

固定值,通常有以下值

1 Purchase order

2 Sales order

3 Account number

4 Job or schedule

5 Job or schedule

6 Account alias

SOURCE_CODE

SOURCE_LINE_ID

來源碼和來源行ID

TRANSACTION_MODE

the transaction is to be processed in immediate

concurrent processing mode (2) or background processing mode(3)

LOCK_FLAG

Flag indicating whether the transaction is locked by the

Transaction Manager or Workers (’1’ for locked, ’2’ or NULL

for not locked); this prevents two different Workers from

processing the same transaction; You should always specify ’2’

TRANSACTION_TYPE_ID

Transaction type identifier,這裏要注意一下的是,若是你是作作雜項處理,那麼,若是事務處理數據小於0,那麼應該指定爲32(Miscellaneous issue),反之則爲42(Miscellaneous receipt)

Organization_id

Inventory_item_id

subinventory_code

locator_id

revision

transfer_organization

transfer_subinventory

指定傳送倉庫及物品有關的信息,若是這些值有,請指定。

transaction_quantity

transaction_uom

transaction_cost

transaction_date

指定事務處理的數量、單位、成本等信息,成本的話,若是指定爲NULL,系統會以事務處理器運行時的成本出(入)庫。請慎重指定。

distribution_account_id

若是是雜項出入庫,請指定庫存成本賬戶,若是是賬戶別名出入庫,則需指定。

WHO 字段

須要指定

相關文章
相關標籤/搜索