Need arithmetic operation result in Fixed point arithmetic disabled prg

Hi,
I am writing an enhancement which is in standard SAP program which is not enabled for 'Fixed arithmetic' calculations.
I need to do some actual arithmetic operation involving packed numbers in my enhancement.
Say 
p1 = '2.00'
p2 = '12.00'.
result = p1 * p2.
result coming is 2400.00. This is because Fixed point arithmetic is disabled in standard program.
I need a result of 24.00 . Is there any solution to this apart from dividing it with 100?
Regards,
Dhana

based on P1 and P2 values you need to divide the value with 100 or 1000 as per the number of decimals on P1 and P2

Similar Messages

  • ODBC BI Server Bug - arithmetic operation resulted in an overflow

    I am trying to write some really simple .NET code access the Oracle BI Server ODBC driver and it's not working at all.  I've connected fine, however it seems like anything I try to do related to getting database information spits up an error "arithmetic operation resulted in an overflow".
    Here is the code:
    Dim ConnectString As String
    Dim FactoryType As String
    Dim Factory As System.Data.Common.DbProviderFactory
    Dim Connection As System.Data.Common.DbConnection = Nothing
    Dim TablesData As System.Data.DataTable = Nothing
    Dim err As String = ""
    Dim nl As String = Chr(13) + Chr(10)
    Try
        ' Connect to the database via ODBC
        ConnectString = "DSN=BSODBC_7;uid=TheUser10;pwd=************"
        FactoryType = "System.Data.Odbc"
        Factory = System.Data.Common.DbProviderFactories.GetFactory(FactoryType)
        Connection = Factory.CreateConnection
        Connection.ConnectionString = ConnectString
        Connection.Open()
        ' Request a list of tables from the database
        ' ** Tried both with restrictions and without
        ' ERROR on this line:
        ' “Arithmetic operation resulted in an overflow.”
        TablesData = Connection.GetSchema("Tables")
        ' Show the list of tables on the screen in a grid
        ' If it was successful.
        OnScreenGrid.AutoGenerateColumns = True
        OnScreenGrid.DataSource = TablesData
    Catch ex As Exception
        ' Report the error
        err = ex.Message
        If Not (ex.InnerException Is Nothing) Then
            If Not (ex.InnerException.Message Is Nothing) Then
                err = err + nl + nl + ex.InnerException.Message
            End If
        End If
        MsgBox(err, MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Error")
    Finally
        ' Clean up and Close the DB Connection
        If Not (Connection Is Nothing) Then
            Connection.Close()
            Connection.Dispose()
            Connection = Nothing
        End If
    End Try
    Any Thoughts?  Is this a known bug?  Is there a fix?

    I doubt on line
    OnScreenGrid.DataSource = TablesData
    instead of array as TablesData try to take List object and assign it to OnScreenGrid.DataSource
    just in case check this
    DataGridView.AutoGenerateColumns Property (System.Windows.Forms)
    I might be wrong but just check it

  • Usage of NOT having Fixed Point Arithmetic?

    Hello!
    SAP recommends to always do programs with Fixed Point Arithmetic attribute checked. Please don't explain here what is Fixed Point Arithmetic - I know this and it's is not my question.
    The question is: why do we have it at all? Why aren't all programs simply fixed-point-arithmetic without attribute to activate or deactivate this?
    I suppose that there are situations which require Fixed Point Arithmetic NOT being set, but I can't imagine any. Could anyone offer an explanation?
    Thanks in advance!
    Igor
    Edited by: Igor Barbaric on Mar 21, 2008 9:30 AM
    No replies - I'll try to bring the question to your attention once again:
    Please, does anybody know the purpose of NOT having Fixed Point Arithmetic?

    Please check if this helps u
    This attribute defines, whether for numerical data objects of data type p (packed numbers) is the decimal point is relevant in calculations or assignments or if it is omitted. Normally, this attribute is always switched on and you might ask, why it can be switched off at all. Well, in very ancient times packed numbers had no real decimal point. It was taken into account only for presentation purposes. In order to stay downward compatible, for the introduction of fixed point arithmetic this switch was needed. In fact there are still programs that switch fixed point arithmetic off ¨C for example financial programs that calculate on the basis of cents instead of dollars.
    Thanks Arjun

  • User Exit Fixed Point Arithmetic

    Dear all,
      I have developed some code on the user exit RV61AFZB and tried to change the value on the xkomv-kbetr.  But, i found that the division result is wrong.
    Example:
    DATA: temp like xkomv-kbetr,
               c_test LIKE xkomv-kbetr VALUE '152000.00',
               c_qty like xkomv-kbetr value '3.00'.
       temp  = c_test / c_qty.
    The value of temp became 506.67.  Since, this is a user exit and i can't change program attribute "Fixed Point Arithmetic" .
    Regards,
    Kit

    Hello
    Try this:
    DATA: temp like xkomv-kbetr,
               c_test LIKE xkomv-kbetr VALUE '152000.00',
               c_qty like xkomv-kbetr value '3.00'.
    data: temp1 type i.
       temp  = c_test / c_qty.
       temp1 = temp.

  • MySQL connection and Arithmetic operation resulted in an overflow

    Hi
    I installed MySQL connector and created a user DSN. In SSIS, a data source connection using ADO Net Source created and I was able to run a simple select statement in preview. But when I run a test transferring data from MYSQL to SQL, I got the following
    error.
    Error: 0xC0047062 at Data Flow Task, ADO NET Source [59]: System.OverflowException: Arithmetic operation resulted in an overflow.
       at System.Data.Odbc.SQLLEN.op_Implicit(SQLLEN value)
       at System.Data.Odbc.OdbcDataReader.BuildMetaDataInfo()
       at System.Data.Odbc.OdbcDataReader.GetSchemaTable()
       at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.PreExecute()
    I tested by limiting only 100 records of a single column and it worked. when I changed it to 1000 limits, I get an error.
    I am wondering if this has to do with the size of the records. What is going on here?

    This means you chose a too limiting datatype.
    You need to enlarge the one in question, or use a different one that can accommodate greater values.
    Arthur My Blog

  • Power query from ODBC :"DataSource.Error: Arithmetic operation resulted in an overflow"

    Good day
    Everytime I want to pull data into a query from our servers it gives the error "DataSource.Error: Arithmetic operation resulted in an overflow". What is the reason for this error, and how do I get past this bump.
    Thanks in advance
    Arnoux

    Hey Tristan. Thanks I did that yes.
    For some reason my direct MySQL connection does not want to work.
    I get the following error
    DataSource.Error: MySQL: Unable to find a database provider with invariant name 'MySql.Data.MySqlClient'.
    This error may have been the result of provider-specific client software being required but missing on this computer.  To download client software for this provider, visit the following site and choose at minimum 'MySQL Connector/Net':

  • Division without Fixed Point Arithmetic

    Hello,
         I am trying to divide 1 by a decimal, i.e.  1 / 7.75027, in Include RV63A900 of Function Group V61A.  Since the ' Fixed Point Arithmetic' checkbox is not checked, I am unable to get this calculation to work. 
         I have tried different scenarios of using a floating point field to receive the quotient but nothing has worked.
    Any suggestions? 
    Thank you,
    Chris Mowl

    I use floating variable some thing like this :
    data: v_f TYPE f,
             v_c TYPE char12.
          v_f = ( wa_komp_o-netwr / o_komp-mglme ).
    * Due to decimal issues had to use Floating point value
    * for calculation of condition base value
          CALL FUNCTION 'FLTP_CHAR_CONVERSION'
            EXPORTING
              decim = 5
              input = v_f
            IMPORTING
              flstr = v_c.
          v_amount = v_c * 10.

  • Arithmetic operation resulted in an overflow - The remote server returned an error: (407) Proxy Authentication Required

    Hello I read and tried the previous forum suggestions. I have deleted the role and readded it. I use a domain account that is able to get through the proxy. Each time a variant of the Proxy error is returned. The site is on server 2008 R2.
    The AI certificate is valid and specified in the console. I am not sure what could be missing. Everything used to work as specified on Server 2003. This configuration is the same, but it is no longer able to sync. Thanks.   

    Would recommend that you elaborate on what issue you are facing so that the community can help.
    Blog: http://theinfraguys.com
    Follow me at Facebook
    The Infra Guys Facebook Page
    Join the Singapore System Center Admin Group
    SG System Center Admin Group
    Please remember to click Mark as Answer on the answer if it helps you in anyway

  • Using Modulus (%) arithmetic operator with decimals

    When trying to use the arithmetic operator modulus with decimals there seem to be some errors in the results. Is there a restriction on the number/value of decimals that can be used with this operator? Am I perhaps just using it incorrectly?
    example ...
    Double valA= new Double("12.4");
    Double valB = new Double("1236");
    double result = valB.floatValue() % valA.floatValue();
    System.out.println("valB : " + valB );
    System.out.println("valA: " + valA);
    System.out.println("result : " + result);
    produces :
    valB : 1236.0
    valA : 12.4
    result : 8.40003776550293
    But :
    Double valA= new Double("12.5");
    Double valB = new Double("1236");
    double result = valB.floatValue() % valA.floatValue();
    System.out.println("valB : " + valB );
    System.out.println("valA: " + valA);
    System.out.println("result : " + result);
    produces :
    valB : 1236.0
    valA : 12.5
    result : 11.0

    Floating point arithmetic in general is not exact. The problem is that you are expecting exact results.
    In the second example where you use 12.5 and 1236.0 is just so happens that both of those numbers can be represented exactly, so you do get an exact result.

  • Inline functions in C, gcc optimization and floating point arithmetic issues

    For several days I really have become a fan of Alchemy. But after intensive testing I have found several issues which I'd like to solve but I can't without any help.
    So...I'm porting an old game console emulator written by me in ANSI C. The code is working on both gcc and VisualStudio without any modification or crosscompile macros. The only platform code is the audio and video output which is out of scope, because I have ported audio and video witin AS3.
    Here are the issues:
    1. Inline functions - Having only a single inline function makes the code working incorrectly (although not crashing) even if any optimization is enabled or not (-O0 or O3). My current workarround is converting the inline functions to macros which achieves the same effect. Any ideas why inline functions break the code?
    2. Compiler optimizations - well, my project consists of many C files one of which is called flash.c and it contains the main and exported functions. I build the project as follows:
    gcc -c flash.c -O0 -o flash.o     //Please note the -O0 option!!!
    gcc -c file1.c -O3 -o file1.o
    gcc -c file2.c -O3 -o file2.o
    ... and so on
    gcc *.o -swc -O0 -o emu.swc   //Please note the -O0 option again!!!
    mxmlc.exe -library-path+=emu.swc --target-player=10.0.0 Emu.as
    or file in $( ls *.o ) //Removes the obj files
        do
            rm $file
        done
    If I define any option different from -O0 in gcc -c flash.c -O0 -o flash.o the program stops working correctly exactly as in the inline funtions code (but still does not crash or prints any errors in debug). flash has 4 static functions to be exported to AS3 and the main function. Do you know why?
    If I define any option different from -O0 in gcc *.o -swc -O0 -o emu.swc  the program stops working correctly exactly as above, but if I specify -O1, -O2 or O3 the SWC file gets smaller up to 2x for O3. Why? Is there a method to optimize all the obj files except flash.o because I suspect a similar issue as when compilling it?
    3. Flating point issues - this is the worst one. My code is mainly based on integer arithmetic but on 1-2 places it requires flating point arithmetic. One of them is the conversion of 16-bit 44.1 Khz sound buffer to a float buffer with same sample rate but with samples in the range from -1.0 to 1.0.
    My code:
    void audio_prepare_as()
        uint32 i;
        for(i=0;i<audioSamples;i+=2)
            audiobuffer[i] = (float)snd.buffer[i]/32768;
            audiobuffer[i+1] = (float)snd.buffer[i+1]/32768;
    My audio playback is working perfectly. But not if using the above conversion and I have inspected the float numbers - all incorrect and invalid. I tried other code with simple floats - same story. As if alchemy refuses to work with floats. What is wrong? I have another lace whre I must resize the framebuffer and there I have a float involved - same crap. Please help me?
    Found the floating point problem: audiobuffer is written to a ByteArray and then used in AS. But C floats are obviously not the same as those in AS3. Now the floating point is resolved.
    The optimization issues remain! I really need to speed up my code.
    Thank you in advice!

    Dear Bernd,
    I am still unable to run the optimizations and turn on the inline functions. None of the inline functions contain any stdli function just pure asignments, reads, simple arithmetic and bitwise operations.
    In fact, the file containing the main function and those functions for export in AS3 did have memset and memcpy. I tried your suggestion and put the code above the functions calling memset and memcpy. It did not work soe I put the code in a header which is included topmost in each C file. The only system header I use is malloc.h and it is included topmost. In other C file I use pow, sin and log10 from math.h but I removed it and made the same thing:
    //shared.h
    #ifndef _SHARED_H_
    #define _SHARED_H_
    #include <malloc.h>
    static void * custom_memmove( void * destination, const void * source, unsigned int num ) {
      void *result; 
      __asm__("%0 memmove(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); 
      return result; 
    static void * custom_memcpy ( void * destination, const void * source, unsigned int num ) { 
      void *result; 
      __asm__("%0 memcpy(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); 
      return result; 
    static void * custom_memset ( void * ptr, int value, unsigned int num ) { 
      void *result; 
      __asm__("%0 memset(%1, %2, %3)\n" : "=r"(result) : "r"(ptr), "r"(value), "r"(num)); 
      return result; 
    static float custom_pow(float x, int y) {
        float result;
      __asm__("%0 pow(%1, %2)\n" : "=r"(result) : "r"(x), "r"(y));
      return result;
    static double custom_sin(double x) {
        double result;
      __asm__("%0 sin(%1)\n" : "=r"(result) : "r"(x));
      return result;
    static double custom_log10(double x) {
        double result;
      __asm__("%0 log10(%1)\n" : "=r"(result) : "r"(x));
      return result;
    #define memmove custom_memmove
    #define memcpy custom_memcpy
    #define memset custom_memset
    #define pow custom_pow
    #define sin custom_sin
    #define log10 custom_log10 
    #include "types.h"
    #include "macros.h"
    #include "m68k.h"
    #include "z80.h"
    #include "genesis.h"
    #include "vdp.h"
    #include "render.h"
    #include "mem68k.h"
    #include "memz80.h"
    #include "membnk.h"
    #include "memvdp.h"
    #include "system.h"
    #include "loadrom.h"
    #include "input.h"
    #include "io.h"
    #include "sound.h"
    #include "fm.h"
    #include "sn76496.h" 
    #endif /* _SHARED_H_ */ 
    It still behave the same way as if nothing was changed (works incorrectly - displays jerk which does not move, whereby the image is supposed to move)
    As I am porting an emulator (Sega Mega Drive) I use manu arrays of function pointers for implementing the opcodes of the CPU's. Could this be an issue?
    I did a workaround for the floating point problem but processing is very slow so I hear only bzzt bzzt but this is for now out of scope. The emulator compiled with gcc runs at 300 fps on a 1.3 GHz machine, whereby my non optimized AVM2 code compiled by alchemy produces 14 fps. The pure rendering is super fast and the problem lies in the computational power of AVM. The frame buffer and the enulation are generated in the C code and only the pixels are copied to AS3, where they are plotted in a BitmapData. On 2.0 GHz Dual core I achieved only 21 fps. Goal is 60 fps to have smooth audio and video. But this is offtopic. After all everything works (slow) without optimization, and I would somehow turn it on. Suggestions?
    Here is the file with the main function:
    #include "shared.h"
    #include "AS3.h"
    #define FRAMEBUFFER_LENGTH    (320*240*4)
    static uint8* framebuffer;
    static uint32  audioSamples;
    AS3_Val sega_rom(void* self, AS3_Val args)
        int size, offset, i;
        uint8 hardware;
        uint8 country;
        uint8 header[0x200];
        uint8 *ptr;
        AS3_Val length;
        AS3_Val ba;
        AS3_ArrayValue(args, "AS3ValType", &ba);
        country = 0;
        offset = 0;
        length = AS3_GetS(ba, "length");
        size = AS3_IntValue(length);
        ptr = (uint8*)malloc(size);
        AS3_SetS(ba, "position", AS3_Int(0));
        AS3_ByteArray_readBytes(ptr, ba, size);
        //FILE* f = fopen("boris_dump.bin", "wb");
        //fwrite(ptr, size, 1, f);
        //fclose(f);
        if((size / 512) & 1)
            size -= 512;
            offset += 512;
            memcpy(header, ptr, 512);
            for(i = 0; i < (size / 0x4000); i += 1)
                deinterleave_block(ptr + offset + (i * 0x4000));
        memset(cart_rom, 0, 0x400000);
        if(size > 0x400000) size = 0x400000;
        memcpy(cart_rom, ptr + offset, size);
        /* Free allocated file data */
        free(ptr);
        hardware = 0;
        for (i = 0x1f0; i < 0x1ff; i++)
            switch (cart_rom[i]) {
         case 'U':
             hardware |= 4;
             break;
         case 'J':
             hardware |= 1;
             break;
         case 'E':
             hardware |= 8;
             break;
        if (cart_rom[0x1f0] >= '1' && cart_rom[0x1f0] <= '9') {
            hardware = cart_rom[0x1f0] - '0';
        } else if (cart_rom[0x1f0] >= 'A' && cart_rom[0x1f0] <= 'F') {
            hardware = cart_rom[0x1f0] - 'A' + 10;
        if (country) hardware=country; //simple autodetect override
        //From PicoDrive
        if (hardware&8)        
            hw=0xc0; vdp_pal=1;
        } // Europe
        else if (hardware&4)    
            hw=0x80; vdp_pal=0;
        } // USA
        else if (hardware&2)    
            hw=0x40; vdp_pal=1;
        } // Japan PAL
        else if (hardware&1)      
            hw=0x00; vdp_pal=0;
        } // Japan NTSC
        else
            hw=0x80; // USA
        if (vdp_pal) {
            vdp_rate = 50;
            lines_per_frame = 312;
        } else {
            vdp_rate = 60;
            lines_per_frame = 262;
        /*SRAM*/   
        if(cart_rom[0x1b1] == 'A' && cart_rom[0x1b0] == 'R')
            save_start = cart_rom[0x1b4] << 24 | cart_rom[0x1b5] << 16 |
                cart_rom[0x1b6] << 8  | cart_rom[0x1b7] << 0;
            save_len = cart_rom[0x1b8] << 24 | cart_rom[0x1b9] << 16 |
                cart_rom[0x1ba] << 8  | cart_rom[0x1bb] << 0;
            // Make sure start is even, end is odd, for alignment
            // A ROM that I came across had the start and end bytes of
            // the save ram the same and wouldn't work.  Fix this as seen
            // fit, I know it could probably use some work. [PKH]
            if(save_start != save_len)
                if(save_start & 1) --save_start;
                if(!(save_len & 1)) ++save_len;
                save_len -= (save_start - 1);
                saveram = (unsigned char*)malloc(save_len);
                // If save RAM does not overlap main ROM, set it active by default since
                // a few games can't manage to properly switch it on/off.
                if(save_start >= (unsigned)size)
                    save_active = 1;
            else
                save_start = save_len = 0;
                saveram = NULL;
        else
            save_start = save_len = 0;
            saveram = NULL;
        return AS3_Int(0);
    AS3_Val sega_init(void* self, AS3_Val args)
        system_init();
        audioSamples = (44100 / vdp_rate)*2;
        framebuffer = (uint8*)malloc(FRAMEBUFFER_LENGTH);
        return AS3_Int(vdp_rate);
    AS3_Val sega_reset(void* self, AS3_Val args)
        system_reset();
        return AS3_Int(0);
    AS3_Val sega_frame(void* self, AS3_Val args)
        uint32 width;
        uint32 height;
        uint32 x, y;
        uint32 di, si, r;
        uint16 p;
        AS3_Val fb_ba;
        AS3_ArrayValue(args, "AS3ValType", &fb_ba);
        system_frame(0);
        AS3_SetS(fb_ba, "position", AS3_Int(0));
        width = (reg[12] & 1) ? 320 : 256;
        height = (reg[1] & 8) ? 240 : 224;
        for(y=0;y<240;y++)
            for(x=0;x<320;x++)
                di = 1280*y + x<<2;
                si = (y << 10) + ((x + bitmap.viewport.x) << 1);
                p = *((uint16*)(bitmap.data + si));
                framebuffer[di + 3] = (uint8)((p & 0x1f) << 3);
                framebuffer[di + 2] = (uint8)(((p >> 5) & 0x1f) << 3);
                framebuffer[di + 1] = (uint8)(((p >> 10) & 0x1f) << 3);
        AS3_ByteArray_writeBytes(fb_ba, framebuffer, FRAMEBUFFER_LENGTH);
        AS3_SetS(fb_ba, "position", AS3_Int(0));
        r = (width << 16) | height;
        return AS3_Int(r);
    AS3_Val sega_audio(void* self, AS3_Val args)
        AS3_Val ab_ba;
        AS3_ArrayValue(args, "AS3ValType", &ab_ba);
        AS3_SetS(ab_ba, "position", AS3_Int(0));
        AS3_ByteArray_writeBytes(ab_ba, snd.buffer, audioSamples*sizeof(int16));
        AS3_SetS(ab_ba, "position", AS3_Int(0));
        return AS3_Int(0);
    int main()
        AS3_Val romMethod = AS3_Function(NULL, sega_rom);
        AS3_Val initMethod = AS3_Function(NULL, sega_init);
        AS3_Val resetMethod = AS3_Function(NULL, sega_reset);
        AS3_Val frameMethod = AS3_Function(NULL, sega_frame);
        AS3_Val audioMethod = AS3_Function(NULL, sega_audio);
        // construct an object that holds references to the functions
        AS3_Val result = AS3_Object("sega_rom: AS3ValType, sega_init: AS3ValType, sega_reset: AS3ValType, sega_frame: AS3ValType, sega_audio: AS3ValType",
            romMethod, initMethod, resetMethod, frameMethod, audioMethod);
        // Release
        AS3_Release(romMethod);
        AS3_Release(initMethod);
        AS3_Release(resetMethod);
        AS3_Release(frameMethod);
        AS3_Release(audioMethod);
        // notify that we initialized -- THIS DOES NOT RETURN!
        AS3_LibInit(result);
        // should never get here!
        return 0;

  • Overflow for arithmetical operation (type P) in program.

    Hi experts..
    I had developed a report for showing total receipt and issues and confirmed issue.
    of PQ.
    For all the plant is running fine but only for one plant 2050 its going into dump and error is "Overflow for arithmetical operation (type P) in program." and the code line is
    T_EKET-MNG02 = T_EKET-MNG02 * ( t_mdbs-umrez / t_mdbs-umren ).
    MNG02 IS OF TYPE  Data : "Quan", length =13 , decimal = 3.
    initially : value in Mng02 is =  10       and ratio is 11/8 = 1.375
                  and in the debugging the value is   10*1.375 = 13.75
    but... when i am executing it .. its going into dump and after again checking the MNG02 is showing valude --9765133613.881  and the above error.
    what should i do....
    please help..
    i will award the points for every help...
    thanks

    Hi,
    Are you doing any other calculation for field MNG02 in your program?
    I created a small program with the field and values you have mentioned and it gave me the result 13.75 and no short dump.
    Please check following things:
    When short dump occurs, it shows at which line it has occured. Is it showing that the shortdump has occurs on the line you are talking about here or it is somewhere else.
    Also, when shortdump occurs, it shows a "debugging" button at the top. Hit that button and it will show you exactly where the short dump has occured. What ever this statement is, check what are the values of different variables here.
    Check all these and you might get the answer. Let me know if you still have problem.
    Regards,
    RS

  • Arithmetic operations using Picklist field values

    Hi,
    I tried to multiply a picklist field value as below and wanted to store the result in a field (datatype = Integer or Number) using a workflow which triggers based on the Trigger Event "Before modified record saved".
    Criticality = [<plFrequency_of_Occurrence_ITAG>] * 10
    It throws an error:
    "Update Criticality : Value too long for field 'ZNum_0' (maximum size 16). (SBL-DAT-00235)(SBL-ODS-00500)"
    Can't we do arithmetic operations on the Picklist fields? I believe this is because the values are being stored as text??
    Do we have a function to convert the character field to numeric before we perform any arithmetic operations?
    Thanks,
    Sriram

    Hi,
    You're right, you can't perform arithmetic operations with a number and a text. That's why you get the error.
    Today, there's no function you can use to convert a text to a number.
    You'll need to create a SR asking for a Change Request.
    Regards,
    Max

  • Overflow during the arithmetical operation (type P) in program "SAPLV61A

    hi,
        I am getting this error in VA01(sales order)
    Runtime error              Compute_bcd_overflow
    Except                       Cx_sy_arithmetic_overflow.
    Overflow during the arithmetical operation (type P) in program "SAPLV61A
    Error in particular line is.
    1388           ADD  xkomv-kwert  TO komp-mwsbp.
    Please give me the solution with detail decsription.How to solve with step by step.

    Hi,
    Instead of directly assigning the value to xkomv-kbetr. Store the value in a temporary variable of type p length 13 decimals 2 . Multiply by 10^n to get the correct result.
    Then assign the temp value to xkomv-kbetr.
    Sample Code
    DATA : lv_temp TYPE P length 13 decimals 2.
    lv_temp = ( xkwert * 10^n ) / komp-mgame. 
    Then assign lv_temp to xkomv-kbetr.
    To get proper value, you have to multiply or divide by 10^n .
    Regards,
    DPM

  • VEctor: Problem in arithmetical operation

    The problem with the following code is that when an element is accessed with v.elementAt() the compilation is OK. But if I try to do some arithmetic operation on the element, it won't compile, giving the message -
    VectorDemo.java:36: operator * cannot be applied to java.lang.Object, int
    System.out.println("Result: "+v.elementAt(3)*2);
    Is it because of <Object> type declaration of Vector? If so how to do arithmetic operation with an element of a vector which may have Double, Float or Integer type of elements in the same vector?
    import java.util.*;
    class VectorDemo
         public static void main(String args[])
              Vector<Object> v=new Vector<Object>(3,2);
              System.out.println("Initial size: "+v.size());
              System.out.println("Initial capacity: "+v.capacity());
              v.addElement(new Integer(1));
              v.addElement(new Integer(2));
              v.addElement(new Integer(3));
              v.addElement(new Integer(4));
              System.out.println("Capacity after four additions: "+v.capacity());
              v.addElement(new Double(5.45));
              System.out.println("Current capacity : "+v.capacity());
              v.addElement(new Double(6.08));
              v.addElement(new Integer(7));
              System.out.println("Current capacity : "+v.capacity());
              v.addElement(new Float(9.4));
              v.addElement(new Integer(10));
              System.out.println("Current capacity : "+v.capacity());
              v.addElement(new Integer(11));
              v.addElement(new Integer(12));
              System.out.println("First element : "+v.firstElement());
              System.out.println("Last element : "+v.lastElement());
              System.out.println("Find Result: "+v.elementAt(3));     //<------ if replaced with:
                                    //System.out.println("Find Result: "+v.elementAt(3)*2);
              if(v.contains(new Integer(3)))
                   System.out.println("Vector contains 3.");
              Enumeration vEnum=v.elements();
              System.out.println("\nElements in vector: ");
              while(vEnum.hasMoreElements())
                   System.out.println(vEnum.nextElement()+" ");
              System.out.println();
    }

    Here's the correct code.
    import java.util.*;
    import java.lang.Number;
    class VectorDemo
         public static void main(String args[])
              //initial size is 3, increment is 2
              String s;
              int i=0;
              Vector<Number> v=new Vector<Number>(3,2);
              System.out.println("Initial size: "+v.size());
              System.out.println("Initial capacity: "+v.capacity());
              v.addElement(new Integer(1));
              v.addElement(new Integer(2));
              v.addElement(new Integer(3));
              v.addElement(new Integer(4));
              System.out.println("Capacity after four additions: "+v.capacity());
              v.addElement(new Double(5.45));
              System.out.println("Current capacity : "+v.capacity());
              v.addElement(new Double(6.08));
              v.addElement(new Integer(7));
              System.out.println("Current capacity : "+v.capacity());
              v.addElement(new Float(9.4));
              v.addElement(new Integer(10));
              System.out.println("Current capacity : "+v.capacity());
              v.addElement(new Integer(11));
              v.addElement(new Integer(12));
              System.out.println("First element : "+v.firstElement());
              System.out.println("Last element : "+v.lastElement());
              System.out.println("Result: "+Integer.parseInt(v.elementAt(3).toString())*2);
              if(v.contains(new Integer(3)))
                   System.out.println("Vector contains 3.");
              //enumerate the elements in the vector.
              Enumeration vEnum=v.elements();
              System.out.println("\nElements in vector: ");
              while(vEnum.hasMoreElements())
                   System.out.println(vEnum.nextElement()+" ");
              System.out.println();
    }

  • [nQSError: 22023] An arithmetic operation is being carried out on a non-num

    Hi All,
    I have created a logical column for rolling period based on a measure. I have used newly created rolling period column to create another column. I have checked the global consistency there were no errors in rpd. I have uploaded the rpd, when I was trying to expand that table in Answers it is giving an error *"State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 22023] An arithmetic operation is being carried out on a non-numeric type. (HY000)"*
    The base measure has aggregation rule. Please help to find resolve this issue.
    Thanks in advance.

    Rolling Amount- "PeriodRolling("Core"."Fact - Sales - Orders"."Order Amount" , -10, 0)"
    Amount- "case when VALUEOF("No_of_Days"."No_of_days") <= 10 then ( "Core"."Fact - Sales - Orders"."Rolling Amount" / 10) * VALUEOF("No_of_Days"."No_of_days") else "Core"."Fact - Sales - Orders"."Order Amount" / VALUEOF("No_of_Days"."No_of_days") end"
    I have created above two measures.
    Expand table means we need click on + symbol besides the table name to select columns, it is not allowing me to click on that + sysmbol.

Maybe you are looking for