By line item
An SDQ segment problem may occur when mapping from purchase orders by line item to invoices by store.
You may have an input transmission that may contain multiple interchanges from your trading partner who sends you EDI purchase orders. A purchase order may be organized so that each line item identifies a set of stores that receive some quantity of the merchandise identified in that line item.
Your trading partner wants you to send an interchange for each store. The interchange must include one invoice for each inbound purchase order that references that store. Each invoice includes only the line items relevant to that particular store. You may want to receive invoices, one interchange for each store.
There are two inbound purchase orders that refer to store #0100, so the interchange for that store has two invoices. Each invoice for store #0100 references just those line items of the purchase order that had store #0100 identified in an SDQ Segment that was part of that line item.
The executable map, SDQ, has two inputs and two outputs. The inputs are an EDI transmission containing purchase orders, and a trading partner profile. The outputs are an EDI transmission containing invoices, and the updated trading partner profile.