CU99000854 – States on the planning process
Not sure if you are familiar with this. But, I believe it worths covering it …
During NAV planning, the logic goes through different steps in the planning cycle: StartOver, MatchDates, MatchQty, CreateSupply, ReduceSupply, CloseDemand, CloseSupply, CloseLoop. All these steps are being performed on the PlanItem procedure from CU99000854. The way planning goes through each of these steps depends on the reordering policy. But basically:
First state is StartOver which determines if there is any demand to plan for. If so, it try to determines if there is any supply. If this is the case, next state would be MatchDates. If no supply exists, next state would be CreateSupply. If there is no other demand to plan for, next state would be ReduceSupply (if any exists) or CloseLoop (to finalize the loop through all states).
MatchDates state. This is about matching demand and supply dates to make sure that both can be plan together (ie. supply can be used to meet demand). If cannot be met, next state would be CreateSupply (another supply needs to be created). If it can, the existing untracked quantity in the supply needs to be reduced and state would be ReduceSupply.
MatchQty state. If supply quantity is not enough, it needs to be closed (no more available) through CloseSupply state. If this is a supply where quantity can be increased, then CloseDemand state can be next.
CreateSupply state. This is the step where supply will be created depending on the policy.
ReduceSupply state. Here, the untracked (unnecessary) quantity will be reduced from the supply. Next state would be to close the supply.
CloseDemand state. In here, the demand will be closed which means that demand has been planned for. The next thing (state) to do here would be StartOver to start the planning of another demand.
CloseSupply state. This is similar than CloseDemand state but from the supply perspective. If supply has been entirely planned, another supply needs to be considered and StartOver state will be next.
CloseLoop state. This is where planning finalizes. Before doing that, it will determine if ROP has been crossed. If so, it will be planned for again by going through the StartOver state.
Hopefully someone finds the above info useful. Think about a sequence of steps before plan can be considered as finalized. These sequences of steps are being done in the PlanItem procedure through a WHILE loop until plan is done.
Integration of the MRP with Jobs
This is not to use it but to test it. Yeap, this is a disclaimer so reader knows that testing should always be done.
What I would like to cover here is how to integrate MRP with Jobs so material required for jobs create action messages. Before that, lets see how CU99000854 determines where the demands are coming from. This is done on function DemandToInvProfile. Here it goes through the different types of demand (Service, Sales, Production, …) and make planning aware of them.
Back to our case, this same function is where we need to add code so MRP is aware that Job Planning Lines carry demands (material requirements). As an example, the piece of code we could consider is the following:
…
JobPlanningLine.SETCURRENTKEY(Type,”No.”,”Variant Code”,”Location Code”,”Planning Date”);
JobPlanningLine.SETRANGE(Type,JobPlanningLine.Type::Item);
JobPlanningLine.SETRANGE(“No.”,Item.”No.”);
Item.COPYFILTER(“Location Filter”,JobPlanningLine.”Location Code”);
Item.COPYFILTER(“Variant Filter”,JobPlanningLine.”Variant Code”);
JobPlanningLine.SETFILTER(“Planning Date”,’>%1&<=%2',0D,ToDate);
IF JobPlanningLine.FIND('-') THEN
REPEAT
InventoryProfile.INIT;
InventoryProfile."Line No." := NextLineNo;
InventoryProfile.TransferFromJobPlanningLine(JobPlanningLine);
IF InventoryProfile.IsSupply THEN
InventoryProfile.ChangeSign;
InventoryProfile.INSERT;
UNTIL JobPlanningLine.NEXT = 0;
…
What we are doing above is using the job planning lines of type "Item" to be considered as demand and use the planning date as due date for the demand.
Going forward, reader could take it from here to finalize the development.
How to determine if average cost is correct
This is a frequent question from out there: how could I determine if Average cost is correct? How NAV calculates this average?
The simple answer is: average cost is determine by the following formula through value entry table: (sum of actual cost + sum of expected costs) / (sum of item ledger entry quantity). This will provide the average cost (unit cost) when Adjust cost is run.
And, how NAV calculates this average cost for a specific date? This is done by ordering the value entries by valuation date. This date is when entry is valued. Thus, we need to order the entries how they are valued. Once this is done, next order to consider is: inbound entries first, outbound entries next. In other words: we calculate the average cost by using the positive entries and we then deduct the value of the outbound entries to find out the final average cost on that given date
Average cost calculation vs. discounts
…
LastDirectCost :=
ROUND(
(ItemJnlLine.Amount + ItemJnlLine."Discount Amount") / "Invoiced Quantity",
GLSetup."Unit-Amount Rounding Precision");
…
b. CU5804 (proc. UpdateUnitCost). This updates "Unit Cost" and "Last Direct Cost" in item card. Here, we could determine how/when to update this.
IF ("Unit Cost" = 0) OR ((InvoicedQty > 0) AND (LastDirectCost <> 0)) THEN BEGIN
CALCFIELDS("Net Invoiced Qty.");
IF ("Net Invoiced Qty." > 0) AND ("Net Invoiced Qty." <= InvoicedQty) THEN
"Unit Cost" := LastDirectCost;
IFI …
What happens when both Inbound and Outbound Production bin codes are the same …
Using inbound Production Bins as Pick Bins
Order Planning vs. Reorder point items
ERP Audit: a tool for SCM individuals to be the “key” on protecting the information
This time, this post is something different. This is about productivity … but not SCM productivity. This is something that you (SCM expert) can help about. Lets begin.
You SCM expert know how information flows through the companies. You could even define what is the critical information for a company and which one is not. Thus, you (as SCM expert) are a key individual on helping companies on protecting their information: you can know information flows in the company.
The goal here is that you (SCM expert) could provide expertise on helping companies to protect their information. Keep note, I am not taking about protecting their systems but their information. Thus, we are talking here on providing guidance on setting up procedures to protect the “Information”. Then, IT (technical) people can take the procedures you (SCM) defined and setup the right technical tools to protect the systems. But, is this protection on their information something you should have only in mind after ERP is deployed? No, selling and implementing an ERP like Microsoft Dynamics NAV is something different than selling and implementing another software (Vista, Exchange, …).
It requires that ERP is align with company business goals. Without the proper skills about what business does (SCM skills), the implementation of an ERP fails (then customers blames the implementation team and them to the ERP vendor … ). Thus, this protection should start during the point in time when the ERP is even considered to be implemented. For instance, lets focus on the ERP implementation. There are quite a number of situations where companies failed implementation: company does not have the Culture to adopt an ERP, high management levels were not compromised on finding resources and defining corporate goals to achieve, Project leader does not have the skills, key users were not identified, requirements are not properly documented, there is no such a methodology to implement the ERP, there is no analysis on support incidents reported, security requirements were not properly defined … There could be tons of reasons.
Another example, before implementation there should be a phase to analyze if ERP is the right tool. This phase is called ERP Adoption. If you are an SCM individual, you should be going through these questions:
– Did the management levels define the business goals to implement the ERP? Do we know why company needs this ERP?
– Does not company have the necessary “corporate culture” to implement an ERP?
– What is the communication in the company about this ERP implementation?
– Has been a Project Leader identified? Does this Project leader have the right experience and reputation in the organization?
– What is the hierarchy structure in the organization?
– What is the IT role in the ERP implementation?
And, the role of the Business departments:
– How the organization has defined their processes with policies, procedures and standards?
– Who else but the SCM individual can better determine if ERP and business are aligned?
– Who knows better than SCM how should business be done efficiently and effective?
Not having the above in mind could lead to not having available the information that company needs or to a "leakage" on the information protection since the critical information has not been properly defined … And now, what would be my proposal to you as SCM individual: minimize the risk by using your expertise on the "company’s information.
If you are having this in mind, you are in the right direction: you identified the information, you know what is the critical information and you are on the way to manage the risks.
To emphasize, SCM expert: you are key on protecting the "information flow" just because you can visualize it. Do not let people think IT is the key. Use this tool: ERP audit and make sure you also use your SCM skills to determine and help on how effective and efficient is the ERP.
NAV “core” Planning: CU 99000854 ( II ): Demand types
SalesLine.SETFILTER("Document Type",’%1|%2′,SalesLine."Document Type"::Order,SalesLine."Document Type"::"Return Order");
SalesLine.SETRANGE(Type,SalesLine.Type::Item);
SalesLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",SalesLine."Location Code");
Item.COPYFILTER("Variant Filter",SalesLine."Variant Code");
SalesLine.SETFILTER("Outstanding Qty. (Base)",'<>0′);
SalesLine.SETFILTER("Shipment Date",’>%1&<=%2′,0D,ToDate);
ServiceLine.SETCURRENTKEY(Type,"No.","Variant Code","Location Code","Posting Date");
ServiceLine.SETRANGE("Document Type",ServiceLine."Document Type"::Order);
ServiceLine.SETRANGE(Type,ServiceLine.Type::Item);
ServiceLine.SETRANGE("No.",Item."No.");
Item.COPYFILTER("Location Filter",ServiceLine."Location Code");
Item.COPYFILTER("Variant Filter",ServiceLine."Variant Code");
ServiceLine.SETFILTER("Outstanding Qty. (Base)",'<>0′);
ServiceLine.SETFILTER("Posting Date",’>%1&<=%2′,0D,ToDate);
ReqLine.SETRANGE("Ref. Order Type",ReqLine."Ref. Order Type"::"Prod. Order");
ProdOrderComp.SETCURRENTKEY("Item No.","Variant Code","Location Code",Status,"Due Date");
ProdOrderComp.SETRANGE("Item No.",Item."No.");
Item.COPYFILTER("Location Filter",ProdOrderComp."Location Code");
Item.COPYFILTER("Variant Filter",ProdOrderComp."Variant Code");
ProdOrderComp.SETRANGE(Status,ProdOrderComp.Status::Planned,ProdOrderComp.Status::Released);
ProdOrderComp.SETFILTER("Due Date",’>%1&<=%2′,0D,ToDate);