Same calculation producing two differing results

Hi All
I have some code in a user exit on save of a delivery (VL02N) that calculates the number of bags/pallets required to furnish that delivery.
I am now adding the same code to a user exit on save a sales order (VA02) to calculate the number of bags/pallets again but when run it is producing differing results.
the code is as follows:
DATA: bag_weight(12) TYPE p DECIMALS 4.
DATA: pallet_weight TYPE marm-umrez.
DATA: bag_denominator TYPE i.
bag_weight = pallet_weight / bag_denominator.
Assuming pallet_weight = 1000 and bag_denominator = 40.
On save of a delivery it is calculating bag_weight as 25.0000 (correct):
On save of a sales order it is calculating bag_weight as 0.0025 (incoorect).
All data declaration, code etc is the same. Does anybody have any clue as to why it would give two differing answers, I would not like to have to add a additional multiplication step to correct the result otherwise.
Thanks in advance
David

Hi,
Whenever you are using the Packed numbers, you need to check or set the program attribute fixed point arithmetic only as only this ensure that the decimal point is calculated correctly.
Have a look at the help.sap.com documentation link:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
Hope this helps.
Thanks,
Samantak.

Similar Messages

  • Same sql statement two different results?

    Hi,
    I was wondering if anyone knows why I am getting different
    results on the same query.
    Basically... when I run this query in "view" in sql server, I
    get the results I need, however when I run in Coldfusion, I am
    getting totally different results.... It is a totally different
    result...
    the query:
    SELECT DISTINCT
    tbl_employees.indexid, tbl_employees.[Employee ID] as
    employeeid, tbl_employees.[First Name] as firstname,
    tbl_employees.[Last Name] as lastname,
    tbl_employees.[Supervisor ID] as supervisorid,
    tbl_workaddress_userdata.firstname,
    tbl_workaddress_userdata.lastname,
    tbl_workaddress_userdata.supervisorid,
    tbl_workaddress_userdata.location,
    tbl_workaddress_userdata.employeeid,
    tbl_workaddress_userdata.locationdescription
    FROM tbl_employees FULL OUTER JOIN
    tbl_workaddress_userdata ON tbl_employees.[Employee ID] =
    tbl_workaddress_userdata.employeeid
    WHERE (tbl_employees.[Supervisor ID] = 7) AND
    (tbl_workaddress_userdata.location IS NULL)

    I suspect you and your CF DSN are looking at two different
    DBs...
    Adam

  • Why do I get two different results from the same coefficients?

    I am getting two different results from the Polynomial Evaluation function.
    For the first one, I am getting the coefficients from a Polynomial Fit function.  I feed the coefficients from the Fit function into the Poly Eval function and get the correct result of 12.8582 when I evaluate 49940.
    For the second one, I create constant array of the SAME values that were returned from the Polynomial Fit function (i typed them in).  However, I am getting an incorrect result of -120.7913 when I feed the constant array into the Poly Eval function when I evauate 49940.
    How can this happen when I am using the same array values?
    Attached is an image of what I am explaining.
    Solved!
    Go to Solution.
    Attachments:
    polynomial_evaluation.jpg ‏213 KB

    Hi Altran,
    are you sure about using the "same" coefficients?
    Did you compare them? Did you (atleast) set the display properties to 17 significant digits?
    Please attach a VI instead of a picture...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Execute the same query twice, get two different results

    I have a query that returns two different results:
    Oracle Version : 10.2.0.1.0
    I am running the following query on the Oracle server in SQL*Plus Worksheet.
    SELECT COUNT(*)
    FROM AEJOURNAL_S1
    WHERE CHAR_TIME BETWEEN TO_DATE('12-AUG-10 01:17:39 PM','DD-MON-YY HH:MI:SS AM') AND
    TO_DATE('13-AUG-10 14:17:34','DD-MON-YY HH24:MI:SS')
    AND DESC2 LIKE '%'
    AND DESC1 LIKE '%'
    AND DESC2 LIKE '%'
    AND ETYPE LIKE '%'
    AND MODULE LIKE '%'
    AND LEVELL = '11-WARNING'
    ORDER BY ORDD DESC;
    The very first time the query is run, it will return a count of 259. The next time the query is run, lets say, 10 seconds later, it will return a count of 260. The above query is exemplary of the kind of thing I'm trying to do. It seems like the more fields filtered against '%', the more random the count return becomes. Sometime you have to execute the query three or four times before it levels out to a consistent number.
    I'm using '%' as the default for various fields, because this was the easiest thing to do to support a data-driven Web interface. Maybe I have to 'dynamically' build the entire where clause, instead of just parameterizing the elements and having default '%'. Anyway, to eliminate the web interface for the purpose of troubleshooting the above query was run directly on the Oracle server.
    This query runs against a view. The view does a transpose of data from a table.
    Below is the view AEJOURNAL_S1
    SELECT
    CHAR_TIME,
    CHAR_INST,
    BATCH_ID,
    MIN(DECODE(CHAR_ID,6543,CHAR_VALUE)) AS ORDD,
    MIN(DECODE(CHAR_ID,6528,CHAR_VALUE)) AS AREAA,
    MIN(DECODE(CHAR_ID,6529,CHAR_VALUE)) AS ATT,
    COALESCE(MIN(DECODE(CHAR_ID,6534,CHAR_VALUE)),'N/A') AS CATAGORY,
    MIN(DECODE(CHAR_ID,6535,CHAR_VALUE)) AS DESC1,
    MIN(DECODE(CHAR_ID,6536,CHAR_VALUE)) AS DESC2,
    MIN(DECODE(CHAR_ID,6537,CHAR_VALUE)) AS ETYPE,
    MIN(DECODE(CHAR_ID,6538,CHAR_VALUE)) AS LEVELL,
    MIN(DECODE(CHAR_ID,6539,CHAR_VALUE)) AS MODULE,
    MIN(DECODE(CHAR_ID,6540,CHAR_VALUE)) AS MODULE_DESCRIPTION,
    MIN(DECODE(CHAR_ID,6541,CHAR_VALUE)) AS NODE,
    MIN(DECODE(CHAR_ID,6542,CHAR_VALUE)) AS STATE,
    MIN(DECODE(CHAR_ID,6533,CHAR_VALUE)) AS UNIT
    FROM CHAR_BATCH_DATA
    WHERE subbatch_id = 1774
    GROUP BY CHAR_TIME, CHAR_INST, BATCH_ID
    So... why does the query omit rows on the first execution? Is this some sort of optimizer issue. Do I need to rebuild indexes? I looked at the indexes, they are all valid.
    Thanks for looking,
    Dan

    user2188367 wrote:
    I have a query that returns two different results:
    Oracle Version : 10.2.0.1.0
    I am running the following query on the Oracle server in SQL*Plus Worksheet.
    SELECT COUNT(*)
    FROM AEJOURNAL_S1
    WHERE CHAR_TIME BETWEEN TO_DATE('12-AUG-10 01:17:39 PM','DD-MON-YY HH:MI:SS AM') AND
    TO_DATE('13-AUG-10 14:17:34','DD-MON-YY HH24:MI:SS')
    AND DESC2 LIKE '%'
    AND DESC1 LIKE '%'
    AND DESC2 LIKE '%'
    AND ETYPE LIKE '%'
    AND MODULE LIKE '%'
    AND LEVELL = '11-WARNING'
    ORDER BY ORDD DESC;
    The very first time the query is run, it will return a count of 259. The next time the query is run, lets say, 10 seconds later, it will return a count of 260. The above query is exemplary of the kind of thing I'm trying to do. It seems like the more fields filtered against '%', the more random the count return becomes. Sometime you have to execute the query three or four times before it levels out to a consistent number.
    I'm using '%' as the default for various fields, because this was the easiest thing to do to support a data-driven Web interface. Maybe I have to 'dynamically' build the entire where clause, instead of just parameterizing the elements and having default '%'. Anyway, to eliminate the web interface for the purpose of troubleshooting the above query was run directly on the Oracle server.
    This query runs against a view. The view does a transpose of data from a table.
    Below is the view AEJOURNAL_S1
    SELECT
    CHAR_TIME,
    CHAR_INST,
    BATCH_ID,
    MIN(DECODE(CHAR_ID,6543,CHAR_VALUE)) AS ORDD,
    MIN(DECODE(CHAR_ID,6528,CHAR_VALUE)) AS AREAA,
    MIN(DECODE(CHAR_ID,6529,CHAR_VALUE)) AS ATT,
    COALESCE(MIN(DECODE(CHAR_ID,6534,CHAR_VALUE)),'N/A') AS CATAGORY,
    MIN(DECODE(CHAR_ID,6535,CHAR_VALUE)) AS DESC1,
    MIN(DECODE(CHAR_ID,6536,CHAR_VALUE)) AS DESC2,
    MIN(DECODE(CHAR_ID,6537,CHAR_VALUE)) AS ETYPE,
    MIN(DECODE(CHAR_ID,6538,CHAR_VALUE)) AS LEVELL,
    MIN(DECODE(CHAR_ID,6539,CHAR_VALUE)) AS MODULE,
    MIN(DECODE(CHAR_ID,6540,CHAR_VALUE)) AS MODULE_DESCRIPTION,
    MIN(DECODE(CHAR_ID,6541,CHAR_VALUE)) AS NODE,
    MIN(DECODE(CHAR_ID,6542,CHAR_VALUE)) AS STATE,
    MIN(DECODE(CHAR_ID,6533,CHAR_VALUE)) AS UNIT
    FROM CHAR_BATCH_DATA
    WHERE subbatch_id = 1774
    GROUP BY CHAR_TIME, CHAR_INST, BATCH_ID
    So... why does the query omit rows on the first execution? Is this some sort of optimizer issue. Do I need to rebuild indexes? I looked at the indexes, they are all valid.
    Thanks for looking,
    DanIn fact you the first time you ran the query the data has been retrived from disk to memory , in the second time the data is already in memory so the respnse time should be faster ,but if you chagne any condition or column or letter case the optimizer will do the first step (data will be retrived from disk to memory )

  • Will a sequence return same value for two different sessions?

    Is there a possibility that a sequence will return same value to two different sessions when it is referred exactly at the same instance of time?

    @Justin... Thanks for your insight; indeed, we too feel this shouldn't ever happen and never heard of it either, but there it is. (No, we haven't logged a TAR yet -- whatever that is -- partly because it didn't occur to us and partly because we only recently came across the issue and sensibly want to do some testing before we cry foul.)
    However, the code is pretty straight-forward, much like this (inside a FOR EACH ROW trigger body):
    SELECT <seqname>.NEXTVAL INTO <keyvar> FROM DUAL;
    INSERT INTO <tblname> (<keyfield>, <... some other fields>)
    VALUES(<keyvar>, <... some other values> );
    (where <tblname> is NOT the table on which the trigger is fired). This is the only place where the sequence is ever accessed. The sequence state is way below its limits (either MAXVALUE or <keyfield>/<keyvar> datatype size).
    In this setup, end users sometimes got an out-of-the-blue SQL error to the effect that uniqueness constraint has been violated -- as I said, we used to have a unique index on <keyfield> -- which leads us to assume that the sequence generated a duplicate key (only way for the constraint to be violated, AFAIK). We released the constraint and indeed, using a simple SELECT <keyfield>, COUNT(*) FROM <tblname> GROUP BY <keyfield> HAVING COUNT(*)>1 got us some results.
    Unfortunately, the <tblname> table gets regularly purged by a consumer process so it's hard to trace; now we created a logger trigger, on <tblname> this time, which tracks cases of duplicate <keyfield> inserts... We'll see how it goes.
    @Laurent... winks at the CYCLE thing Our sequence is (needless to say) declared as NOCYCLE and the datatype is large enough to hold MAXVALUE.

  • Same circuit twice with different results

    I've been having some trouble having Multisim match a circuit I have modeled in MATLAB. During the troubleshooting process I put voltage probes on each wire used. The circuit portion in question involves an AC Voltage source connected to a resistor which is then connected to an inductor. I made a copy of the circuit and started from scratch. One of the circuits gives a voltage drop across the resistor, while the other one doesn't drop any voltage at all. I've checked all of the connections and they are all good. The only difference I can see is that one has the pins labeled 1 - 2 while the other is 2 - 1. Does anyone know what the problem is here? I shouldn't not be getting two different results for the same circuit.

    Hi Jmerc,
    Maybe you can post the circuits so that we can compare.
    Tien P.
    National Instruments

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

  • How can i use the same id on two different laptops?

    When trying to use the same login on two different laptops so that i can connect my nook to either depending on which one is free, i get the error that the id is already in use on another computer?

    The issue is embedded in the way the software works.  To comply with the
    Digital Millenium Copyright Act of 2000, all software companies in this
    business keep track of where their software is installed, making
    information about the computer and ereaders part of an ID file.  So, your
    user ID is embedded in the ID file of each computer, but each computer has
    a different ID of its own that is also embedded in that file.  Adobe's
    master server (yes, there is one that you connect to even if you didn't
    know it) also has that information, and when you try to use an ID on one
    that's embedded in the file of another, Adobe's server blows the whistle,
    and as you can see, you can't do that....
    ==========

  • Use two indicators for the same variable in two different VIs

    hello, I want to use two indicators for the same variable in two different VIs running at the same time
    should I use global variables?? I want to avoid because I have lot of variables and it would takes too much memory,I tried with this code but the value of the second indicator is not updated 
    I tried to use the queue and it works but the problem is as i said previously that i have many variables shoud I use a queue for each one??
    what should I do?
    thank you in advance
    cordialy
    Attachments:
    projet.zip ‏13 KB

    CrisSTine01 wrote:
    hello, I want to use two indicators for the same variable in two different VIs running at the same time
    I'm a huge fan of User Events to send updates to GUIs from who knows where.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to use same DFF for two different forms with :BLOCK.field reference

    Hi,
    Can anyone suggest how to use the same dff in two different forms by using :BLOCK.field reference.
    Scenario is the same DFF is referenced by two forms, viz. Form-1 & Form-2.
    Form-1 Reference Field is :BLOCK.field name, but the same block is not available in Form-2, which throws an error while opening it.
    Any pointers please.
    Thanks,

    In the environment I currently have access to do not have similar setup.
    Let say you setup the DFF1 default value to $HEADER.customer_name, the name of the DFF is CUSTOMER_NAME, description can be anything.
    In DFF2, default value should be a SQL, where you can reference the DFF1. For example, SELECT DECODE($FLEX.CUSTOMER_NAME, 'ABC', 1, 'DEF', 2, NULL) FROM dual
    In this case, you can reference the DFF1.

  • HT4528 Can I put the same information on two different i-phones with different numbers and different ID's?

    Can I put the same information on two different i-phones with different numbers and different ID's?

    Yes and no it really depends on what information you are putting on the devices.

  • HT2498 If I use camera window to download my pictures to my computer, and then I copy and paste the pictures to iPhoto. Would I be ending up having the same pictures in two different files in my computer, and so wasting space in my hard drive?

    I recently bought a canon camera. The instructions of the camara recommend to use the canon software (camara window) to download pictures to my computer.  I would like to have my pictures in i-photo because it syncs them to my ipad.
    I want to download the pictures from my camera to camara window, and then drag and drop the pictures to i-photo. If I keep my pictures in both programs would I be wasting space in my computer hard drive by having the same pictures in two different files?

    Yes.
    Ignore the Canon software. It gains you nothing and adds complexity. Just use iPhoto for the lot.
    Regards
    TD

  • Same dimension in two different fact tables

    Hi,
    I have one same dimension in two different fact tables. I would like to know how BI server choose the fact table when I do a request in this dimension.
    I know that is always using the same fact table, but I would like to know why choose this table and not the other.
    Thanks

    Sorry,
    But it doesn't seem to me.
    I reorded the tables in the BMM layer and it continues to use the same table, regardless this table is in last.
    After, I droped that table in the BMM layer and it continued to use the same.
    Thanks for your reply

  • Is it possible to use the same Switch for two different clusters.

    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.

    user9198027 wrote:
    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.
    Yes.  Technically there will not be any conflict as long as the private addresses used by the 2 clusters do not collide, and provided that the switch's port capacity and bandwidth will not be exceeded.
    Your NA (netadmin) can also configure the switch to separate the 2 Interconnects from one another (called partitioning when using Infiniband) - if the switch supports such features.
    A major consideration is not to make the switch, public. That typically cause a range of problems and can have a serious impact on an Interconnect. But using 2 private networks on the same infrastructure should not have the same problems - if configured and implemented correctly.

  • Urgent ! Assigning (or Linking ) the same workbook into two different roles

    Hi Gurus,
    Coul you tell how to link the same workbook to two different roles.
    I am assigning the same workbook to two different roles, but in the second role the workbook is displaying with different structure than in the first role. I want the workbook should be displayed with same structure in both the roles.
    This is Urgernt.
    Thanks in advance.
    Best regards
    Hari

    Hello hari,
    Both the roles should diplay the same layout for a single workbook.
    please ensure that both the users(with these 2 roles) have similar (all the other)authorisations.
    it's possible that one of the users may have further restrictions in authorisations. check out for z-authorisation objects if any.
    hope it helps..
    thanks,
    (*Don't forget to Assign points on SDN)

Maybe you are looking for

  • How to display value in memory

    How to display value in memory, except call function 'LIST_FROM_MEMORY' . Thanks.

  • Uninstaller utility does not remove the installation from the registry

    In our environment, we publish a script in Group Policy so that both the ActiveX and Plugin installs for flash player are easily installed for staff that have limited user access on their computers.  I usually remove or replace the old MSI files from

  • Flash video lags when uploaded to Youtube.

    Hi. I have tried to upload one of my flash videos on youtube, the only problem is that it lags! The sound is perfect, but the film only shows about 1 frame per second, when it's supposed to be 12 frames per second. This is obviously nothing worth wat

  • Move old iTunes Store account over to new MobileMe account

    I currently have two iTunes accounts, one linked to my old Hotmail email and the second one is connected to my MobileMe. At the moment, all purchases done with my iPhone are linked to that Hotmail account, which I'm trying to close down. Is there a w

  • Change return order(Doc type: RE) with BAPI

    Hi Experts, I am trying to change material quantity return document(Doc type: RE) through BAPI. I have tried using BAPI : BAPI_CUSTOMERRETURN_CHANGE, but not able to change quantity, though the BAPI returns success message. Is there any other BAPI/FM