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

Problem while using At Last Event

Former Member
0 Likes
1,008

hi,

The following is my code...

LOOP AT it_ekpo INTO wa_ekpo.
AT LAST.
      SUM.
      WRITE:/'GRAND TOTAL',69  wa_ekpo-netpr .
    ENDAT.
  ENDLOOP.

After executing the report, it is giving an Runtime Error.

Runtime Errors : Sum_overflow

Can u people give some valuable inputs to solve this issue.

Thanks

Gov

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
978

Cause: Value too large when calculating totals in internal table, field too small

Runtime Error: SUM_OVERFLOW

Increase the size of : wa_ekpo-netpr

9 REPLIES 9
Read only

Former Member
0 Likes
979

Cause: Value too large when calculating totals in internal table, field too small

Runtime Error: SUM_OVERFLOW

Increase the size of : wa_ekpo-netpr

Read only

0 Likes
978

>

> Cause: Value too large when calculating totals in internal table, field too small

> Runtime Error: SUM_OVERFLOW

>

> Increase the size of : wa_ekpo-netpr

Thanks for your reply,

but how can i increase the size of the variable...

here i'm referring to ekpo-netpr

Thanks

Gov

Read only

0 Likes
978

hi,

use datatype as

netpr type bapicurr_d.

It should work...

Rgds.,

subash

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
978

Hi,

While declaring the internal table it_ekpo, try to specify the field width as more than actual field width in the table.

Read only

0 Likes
978

thanks for your replies.

My structure was like this before

TYPES: BEGIN OF ty_ekpo,
          lifnr TYPE ekko-lifnr,    "vendor number
          ebeln TYPE ekko-ebeln,    "purchase document number
          ebelp TYPE ekpo-ebelp,    "Item Number of Purchasing Document
          matnr TYPE ekpo-matnr,    "Material Number
          bukrs TYPE ekpo-bukrs,    "Company Code
          werks TYPE ekpo-werks,    "Plant
          lgort TYPE ekpo-lgort,    "Storage Location
          menge TYPE ekpo-menge,    "Purchase Order Quantity
          netpr TYPE ekpo-netpr,
      END OF ty_ekpo.

Now i changed it to the way u suggested

TYPES: BEGIN OF ty_ekpo,
          lifnr TYPE ekko-lifnr,    "vendor number
          ebeln TYPE ekko-ebeln,    "purchase document number
          ebelp TYPE ekpo-ebelp,    "Item Number of Purchasing Document
          matnr TYPE ekpo-matnr,    "Material Number
          bukrs TYPE ekpo-bukrs,    "Company Code
          werks TYPE ekpo-werks,    "Plant
          lgort TYPE ekpo-lgort,    "Storage Location
          menge TYPE ekpo-menge,    "Purchase Order Quantity
          netpr(16) type p decimals 2,
      END OF ty_ekpo.

But still the problem persists.

I'm getting the same error.

Thanks

Gov

Read only

0 Likes
978

Hi,

Debug the above program, and find out the value of wa_ekpo-netpr and TOTAL value before giving runtime error. Then you will find the required length of the netpr.

Regards,

Read only

0 Likes
978

Hi,

Just try to use

TYPES: BEGIN OF ty_ekpo,

lifnr TYPE ekko-lifnr, "vendor number

ebeln TYPE ekko-ebeln, "purchase document number

ebelp TYPE ekpo-ebelp, "Item Number of Purchasing Document

matnr TYPE ekpo-matnr, "Material Number

bukrs TYPE ekpo-bukrs, "Company Code

werks TYPE ekpo-werks, "Plant

lgort TYPE ekpo-lgort, "Storage Location

menge TYPE ekpo-menge, "Purchase Order Quantity

netpr type GESUM,

END OF ty_ekpo.

Here GESUM is a data element with WERT15 as domain.

Read only

Former Member
0 Likes
978

hi,

try this one..

data: v_netpr type ekpo-netpr.

v_netpr = 0.

LOOP AT it_ekpo INTO wa_ekpo.

v_netpr = v_netpr + wa_ekpo-netpr.

AT LAST.

WRITE:/'GRAND TOTAL', v_netpr .

ENDAT.

ENDLOOP.

if the same error exist, let me know....

Read only

Former Member
0 Likes
978

Thanks for your valuable suggestions