‎2007 Nov 16 7:38 AM
How do you increment a character variable?
Eg.
DATA: L_VAR1(3) TYPE C,
L_INC(3) TYPE C.
L_VAR1 = '080'
L_INC = '001'.
Then I need in a particular Loop run, L_VAR1 to vary from 080, 081, 082...120.
If I increment it with L_VAR1 = L_VAR1 + L_INC.
The next value stored is 81 and not 081.
Please provide Inputs in2 this.
Thanks
‎2007 Nov 16 7:42 AM
Hi..
Since u need a numeric value. Declare with Type N.
Eg:
DATA: L_VAR1(3) TYPE N,
L_INC(3) TYPE N.
L_VAR1 = '080'
L_INC = '001'.
Then:
L_VAR1 = L_VAR1 + L_INC. "This will work.
<b>
REWARD IF HELPFUL.</b>
‎2007 Nov 16 7:42 AM
Hi..
Since u need a numeric value. Declare with Type N.
Eg:
DATA: L_VAR1(3) TYPE N,
L_INC(3) TYPE N.
L_VAR1 = '080'
L_INC = '001'.
Then:
L_VAR1 = L_VAR1 + L_INC. "This will work.
<b>
REWARD IF HELPFUL.</b>
‎2007 Nov 16 7:45 AM
Hi Anand,
Declare anothere integer variable and pass final char value to that and try you will get the desired output.
Satish