‎2007 Apr 30 5:51 AM
Hi,
I have following code:
loop at gt_pimcall where mvgr4 = 'PS'.
clear: gt_sumdien.
gt_sumdien-pim_posnr = gt_pimcall-pim_posnr.
gt_sumdien-prod_base = gt_pimcall-prod_base.
gt_sumdien-pl = gt_pimcall-pl.
gt_sumdien-total_price = gt_pimcall-total_price.
gt_sumdien-discount = gt_pimcall-discount.
collect gt_sumdien.
endloop.
gt_pimcall-total_price and gt_pimcall-discount are character types of size 15.
The structure of gt_sumdien is as below:
data: begin of gt_sumdien occurs 0,
pim_posnr like zupistgitm-pim_posnr,
prod_base like zupistgitm-prod_base,
prod_option like zupistgitm-prod_option,
pl like zupistgitm-pl,
total_price type i,
discount type i,
end of gt_sumdien.
The COLLECT statment in the above code will fail with OVERFLOW exception when ever the value in total_price or discount exceeds "2147483647" as this is the maximum value a field of type I can accept.
Can any one suggest what I should do so that the above piece of code doent throw an exception. The point is total_price can have -ve value, decimal values.
Please suggest me what data type I have to use so that program doesnt go for a dump.
Regards,
Ganesh
‎2007 Apr 30 5:54 AM
‎2007 Apr 30 5:58 AM
Hi,
When I declared the variable as type F, and when I try to print the values in the iternal table, I am seeing data somthing like this "1.23456789E+15". Any way so that we can see the values in the normal format.
regards,
Ganesh
‎2007 Apr 30 6:01 AM
Hi,
Just move this value 1.23456789E+15 to some other character type variable and then print it else make that particular column to text column.
Regards,
Suresh
‎2007 Apr 30 6:03 AM
You can use COLLECT for data type F,
Any way so that we can see the values in the normal format.
Suppose ITAB-CNT is the field of type F: To display without Exponents and Decimal points,
WRITE itab-cnt EXPONENT 0 DECIMALS 0.
‎2007 Apr 30 6:12 AM
Actually the values in the internal table will be used for a BDC, and when I try to populated the BDC tables, its again throwing error.
Regards,
Ganesh
‎2007 Apr 30 6:16 AM
HI..
before sending that value to BDC,
move that float value into a type P:
data:
<b> w_pack type p decimals 0.</b> * mention the decimals as u required 0,1,2....
<b>move w_float to w_pack.</b>
send this value to BDC...
‎2007 Apr 30 5:54 AM
Hi
Either use TYPE P DECIMALS 2 or
use the FLOAT type.
it will take care.
reward if useful
regards
Anji
‎2007 Apr 30 5:56 AM
Will I be able to use the collect statement if I declare the variable as F.