Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Collect statement generating dump CX_SY_ARITHMETIC_OVERFLOW

Jay_Kamdar
Participant
0 Likes
1,828

Dear all,

i have created an internal table variable - it_table with header line,

It has a field named amount typed - OIUH_CURR22_2 - Length 22

I am using the collect statement as follows :

         collect it_table.



The report generates a dump when there is a large amount of data.

but i am sure that the amount field does not exceed 22 digits

and only this field is generating the dump.


The error description and code for your analysis :




loop at lt_bset into ls_bset.
       if ls_bset-shkzg = 'H'.
         ls_bset-FWSTE = - ls_bset-FWSTE.
       endif.
*    if ls_bset-mwskz <> 'V0' and ls_bset-FWBAS <> '9227.00'.
       ls_bset-KBETR = ls_bset-kbetr / 10.
       read table it_table with key docnum = ls_bset-belnr year = ls_bset-gjahr category = 'Domestic'.
       if sy-subrc = 0.
         case ls_bset-KSCHL.
           when 'JMOP' or 'JMIP'.
             it_table-tot_basic = it_table-tot_basic + ls_bset-FWBAS.
             it_table-exc_duty  = ls_bset-FWSTE.
             it_table-tax_code  = ls_bset-mwskz.
*                it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
           when 'JEON' or 'JE1P' or 'JEC1'.
             it_table-tot_basic = it_table-tot_basic + ls_bset-FWBAS.
             it_table-he        = it_table-he + ls_bset-FWSTE.
             it_table-tax_code  = ls_bset-mwskz.
*                it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
           when 'JSH1' or 'JSH2' or 'JSEP'.
             it_table-tot_basic = it_table-tot_basic + ls_bset-FWBAS.
             it_table-she       = it_table-she + ls_bset-FWSTE.
             it_table-tax_code  = ls_bset-mwskz.
*                it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
           when 'JIP2' or 'JIP5' or 'JIP1' or 'ZIP1' or 'JIPC'.
             it_table-tot_basic = it_table-tot_basic + ls_bset-FWBAS.
             it_table-tax_code  = ls_bset-mwskz.
*                it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
             if  ls_bset-KBETR  = '12.5'  .
               it_table-VAT_125 = it_table-VAT_125 + ls_bset-FWSTE.
               it_table-tax_code  = ls_bset-mwskz.
*                it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
             elseif  ls_bset-KBETR = '8.00'  .
               it_table-VAT_8     = it_table-VAT_8 + ls_bset-FWSTE.
               it_table-tax_code  = ls_bset-mwskz.
*                it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
             elseif  ls_bset-KBETR = '5.00'.
               it_table-VAT_5   = it_table-VAT_5 + ls_bset-FWSTE.
               it_table-tax_code  = ls_bset-mwskz.
*                   it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
             elseif  ls_bset-KBETR = '4.00'.
               it_table-VAT_4   it_table-VAT_4 + ls_bset-FWSTE.
               it_table-tax_code  = ls_bset-mwskz.
*                   it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
             elseif  ls_bset-KBETR = '2.00'.
               it_table-CST_2   = it_table-CST_2 + ls_bset-FWSTE.
               it_table-tax_code  = ls_bset-mwskz.
*                it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
             endif.
           when 'ZSUR' or 'ZSU2'.
             it_table-tot_basic = it_table-tot_basic + ls_bset-FWBAS.
             it_table-surcharge = it_table-surcharge + ls_bset-FWSTE.
             it_table-tax_code = ls_bset-mwskz.
*               it_table-tot_amt = it_table-tot_amt + ls_bset-FWSTE.
         endcase.
         if ls_bset-FWBAS = '9227.00' .
*             if ls_bset-mwskz = 'VA'.
           it_table-amount_rdc = '9227.00'.
*             if ls_bset-fwste = '9227.00'.
           it_table-tot_basic = 0.
*               lv_mwskz = ''.
*             endif.
         endif.

*          it_table-dele = 'X'.
*          it_table-tot_amt = it_table-tot_amt + it_table-tot_basic.

         collect it_table.

         lv_mwskz = ls_bset-mwskz.
         clear it_table.
       else.
         it_table-dele = 'Y'.
         MODIFY it_table TRANSPORTING DELE WHERE docnum = ls_bset-belnr and year = ls_bset-gjahr.
       endif.
*         if ls_bset-FWBAS = '9227.00'.
*          if ls_bset-mwskz = 'V0'.
*            LOOP at it_table where docnum = ls_bset-belnr and year = ls_bset-gjahr.
*            it_table-amount_rdc = '9227.00'.
**        it_table-tot_amt = it_table-tot_amt + it_table-tot_amt.
*              modify it_table TRANSPORTING amount_rdc.
*              clear it_table.
*              endloop.
*         endif.
*      endif.
     ENDLOOP.





Please provide a solution to overcome this dump.

8 REPLIES 8
Read only

former_member585060
Active Contributor
0 Likes
1,656

Hi,

As per the dump it is refering to field AMOUNT, just see how the AMOUNT field is defined. It seems it is defined as TYPE P.

Thanks & Regards

Bala Krishna

Read only

0 Likes
1,656

Hello Bala Krishna ,

amount typed  as- OIUH_CURR22_2 - data element.

Read only

0 Likes
1,656

Can you try declare the typ P up to 16 bytes and decimal may be 6.

Read only

0 Likes
1,656

Hello Jay,

Have check the by changing the Data element of amount.

So change the data element from OIUH_CURR22_2 to J_1BTPRICE

J_1BTPRICE data element with length 25  and decimal 2

Try this.

Read only

0 Likes
1,656

Hello Kiran,

I have already declared amount with a data element whose length is 22 and decimal places 2.

Are you suggesting to declare it as

amount type p length 16 decimals 06 ?

Read only

0 Likes
1,656

Hello madhu,

thanks , will try this

Read only

0 Likes
1,656

this is also a good option!

Read only

0 Likes
1,656

Hi,

If madhu's suggested data element does not work, try declaring all the amount fields with SRMCURR data element.

Thanks & Regards

Bala Krishna