‎2008 Jun 24 5:32 AM
how to add extra space for a variable which is having already data in it dynamically...
for ex: if var1 contains 'asfsd' now at runtime i want to increase to increase the length so that some extra space is added at the end with the specified length
for length = 10
my result should b1 var1 = 'asfsd '
so at the last five space is added.
how to achieve this...
‎2008 Jun 24 5:41 AM
Hi,
data : str(10) type c,
str(11) type c.
str = 'hello'.
concatenate str ' ' into str1.
‎2008 Jun 24 5:47 AM
Hi Kiran,
U can try using the Shift command
DATA: A1(10) TYPE C VALUE 'ABCDEFGHIJ',
A2 TYPE STRING,
FIVE TYPE I VALUE 5.
A2 = A1.
SHIFT ALPHA1 BY FIVE PLACES.
SHIFT ALPHA2 RIGHT BY 2 PLACES
Now A1 now has the contents 'FGHIJ '
and A2 will have contents ' ABCDEFGHIJ'.
regrads,
Kalyan..
‎2008 Jun 24 6:24 AM
hi
u can try this.
len = strlen( var1 ).
while len le 10.
concatenate var1 ' ' into var1.
add 1 to len.
endwhile.this will help u in adding any no of spaces at runtime.
Regards
Sumit Agarwal
‎2008 Jun 24 6:49 AM
hi Kiran,
do like this.
len = strlen( var1 ).
rem_len = 10 - len.
Do rem_len times.
concatenate var1 SPACE into var1.
rem_len = rem_len = 1.
enddo.
Reward points if useful
Chandra
‎2008 Jun 24 7:34 AM
Hi
concatenation or shift does not give correct result.....
my requirement:::
var1 = 'abcd'.
var2 = 'efgh'.
write var1 var2.... o/p: abcdefgh
now at runtime i want to increase the length of var1 to 8 so that it has to consider the remaining 4 characters as spaces and now this space need to be concatenated and displayed along with data...(normally any extra space wont get displayed- but here i need display of this extra space)
so finally o/p should :::: abcd efgh not abcdefgh
‎2008 Jun 24 7:45 AM
Hi Kiran,
Concatenate the 2 variables in 3 variable of type string using space.
Eg)
Var1 = 'abc'
Var2 = 'def'
Var3 Type String.
Concatenate Var1 Var2 int oVar3 seperated by Sapce.
Write : Var3.
Your o/p will be: abc def.
Reward points if helpful.
Thanks & Regards
Jitendra