web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Historical Stock Status

(0) ShareShare
ReportReport
Posted on by 845

While printing the report Historical Stock Status i am getting the following error message :

Unhandled script exception: Division by zero script aborted EXCEPTION_CLASS_SCRIPT_DIVIDE_BY_ZERO

how can i sort it out ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahmoud Saadi Profile Picture
    32,738 on at

    Dear Mahwish,

    Try to run the following scripts against your company database;

    1. In case the "Unit of Measurement" is corrupted:

    SELECT * FROM IV30300 WHERE UOFM NOT IN

    (SELECT UOFM FROM IV40202)

    1. In case the "Decimal Places" is corrupted;
      SELECT * FROM IV30300 WHERE DECPLQTY = 0 or DECPLCUR = 0

    Your feedback is highly appreciated in order to dig for further details if required.

  • Mahwish Profile Picture
    845 on at

    Dear Mahmoud AlSaadi,

    The error message states:

    Unhandled script exception: Division by zero script aborted

    EXCEPTION_CLASS_SCRIPT_DIVIDE_BY_ZERO SCRIPT_CMD_DIV

    The first query returns me 8087 rows

    and the second query returns me 3 rows

    where should i look for the corrupted unit of measurement or decimal places ?

  • Mahmoud Saadi Profile Picture
    32,738 on at

    Apparently the first script was incorrectly entered since the number doesn't make sense as it is quite huge. I have just edited the first script as it missed the "condition part" while posting. Therefore, please re-run the first script and provide me with the results.

    I will be providing you with the correction criteria as soon as you reply

  • Mahwish Profile Picture
    845 on at

    SELECT * FROM IV30300 WHERE UOFM NOT IN (SELECT UOFM FROM IV40202)

    The above script is returning me 8087 rows.

    Please guide me if the script has any part missing

  • Mahmoud Saadi Profile Picture
    32,738 on at

    I do believe you have a huge problem which needs thorough checks. The 8087 records returned above are items that have issues with the UOM. Although, the results returned from the second script are not quite a big deal.

    Please e-mail me to mahmoodsaadi@live.com, as I need to run further scripts on your company DB.

    Looking forward to hearing from you

  • Verified answer
    Mahmoud Saadi Profile Picture
    32,738 on at

    For now, you are supposed to solve the case associated with the decimal places.

    -- Retrives the details of the corrupted records (Regarding Decimal Places)

    SELECT  A.DEX_ROW_ID ,
            A.ITEMNMBR ,
            A.DECPLCUR AS Incorrect_Decimal_Currency,
            B.DECPLCUR AS Correct_Decimal_Currency,
            A.DECPLQTY AS Incorrect_DECPLQTY,
            B.DECPLQTY AS Correct_Decimal_Quantity
    FROM    IV30300 AS A
            INNER JOIN IV00101 AS B ON A.ITEMNMBR = B.ITEMNMBR
    WHERE   A.DECPLQTY = 0
            OR A.DECPLCUR = 0  

    In order to correct these corrupted records, you are suppose to update the value of both (decimal places quantity and currency) as retrieved by the scrip above:

    UPDATE dbo.IV30300
    SET    DECPLCUR = #Correct_Decimal_Currency_value,
           DECPLQTY = #Correct_Decimal_Quantity_value
    WHERE  DEX_ROW_ID = #DEX_ROW_ID


    You could check the following print screen for further illustration on how to apply the correction


    As always recommended, you could ensure by trying the updates above on a test environment to check the results and then apply on the live environment


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Dan Liebl Profile Picture

Dan Liebl 2

#2
Shravan Attelli Profile Picture

Shravan Attelli 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans