Atif,
As Teddy replied Negative Consumption is what is normally used. Here is an overview that I was given by a technical developer who expanded the concept with code. Note that their are APP's that help with Co-product/By-Product production you might consider. My explanation below is from my NAV days so the concept is still the same though the technical explanation would be an extension today:
Having additional outputs on production orders (sometimes referred to as by-products or reclaimed material) is a common requirement. It could be scrap that should go back into inventory for further processing (melting it down, regrinding it, etc.…) or it could be multiple products that are produced at the same time in a process.
This can basically be handled in two ways in Dynamics NAV/BC:
- Negative Consumption
- Adding Production Order Line(s) for Multiple Outputs
In both ways you need to consider both the operational aspect and the inventory costs aspect. Option #1 is easier from an operational point of view since it allows defaulting an item in the Production BOM with a negative quantity and you can back flush it based on the output or have users enter the quantity that goes back into inventory manually. If the additional output should have an inventory value then the better option from an inventory cost aspect is #2 since with this option the additional output can have both Routing and Components that forwards the costs (option #1 is similar to making a positive adjustment from an costing perspective, which should be avoided). The downside with option #2 is that a user manually needs to enter the additional output on the production order. But like with everything else in Dynamics NAV/BC, we might be able to automate it by some simple adjustments to the code.
Something like this could be done:
Create a new table where the additional outputs related to each of the items being produced can be defined, call it ‘Additional Output’. In this table we can then list the additional items that are being produced together with a Production BOM and a Routing to be used to capture the costs.
In this example we are cutting 8 ft. bars (item ‘R114-8’) into 7 ft. bars (item ‘R114-7’) and during that process we also get 1 ft. bars (item ‘R114-1’), one for each time we cut a bar (trying to make it as simple as possible :-)). We define item ‘R114-1’ to be an additional output to item ‘R114-7’ in the new table like this:

The Production BOM ‘R114-1’ has 1/8 (0.125) of the 8 ft bar as a component.

The Routing ‘BACKFLUSH’ is a routing setup with the purpose of back flushing the output only (there are no capacity costs or scheduling involved).

The Production BOM for the 7 ft. bar has 7/8 (0.875) of the 8 ft. bar.

The Routing for producing the 7 ft. bar has some time and capacity costs attached to it (in this example we want all the capacity costs to be applied to the 7 ft. bar while the 1 ft. bar will only have material costs).

We then modify the Refresh function, by the following: In the ‘Copy’ function of the ‘99000787 – Create Prod. Order Lines’ codeunit we insert a call to a new function that will insert our Additional Output Line(s). In this case we called it ‘InsertAdditionalOutput’.

The function ‘InsertAdditionalOutput’ looks like this:

The code came from my programmer who I worked with.
Now when we refresh a production order for the 7 ft. bars we also get an additional output line with the 1 ft. bars with the Production BOM and Routing according to our new table. 
Since everything is set to backward flushing we just change the status to finished once the production is done and Dynamics NAV/BC will post all the consumption and outputs creating the following item transactions:

