‎2007 Jan 31 4:39 PM
Hi All,
I declared gv_count as const.
DATA: gv_count type c value 1,
and in the if stmt, I incremented it
gv_count = gv_count + 1.
It is incrementing gv_count upto 9 properly, but 9 + 1 it is taking as '*' instead of 10.
Can you please help me, why it is happening like this.
Thank you
Veni.
‎2007 Jan 31 4:45 PM
Hi,
In your data declaration, <b>gv_count</b> is of type <b>C</b> and length <b>1</b>. Therefore, after 9, it is not taking 10. So, declare the variable of more length.
<b>DATA : gv_count(3) TYPE C VALUE '1'.</b>
Also, if you want to use it as a counter, why are u declaring it of type C, declare it of type I.
<b>DATA : gv_count TYPE i VALUE '1'.</b>
Reward points if the answeR is helpful.
Regards,
Mukul
‎2007 Jan 31 4:40 PM
HI,
-->
DATA: gv_count<b>(5)</b> type c value 1,
( If you don't give a length, the default lenght is one so after '9' the field isn't large enough to pu '10' ! )
But I suggest you to declare like an integer :
DATA: gv_count type <b>i</b> value 1,
Erwan
‎2007 Jan 31 4:41 PM
Hi,
Because you have a character data type which is of length 1..
Change it to INT4.
<b>DATA: gv_count type INT4.</b>
Thanks,
Naren
‎2007 Jan 31 4:45 PM
Hi,
In your data declaration, <b>gv_count</b> is of type <b>C</b> and length <b>1</b>. Therefore, after 9, it is not taking 10. So, declare the variable of more length.
<b>DATA : gv_count(3) TYPE C VALUE '1'.</b>
Also, if you want to use it as a counter, why are u declaring it of type C, declare it of type I.
<b>DATA : gv_count TYPE i VALUE '1'.</b>
Reward points if the answeR is helpful.
Regards,
Mukul
‎2007 Jan 31 4:53 PM
Hi Veni,
Please try to declare like this.
DATA: gv_count type i value 1.
or
DATA: gv_count type n value 1.
Regards,
Ferry Lianto