TRANSACTION_HEADER_ID & TRANSACTION_BATCH_ID & TRANSACTION_BATCH_SEQ

MTL_TRANSACTIONS_INTERFACE和MTL_MATERIAL_TRANSACTIONS_TEMP有三个类似的字段:TRANSACTION_HEADER_ID & TRANSACTION_BATCH_ID & TRANSACTION_BATCH_SEQ

以下为eTRM里关于这三个字段的解释:

TRANSACTION_HEADER_ID:Transaction group identifier and Workers, only user-specified values will be ignored.

TRANSACTION_BATCH_ID:Batch id for transaction

TRANSACTION_BATCH_SEQ:Batch sequence for transaction


从字面上看,三个字段意思似乎是一样的,但其实三个字段有不同的分工。

TRANSACTION_HEADER_ID

INV Manager的校验会把同样transaction_header_id的一批记录一起丢到代码中校验和处理。

Package inv_txn_manager_pub
...
   -----------------------------------------------------------------------
   -- Name : validate_group
   -- Desc : Validate a group of MTI records in a batch together.
   --          This is called from process_transaction() when TrxMngr processes
   --          a batch of records
   -- I/P params :
   --     p_header_id : transaction_header_id
   -----------------------------------------------------------------------
   PROCEDURE validate_group(p_header_id NUMBER
                                ,x_return_status OUT NOCOPY VARCHAR2
                                ,x_msg_count OUT NOCOPY NUMBER
                                ,x_msg_data OUT NOCOPY VARCHAR2
                                ,p_userid NUMBER DEFAULT -1
                ,p_loginid NUMBER DEFAULT -1);



   -----------------------------------------------------------------------
   -- Name : validate_lines (wrapper)
   -- Desc : Validate each record of a batch in MTI .
   --        This procedure acts as a wrapper and calls the inner validate_lines.
   --
   -- I/P params :
   --     p_header_id : transaction_header_id
   --     p_validation_level : Validation level
   -----------------------------------------------------------------------
   PROCEDURE validate_lines(p_header_id NUMBER,
                           p_commit VARCHAR2 := fnd_api.g_false     ,
                           p_validation_level NUMBER  := fnd_api.g_valid_level_full  ,
                           x_return_status OUT NOCOPY VARCHAR2,
                           x_msg_count OUT NOCOPY NUMBER,
                           x_msg_data OUT NOCOPY VARCHAR2,
                           p_userid NUMBER DEFAULT -1,
                           p_loginid NUMBER DEFAULT -1,
                           p_applid NUMBER DEFAULT NULL,
                           p_progid NUMBER DEFAULT NULL);
...


TRANSACTION_BATCH_ID & TRANSACTION_BATCH_SEQ

Refer:bug 3663786

In 11.5.10 transaction_group_id and transaction_group_seq are not used.
Instead,transaction_batch_id and transaction_batch_seq are used.
So, one can start using the batch id and the batch seq to achieve the purpose.

The transaction worker would pick up everything in a batch and process them together as per the sequence number.However, if anything in that batch fails, it will rollback all the transactions in that batch. That is the current architecture.

All these values should be populated in the MTL_TRANSACTIONS_INTERFACE table.

You can populate the sequence value to the transaction_batch_seq column and the batch_id to the transaction_batch_id to column.

However, all the transactions belonging to a batch should all have the same transaction_header_id.
The inventory transaction manager picks up all the records for a specific header and then processes everything in a batch together.


So, a single header may have multiple batches but, if one record fails, we only fail that batch and not the other batches.

So, for the records to be processed in certain order
1. They all should have the same transaction_header_id
2. They all should have the same transaction_batch_id
3. They should have a transaction_batch_seq in the order they have to be processed.

you can leave the transaction batch seq as null. If you want the records to error out

1)You should have the same transaction_header_id
2)You should have the same transaction batch id.



你可能感兴趣的:(transaction)