Problem In Adjust Cost Process

kgsinhakgsinha Member Posts: 67
I am running Adjust Cot Process. Even running after 36 hrs, process is not being completed. After each 3-4 seconds, it shows a window for "searching reservation entries". I feel it stucks into searching reservation entries(in some big loop), but i am not sure about this.

Please help, if anybody have some solutions...!!!!!!!!

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    kgsinha wrote:
    I am running Adjust Cot Process. Even running after 36 hrs, process is not being completed. After each 3-4 seconds, it shows a window for "searching reservation entries". I feel it stucks into searching reservation entries(in some big loop), but i am not sure about this.

    Please help, if anybody have some solutions...!!!!!!!!

    Have you heard the phrase "How long is a piece of string". If not can I ask you the question, i.e. exactly how long IS a piece of string.

    You need to post a LOT more information before anyonecan help you.
    David Singleton
  • kinekine Member Posts: 12,562
    The questions are: SQL or Native? Version, DB size, where are the client with running job is (on server or client PC or over terminal), how often are you running the job, when was last successful run...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kgsinhakgsinha Member Posts: 67
    Database is : SQL Server 2005
    Navision 4.03.
    We are tryimg to run it directly on server or on TTS .
    We need to run this everyday in night.
    Last we run it successfuly on 29 august. (it took around 4-5 hrs to complete).


    Actually we have also commented in the processing window codings, to make this batch job fast.

    Is there any setups, which affects this process and make it lenghty.

    Or is there any way so that we can run it location wise and/or item wise.

    or any more solutions...
    thanx in advance.
  • kinekine Member Posts: 12,562
    Which costing method you are using?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kgsinhakgsinha Member Posts: 67
    Average
  • kgsinhakgsinha Member Posts: 67
    One thing i want ask.
    If i modify process to run process item wise as suggested in mibuso.

    can i apply following filter-
    No. - <>Item1

    means it will run for all items except item1.

    possible?
  • kinekine Member Posts: 12,562
    Yes, it is possible.


    I am not sure, if it is still true, but if you look into table 5804, you can see dates from which will be each item/location/variant cost recalculated. Try to look for date which is far in history. It means that all entries after this date will be recalculated and it can lead to his problem. It is common when someone post invoice with posting date few weeks (or months...) ago...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kgsinhakgsinha Member Posts: 67
    Thanx kine for your answer.

    But can you explain me in detail the problem of endless loop while running adjust cost.
    Also what should i do to prevent this.
  • kgsinhakgsinha Member Posts: 67
    In report 795, i have modified the code as follow to run the adjust cost process Item wise.

    in codeunit 5895 - function "InvtToAdjustExist" is like this after modification.

    InvtToAdjustExist(VAR ToItem : Record Item) : Boolean
    WITH Item DO BEGIN
    RESET;
    SETCURRENTKEY("Cost is Adjusted","Allow Online Adjustment");

    //T001 Start
    IF gRunItemFilter THEN
    Item.COPYFILTERS(gItem);
    //T001 End

    SETRANGE("Cost is Adjusted",FALSE);
    IF IsOnlineAdjmt THEN
    SETRANGE("Allow Online Adjustment",TRUE);

    CopyItemToItem(Item,ToItem);

    IF ItemLedgEntry.AppliedEntryToAdjustExists('') THEN
    InsertDeletedItem(ToItem);

    EXIT(ToItem.FIND('-'));
    END;

    MakeSingleLevelAdjmt(VAR TheItem : Record Item)



    Also added one new function in same codeunit :



    SetupItemFilter(L_Item : Record Item)
    //T001 Start
    gRunItemFilter := TRUE;
    gItem.COPYFILTERS(L_Item);
    //T001 End


    Also in Report 795 added one new dataitem ITEM, following code is there on PREREPORT after modifications


    IF PostingDate = 0D THEN
    ERROR(Text004);
    ItemApplnEntry.LOCKTABLE;
    IF NOT ItemApplnEntry.FIND('+') THEN
    EXIT;
    ItemLedgEntry.LOCKTABLE;
    IF NOT ItemLedgEntry.FIND('+') THEN
    EXIT;
    AvgCostAdjmtEntryPoint.LOCKTABLE;
    IF AvgCostAdjmtEntryPoint.FIND('+') THEN;
    ValueEntry.LOCKTABLE;
    IF NOT ValueEntry.FIND('+') THEN
    EXIT;


    //T001 Start gaurav
    InvtAdjmt.SetupItemFilter(Item);
    //T001 End gaurav


    InvtAdjmt.SetProperties(PostingDate,FALSE);
    InvtAdjmt.MakeMultiLevelAdjmt;

    UpdateItemAnalysisView.UpdateAll(0,TRUE);



    Now for Dataitem ITEM, on ReqFilterFields properties, i put one filed "No.".

    IS THIS CORRECT MODIFICATION TO RUN ADJUST COST PROCESS "ITEM WISE."

    ACTUALLY, NOW I AM SELECTING ANY SUCH ITEM NO. WHICH HAS NO ITEM TRACKING DEFINED AND THEN RUNNING THE REPORT.

    BUT AS I RUN THE REPORT, STILL IT STARTS SHOWING ME WINDOW MSG "SERCHING RESERVATION ENTRIES....", IT MEANS IT IS NOT RUNNING ITEM WISE. BECAUSE IF IT IS RUNNING ITEM WISE, IT SHOULD NOT SHOW SUCH MESSAGE.

    AM I RIGHT OR MY ASSUMPTION IS WRONG.
    ??? PLS HELP
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Take a look at yoru reservation entries table. Why is it searching this table? Do you have some items with a lot of reservations against them? Look at the keys on this table and see if soemone has "played" with them.

    In 4.00 Sp3 the keys on Reservation Entry table is not optimized for SQL, and maybe your database needs tuning.
    David Singleton
Sign In or Register to comment.