Former Member

# trouble in summing with char...

Dear friends,

I report programing i want to add totals in left hand side

and at bottom.but the quantity to which i hve to add having character like ND there.

system is showing short dump error we cant add numbers with char.can u give some solutions.

regards

veera

10|10000 characters needed characters exceeded

### Related questions

• Former Member
Posted on Aug 29, 2006 at 02:22 PM

Hi Veera,

you can do the arithmetic calculations only for numeric fields...

Regards,

Vidya.

10|10000 characters needed characters exceeded
• Former Member
Posted on Aug 29, 2006 at 02:24 PM

hi Veera,

declare the field that you are declaring it as char as type N or I....

`<b>in that case do this way .. do all the arithematic caluclations that you wnat to do and put them in to I or N variable and then move them in to type C and print ..</b>`

Regards,

Santosh

Message was edited by: Santosh Kumar P

10|10000 characters needed characters exceeded
• Former Member Former Member

hi

i have in final itab char =nd and others r quantity like

10 20 30 etc..hw can i declare...

regards

veera

• Former Member
Posted on Aug 29, 2006 at 02:27 PM

Hi Veera,

what are the values you have in that field...

use a temporary variable of type i in between and do the additions..

again output it as char...

Regards,

Vidya.

10|10000 characters needed characters exceeded
• Former Member
Posted on Aug 29, 2006 at 02:33 PM

As to my understanding of your issue...can you please let us know if all the rows have some characters or the field always starts with some character and digits at the end(which you wish to sum) or there can some rows with char and some with digits and you need to sum only the digit ones ??

Regards

Anurag

10|10000 characters needed characters exceeded
• Former Member Former Member

U can do the following...

loop at itab.

if itab-f1(2) = 'NU'.

lnum = itab-f1+2(10).

lsum = lnum + lsum.

endif.

endloop.

Here lsum will give u the total.

Message was edited by: Anurag Bankley