‎2009 Apr 02 2:11 PM
Guys,
Data: var type i,
chhar(10) type c.
do 3 times.
add 1 to var.
chhar = 'CHARACTER( var )'.
WRITE: / chhar.
enddo.
I want the output as
CHARACTER1
CHARACTER2
CHARACTER3.
but im unable to do it. Could anyone please help me out. I donot want to use concatenate.
Thanks,
Santosh.
‎2009 Apr 02 2:28 PM
Hi,
Data: var type c,
chhar(9) type c,
char(9) type c value 'character'.
do 3 times.
add 1 to var.
chhar = char.
WRITE : chhar .
write : 10 var.
skip .
enddo.Please check if it does meet your requirement.Otherwise please feel to reply in wt condition u want that required output.
‎2009 Apr 02 2:29 PM
DATA: var TYPE i,
chhar(10) TYPE c.
DO 3 TIMES.
chhar = sy-index .
CONDENSE chhar .
CONCATENATE 'CHARACTER' chhar into chhar .
WRITE: / chhar.
ENDDO.
‎2009 Apr 02 2:32 PM
Data: var(1) type N,
ch type C,
chhar(10) type c.
do 3 times.
add 1 to var.
ch = var.
concatenate 'CHARACTER' ch into chhar.
WRITE: / chhar.
enddo.
Regards
Sandip
‎2009 Apr 02 2:46 PM
try this way:
DATA: var TYPE i,
chhar(10) TYPE c.
DO 3 TIMES.
ADD 1 TO var.
chhar+0(9) = 'CHARACTER'.
chhar+9(1) = var.
WRITE: / chhar.
ENDDO.
‎2009 Apr 02 3:26 PM
No Guys,
I said No Concatenate. How do we assign it dynamically.
Thanks,
Santosh.
‎2009 Apr 02 4:03 PM
>
> I said No Concatenate. How do we assign it dynamically.
>
my reply has no concatenate..
‎2009 Apr 02 4:20 PM
Thank you so much Jay for ur answer but i am looking for something like this
chhar = 'CHARACTER( var )'. but not offsets or concatenation.
Thanks,
Santosh.
‎2009 Apr 02 4:24 PM
Maybe you could use REPLACE, if you know the var name, do you know?
Regards
‎2009 Apr 02 4:30 PM
>
> but not offsets or concatenation.
>
Hi, you are like the business team, don't say all at once.... Kidding I doubt if its possible without offset or concatenate...
‎2009 Apr 03 8:09 AM
Hi,
Did u try the code written by me.Just to know whether u had a look at it !
‎2009 Apr 02 4:12 PM
Could you explain the actual problem.. or is that a interview question?
‎2009 Apr 03 8:15 AM
Try
Data: var type i.
var = 0.
Do 3 times.
add 1 to var.
WRITE: /'CHARACTER ', var .
Enddo.