Options

Adjust Cost - by Item.

parthivparthiv Member Posts: 16
Currently we upgraded one of our client from 4.0 to SP3. Everything seems to work fine but the Adjust Cost - Item entries seems to take a considerably longer time than it did in 4.0. Database is SQL 2000.

Previously when they used to run adjust cost - item entries in 4.0 at the end of the day, it took round about 15 - 20 mins to complete the job. Currently it takes 40 - 45 mins. There is no significant increase in the number of transactions it is more or less the same. Is it because of changes in codeunit - Inventory Adjustment or due to something else?

Is it possible to filter by item and then run Adjust Cost - Item entries report?


Thanks.
«1

Answers

  • Options
    ara3nara3n Member Posts: 9,255
    run client monitor and compare. what kind of costing method?
    are u using manufacturing? BOM?

    Yes it's possible to filter on items, but you have to write the report.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    parthivparthiv Member Posts: 16
    The costing method is Average. No manufacturing. Using BOM, but not extensively.

    can you provide some hint on how to go about filtering Items? Thanks.
  • Options
    ara3nara3n Member Posts: 9,255
    Yes there was a bug in 4.0 through sp2 and it was fixed in sp3, it was specifically related to average costing on BOM.
    There is still a bug in it, we ran into it with a client. The adjust cost runs into infinite loop. You get an overflow error in native client, and sql insert statement on sql because the amount field greater than 2^32-1 value.


    I will post an example on how to filter on items.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    parthivparthiv Member Posts: 16
    We never hit the infinite loop issue in 4.0 but we ran into it in Sp3. But i realise the Item cost - Adjust entries job in Sp3 is taking more time than it did it 4.0 is it really so or am i the only one just experiencing?

    Looking forward for your example on Item filter. Thanks.
  • Options
    ara3nara3n Member Posts: 9,255
    edited 2007-06-14
    Modify CU 5895
    Add a new function
    SetupItemFilter(VAR L_Item : Record Item)
    //T001 Start
    gRunItemFilter := true;
    gItem.copyfilters(L_Item);
    //T001 End
    


    Modify function InvtToAdjustExist(VAR ToItem : Record Item) : Boolean
    as follows. The SETCURRENTKEY("Cost is Adjusted","Allow Online Adjustment"); can be also change for performance if you are running on native. The key would depend on filters you are setting.
    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;
    

    Modify report 795 Adjust Cost - Item Entries.
    Add a new dataitem Item table.

    Add the following code to the onprereport trigger
    //T001 Start
    InvtAdjmt.SetupItemFilter(Item);
    //T001 End
    InvtAdjmt.SetProperties(PostingDate,FALSE);
    InvtAdjmt.MakeMultiLevelAdjmt;
    

    Enjoy
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    parthivparthiv Member Posts: 16
    Thank you so much for the Code. I just moved the code //T001 Start - //T002 End after RESET. If not the program hits an infinite loop. I tested it, it seems to work fine.

    Thank you so much. =D> =D>
    InvtToAdjustExist(VAR ToItem : Record Item) : Boolean
    WITH Item DO BEGIN
    RESET;
    //T001 Start
    if gRunItemFilter then
    Item.copyfilters(gItem);
    //T001 End

    SETCURRENTKEY("Cost is Adjusted","Allow Online Adjustment");
    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;
    [/quote]
  • Options
    ara3nara3n Member Posts: 9,255
    you are welcome. :)
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    ara3nara3n Member Posts: 9,255
    Maybe change the title to filter adjust cost by item and change it to the title to fixed?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    ara3nara3n Member Posts: 9,255
    It's nice sometimes to find your own solution and use it. 8)
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    cnpavelcnpavel Member Posts: 1
    Tried your solution but I don't have gRunItemFilter and gItem variables declared. Those variable must exist in standard SP3 or should I declare them ? If declare is the soltion...where should I declare them ?
  • Options
    lallylally Member Posts: 323
    Hi ara3n,


    I am new bee to navision and technical. I want know that process. I tried what u mentioned above. But i could not solve. Totally this is my mistake, because i am fresher. Please explain the process detail what are variables i need to define and what functiones i have to write and where to write.Please give some detail explanation. While u put solutions please think about freshers like me.I hope u can explain.......

    I will be waiting u r valuable solution to me........

    thanks and regards
    lally
  • Options
    ara3nara3n Member Posts: 9,255
    you need to declare them as global variables in that codeunit 5895
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    thinafansthinafans Member Posts: 88
    Dear all,
    We migrated from Navision SP1 TO SP3

    We also faced the problem,adjust cost item entries is running more than 2 days still it is running.There is no end at all.

    After seeing the Mibuso i got the solution of running for the particular item.

    Now we suggested our client to run for the Particular FG or Inventory Posting Group.

    Because in the Fresh Sp3 we are ACIE for all item in the master.

    In this case

    For example only i am running Adjust Cost Item Entries for my Finishgoods,in this my doubt is system will only consider the finish good only or under the all sfg and rawmaterial.
    Under the Finishgood i have so many Simifinish good items and rawmaterial also. I selected Costing method as Average cost ,Then my average cost will vary means how the system will consider.


    Pls guide me .... ](*,)
  • Options
    ara3nara3n Member Posts: 9,255
    First time you run this, it will run and adjust the WIP for all items.

    This mod is similar to modification in 5.0. I would run the adjust cost for components first and then for finished goods.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    andreadjandreadj Member Posts: 12
    thinafans wrote:
    Dear all,
    We migrated from Navision SP1 TO SP3

    We also faced the problem,adjust cost item entries is running more than 2 days still it is running.There is no end at all.

    After seeing the Mibuso i got the solution of running for the particular item.

    Now we suggested our client to run for the Particular FG or Inventory Posting Group.

    Because in the Fresh Sp3 we are ACIE for all item in the master.

    In this case

    For example only i am running Adjust Cost Item Entries for my Finishgoods,in this my doubt is system will only consider the finish good only or under the all sfg and rawmaterial.
    Under the Finishgood i have so many Simifinish good items and rawmaterial also. I selected Costing method as Average cost ,Then my average cost will vary means how the system will consider.


    Pls guide me .... ](*,)

    hi thin, i've read your post about adjust costing,
    i want to know, whether the long process time (that you mention) of AC is solved by running AC per item?
    or is there a particular item that caused an AC seems to take forever?

    cos right know i have this issue, one particular item is causing a problem in AC, cos it takes a very long time (havent finished in two days).

    i use the solution here to exclude that item. it works wonderfully

    but the problem still exist. i cannot AC this "troubled" item.

    any suggestion, how to deal with this issue?

    err yeah, i used NAV4.0 SP2.. and already upgrade the CU5895 to SP3
  • Options
    thinafansthinafans Member Posts: 88
    Hi Dear


    Here I have faced the long process time for running the ACIE for all items and after seen the solution from the mibuso now we are running for the particular item only.It is working fine,we are not facing any problem at all.

    Now we are running for the particular item and also the Inventory posting group wise.

    Regards,

    AN.THINAKARAN.
  • Options
    andreadjandreadj Member Posts: 12
    thks for the rply thin :)
    hix, so you're not in the same boat with me :(

    so, nobody've been thru dat before in NAV4?
  • Options
    ara3nara3n Member Posts: 9,255
    Hello

    I have applied this modification to 3 clients. It works fine on each.
    Two of them are running Mfg.
    You need to run and filter by raw material first. Once you've run adjust cost for all raw material, then you need to filter by sub-component if you have multi level BOMS.

    Last you'll run adjust for finished goods. Now if an particular item is running adjust for 2 days, it could be related to sp2 having adjust running into infinite loop.
    You have to debug that. Or at least look partner source knowledge base.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    andreadjandreadj Member Posts: 12
    i already did the suggestion. unfortunately, it aint work :(

    seems like i have to bite the bullet by debugging it :D

    but many thks for the suggestion ara3n:D
  • Options
    thinafansthinafans Member Posts: 88
    Dear all,

    Still i am facing the problem while running the ACIE(Adjust cost item entries).I selected the particular finishgood item in item filter.Then i run the report,But it is considering all the item while running and also the process it is not at all completing.

    What is the problem i didn't know.


    Pls throw some suggestion.
  • Options
    girish.joshigirish.joshi Member Posts: 407
    You should probably start a new thread since this is a new problem.
  • Options
    darshanmdarshanm Member Posts: 280
    Hi All,

    I am also facing two probs in Costing batch job. We have added
    the filters in Adjust Cost batch job.

    1. runs into endless loop

    => For a specific item.

    2. Error "There is an integer that is too large 130,38900......."

    => For a specific Items.

    If anybody has got the solution on this, then please reply

    :cry:
    Darshan Mungekar
    Senior Consultan
  • Options
    ara3nara3n Member Posts: 9,255
    If you are on 4.0 version, I would load/merge the 4.0 sp3 objects and run adjust cost, and see if this fixes it. Also please search Partnersource.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    kgsinhakgsinha Member Posts: 67
    hi, can i use filter like '<>Item1'... means run adjustcost process except item1.

    in request filter of item dataitem.
  • Options
    tompynationtompynation Member Posts: 398
    Functon: SetupItemFilter

    Var Name DataType Subtype Length
    Yes L_Item Record Item

    Is this correct that this L_Item should have the Checkmark for the Var column?
  • Options
    ara3nara3n Member Posts: 9,255
    Yes it should be passed by var.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    SoloperSoloper Member Posts: 102
    Where and how can I enter the Item kod in this solution?
  • Options
    SoloperSoloper Member Posts: 102
    Soloper wrote:
    Where and how can I enter the Item kod in this solution?

    Sorry. I've forgot adding Item as a dataitem. I can select an item now.

    But It works for all items still even I select a specific Item.

    Any idea?
  • Options
    SoloperSoloper Member Posts: 102
    Soloper wrote:
    Soloper wrote:
    Where and how can I enter the Item kod in this solution?

    Sorry. I've forgot adding Item as a dataitem. I can select an item now.

    But It works for all items still even I select a specific Item.

    Any idea?

    I think the problem is about vairable declaration.

    Concerning the following code block;

    SetupItemFilter(VAR L_Item : Record Item)
    //T001 Start
    gRunItemFilter := true;
    gItem.copyfilters(L_Item);
    //T001 End

    What should I declare gItem and gRunItemFilter as? I declared gItem as a RECORD and gRunItemFilter as a BOOLEAN.

    Am I wrong?
  • Options
    SoloperSoloper Member Posts: 102
    Soloper wrote:
    Soloper wrote:
    Soloper wrote:
    Where and how can I enter the Item kod in this solution?

    Sorry. I've forgot adding Item as a dataitem. I can select an item now.

    But It works for all items still even I select a specific Item.

    Any idea?

    I think the problem is about vairable declaration.

    Concerning the following code block;

    SetupItemFilter(VAR L_Item : Record Item)
    //T001 Start
    gRunItemFilter := true;
    gItem.copyfilters(L_Item);
    //T001 End

    What should I declare gItem and gRunItemFilter as? I declared gItem as a RECORD and gRunItemFilter as a BOOLEAN.

    Am I wrong?

    I put a thick on VAR column for function parameter L_Item. Now It works.

    Thanks goes to ara3n.
Sign In or Register to comment.