PDA

View Full Version : Connecting lot_id and doc_id in ic_trns_pnd



maorp
01-31-2008, 08:03 AM
I am trying to build a sql querry, which will connect materials consumed in a batch (which are themselves creted in a batch) with the batch that created them.
currently I'm connecting IC_TRNS_PND material line (Doc_id=a,line_type=-1, doc_type='PROD', lot_id=x) and It's respected IC_TRNS_PND product line (Doc_id=b, line_type=1, doc_type='PROD', lot_id=x).

this join between 2 IC_TRNS_PND tables is very costy. Is there a table which hold the relation between lot_id (as a material) and the doc_id (as a manufactured Item)?

abhikpanda
02-25-2008, 10:17 PM
Hi,

what I understand is: if u consider doc_id for both the line type(1 & -1), it will corrospond to batch ingre & product.
U can consider another table like gme_batch_header where batch_id and ic_tran_pnd, doc_id has same value.Means batch id = doc id, by this u can have another relation.

Please update the thread, if I am wrong..

Cheers
Abhik