Above you can see that 1/8 of the material costs of the 8 ft. bar has been applied to the output of the 1 ft. bar. The 7 ft. bar has a cost equal to 7/8 of the 8 ft. bar plus the capacity costs defined in the routing.
Some things to note:
The planning worksheet (the MRP calculation) will not see the demand triggered by the additional outputs during its calculation, this demand will first show when the order is created.
The code above is for illustration only, use it on your own risk. I know that when you create production orders from the planning worksheet they are not refreshed the same way so this needs to be added as well to codeunit ‘99000813 – Carry Out Action’.
Total Cost Allocation for Multiple Outputs
To allocate the total costs posted against a production order towards multiple outputs is a bit tricky in standard Microsoft Dynamics NAV/BC, you more or less have to manually separate the different costs and post them against each of the production order lines (this since the cost calculations in Dynamics NAV/BC is per production order line).
For material and capacity costs this involves dividing the quantities consumed and times spent between the production order lines and then post them individually against each of the lines. And for subcontracting costs it is more or less impossible (although nothing is impossible in Dynamics NAV/BC, but this is close).
If you are in the business of taking things apart or you have processes that creates by-products, co-products or reclaimed material then you could consider modifying Dynamics NAV/BC to do the allocation of the costs based on factors defined through a setup. This would eliminate the need for manually allocating the costs on each production order and increase the accuracy and consistency of the inventory costs. Again you might consider an APP to achieve all of what I am notating.
Here is a conceptual design describing how this can be accomplished in Dynamics NAV/BC (which also would work well with functionality like the additional output functionality
Conceptual Design of Cost Allocation for Multiple Outputs
The code in Dynamics NAV/BC that summarizes the costs for a production order line and forwards it to the output is found in the cost adjustment functionality where it is done in two steps;
- The different costs related to each production order line are calculated and inserted into the Inventory Adjmt. Entry (Order) table.
- The costs in the Inventory Adjmt. Entry (Order) table are compared with the costs of the output item ledger entry(s). If a difference exists the output related item ledger entry(s) will be adjusted by creating value entries (the same was as any other cost for an item ledger entry is adjusted).
Knowing the above standard functionality, we can simply modify the code in the functionality for step 1 to consider all the costs posted against a production order and allocate it towards the different production order lines using defined allocation percentages.
Once step 1 above has been modified to allocate the costs, then step 2 will take care of adjusting the cost of the item ledger entry(s) without having to be modified.
An example of how it can be done; The production order line is extended with a Cost Allocation % field that will control how the cost is going to be allocated (most likely defaulted from the item card or from a setup table of some kind, there are as many variations of this as there are manufacturing companies). The total of the Cost Allocation % on a production order should always be 100 %.
Next you add the same Cost Allocation % field to the Adjmt. Entry (Order) table and write code to transfer the field from the production order line to the Adjmt. Entry (Order) table at the time the production order is change to finished.
Once the fields are in the database we can go and alter the cost adjustment function to allocate accordingly. This we do in the Calc. Inventory Adjmt. – Order codeunit (5896), where there is a function that handles the material costs (called CalcActualMaterialCosts) and another function that handles the capacity costs including subcontracting (called CalcActualCapacityCosts).
The code can for example be modified according to below. Where #1 eliminates the filter on the production order line (to get the total costs for the entire production order) and #2 adjusts the total costs according to the Cost Allocation % and the totals.
The same change is done for the capacity costs and the subcontracting costs (assuming we also want to include those costs in the allocation).
Example of Cost Allocation for FIFO Cost Item
We create a production order with multiple outputs, in this case four outputs using FIFO costing method (the same example is also applicable to average cost items). The production order in this case simulates a plastic injection molding process where a plastic fork, spoon and knife are produced at the same time. The process also creates some plastic that goes back into inventory to be re-grinded (e.g. the spure, gate and runner, if you are into plastic injection molding). The allocation of the costs is setup to be 30 % towards the forks, 29 % towards the spoons, 31 % towards the knifes and 10 % towards the regrind plastic.
Then we post the output for the different products. In this case we use the output journal where we enter the output quantities, scrap quantities and the times. Note that we now can enter the total time against one of the production order lines and Dynamics NAV/BC will later allocate the costs according to the percentages.
Next we post the consumption. Same here; we can enter the total quantity consumed against the first line and Dynamics NAV/BC will later allocate the costs according to the percentages.
The above creates the following item ledger entries with expected costs for the outputs and actual costs for the consumption (this is all standard Dynamics NAV/BC functionality).
And the following capacity ledger entries with the capacity costs (also standard Dynamics NAV/BC).
The total cost of production is then 189 (26.5 + 5 for consumed inventory and 105 + 52.5 for the capacity).
We finish the production order and run the costs adjustment batch job. After doing this we can review the costs of the outputs which now are as below. The total cost of 189 has been allocated by the cost adjustment batch job according to the percentages (30 %, 29 %, 31 % and 10 % of the total 189).
Now, let’s simulate that the costs of one of the consumed components changes and see what happens (better test this, just to be sure). We do this by revaluating the inbound transaction related to one of the consumed items. We use the revaluation journal and revalue the raw material from 0.5 to 0.6 per LBS.
Then we run the cost adjustment batch job again and the cost of the consumed raw materials has now changed which also revalued the outputs accordingly.
Now we can control the total cost allocation on production orders, and the values are also posted into the general ledger the same way (as in standard Dynamics NAV/BC which integrates the value entries with the general ledger).
Example of Cost Allocation for Standard Item
Test the same example but with standard cost items (since standard cost for produced items are common, especially in the US). We use a new set of items that has been setup with the costing method as standard and rolled-up with a production BOM and routing. The costs fields for the fork has been roll-up according to below.
Note that the cost allocation is only for the actual production costs posted against a production order, to do a cost roll-up for a standard cost item you also need to have a production BOM and routing for each of the items to have a correct standard cost rolled up.
We then create a new production order with the standard cost items and the same cost allocation percentages as before.
We post the consumption and output the same way as we posted them in the FIFO example, then we look at the item ledger entries. They obviously have the expected costs according to the standard costs.
We finish the production order and run the costs adjustment batch job. Now the expected costs has moved to the actual costs which are still the same as the standard costs.
But when making a drill-down into the value entries we can see that the variances has been adjusted according to the cost allocation percentages and the total actual cost. The material variance is 5.35 ((0.006 * 999) – (37.80 * 30 %)), the capacity variance is 15119.10 ((15.15 * 999) – (42.5 * 30 %)) and the capacity overhead variance is 30238.20 ((30.30 * 999) – (105 * 30 %)). This is the variances that will be posted into the P&L.
Defaulting Cost Allocation Percentages
If using that above approach then there are many ways of which the Cost Allocation % field on the production order lines can be defaulted. It can be according to the weight of the products (if they are all made from the same raw material for example), based on market material prices (if you are separating different metals for example), based on sales prices, etc.… So, how to develop that part of the setup will be from case to case depending on the business requirements.
Other things to consider is if the allocation should only be for material and not for capacity or subcontracting costs (or the opposite). In some cases it might even make sense to have multiple cost allocation fields on the production order line to define a percentage per cost type (e.g. one for material costs, one for capacity costs, one for subcontracting costs, etc.). In other cases the costs of only some of the operations should be allocated against certain outputs (if for example a co-product gets created at the initial operation while other co-products are created at later operations), in those cases it might be slightly more complex to define, but the concept still applies.
A modification like this is something you need to be 100 % sure that it is working as expected and that all scenarios are covered. Modifying the cost adjustment routine and create something that is not working perfectly is the last thing you want to do. THIS IS WHY I recommend looking at the APP to accomplish this.
Also note that if you use any kind of item tracking (lot or serial numbers) then you will not get the full trace-ability if you consume the complete quantity against only one of the production order lines. This since the trace-ability in Dynamics NAV/BC is by production order line.
Again, Negative Consumption gets the results you probably want. If you need the APP's names reply back.
Thanks,
Steve