08-29-2006 3:20 PM
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
08-29-2006 3:22 PM
Hi Veera,
you can do the arithmetic calculations only for numeric fields...
Regards,
Vidya.
08-29-2006 3:24 PM
hi vidya
but iam having char in my display...
hw to solve..
regards
veera
08-29-2006 3: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
08-29-2006 3:27 PM
hi santosh
but the field having both nume and char in my itab...
regards
veera
08-29-2006 3:30 PM
do all the arethimatic calculatiosn and store in some temporary I or N variables and then finally when you display them move them on to char variables...
08-29-2006 3:31 PM
Hi,
use an numeric type field and then move your value in character variable to this numeric field and then do the calculations.
if you have only numeric and without decimals,
use I or N.
DATA : V_INT type I.
v_int = v_char .
then use V_INT in your calculations
Regards
Srikanth
08-29-2006 3:43 PM
hi
thanks for replying...
i have in final itab char =nd and others r quantity like
10 20 30 etc..hw can i declare...
regards
veera
08-29-2006 3: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.
08-29-2006 3:32 PM
08-29-2006 3: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
08-29-2006 3:46 PM
hi
according to condtion this char(nd) is comming in display ,if condtion = yes ,nd will be placed there, otherwise nu(quantity) will be comming...
it can come in any place..
regards
veera
08-29-2006 3:50 PM
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