‎2007 May 11 1:14 PM
Hi!
How can I increment a number within a string ?
This code doesn' t provide the rigth result
DATA zahl TYPE I.
DO 10 TIMES.
zahl = zahl + 1.
write:/ 'HALLO zahl'.
ENDDO.
‎2007 May 11 1:20 PM
thanks but it is not ecatly what I mean.
It is a special case by a special matter. The
variable zahl must stay be within the string.
like
write:/ 'HALLO zahl'.
and not
write:/ 'HALLO', zahl.
This variable can't stay outboard of the string. This the problem
Reagrds
sas
‎2007 May 11 1:16 PM
‎2007 May 11 1:16 PM
Do this:
DATA zahl TYPE I.
DO 10 TIMES.
zahl = zahl + 1.
write:/ 'HALLO ' zahl.
ENDDO.
‎2007 May 11 1:16 PM
HI!
Try this:
DATA zahl TYPE I.
DO 10 TIMES.
zahl = zahl + 1.
write:/ 'HALLO', zahl.
ENDDO.
Regards
Tamá
‎2007 May 11 1:17 PM
try this
DATA zahl TYPE I.
DO 10 TIMES.
zahl = zahl + 1.
write:/ 'HALLO', <b>zahl</b>.
ENDDO.
‎2007 May 11 1:17 PM
Chnage the code like this:
DATA ZAHL TYPE I.
DO 10 TIMES.
ZAHL = ZAHL + 1.
WRITE:/ 'HALLO ' ,ZAHL.
ENDDO.
Regards,
Vasanth
‎2007 May 11 1:17 PM
hi,
check this in bold
DATA zahl TYPE I.
DO 10 TIMES.
zahl = zahl + 1.
write:/ 'HALLO :' <b>, zahl.</b>
ENDDO.
reward if useful
regards,
nazeer
‎2007 May 11 1:19 PM
Hi erdem,
This will work fine.
DATA zahl TYPE I.
DO 10 TIMES.
zahl = zahl + 1.
write:/ 'HALLO', zahl.
ENDDO.
Reward points.
Younus
‎2007 May 11 1:20 PM
thanks but it is not ecatly what I mean.
It is a special case by a special matter. The
variable zahl must stay be within the string.
like
write:/ 'HALLO zahl'.
and not
write:/ 'HALLO', zahl.
This variable can't stay outboard of the string. This the problem
Reagrds
sas
‎2007 May 11 1:25 PM
hi
any thing writen within ' ' is printed as given ..only....
‎2007 May 11 1:26 PM
Hello,
Change the code like this.
DATA ZAHL TYPE I.
DATA: LV_ZAHL(8),
CHAR(255).
DO 10 TIMES.
ZAHL = ZAHL + 1.
WRITE: ZAHL TO LV_ZAHL.
CONCATENATE 'HALLO' LV_ZAHL INTO CHAR.
CONDENSE CHAR NO-GAPS.
WRITE:/ CHAR."'HALLO'NO-GAP,ZAHL NO-GAP.
ENDDO.
Regards,
Vasanth
‎2007 May 11 1:27 PM
Erdem,
Concatenate 'HALLO' and zahl value into another variable and write that.
Would that help?
Johnson
‎2007 May 11 1:24 PM
try this
data:
zahl(3),
w_test(10).
DO 10 TIMES.
zahl = zahl + 1.
<b>CONDENSE</b> zahl NO-GAPS.
concatenate 'HALLO' zahl INTO w_test.
write:/ w_test.
ENDDO.
Message was edited by:
Rajesh
‎2008 Feb 15 4:35 PM
I have faced the same problem . this works
CONSTANTS str_con type string value 'Hello'.
data: index(2) type n value 0,
str type string.
DO 20 TIMES.
index = index + 1.
CONCATENATE str_con index into str.
write:/ str.
ENDDO.
hope this helps you .
regards
teenshark