2007 Aug 07 3:02 PM
Hi,
consider this example:
Data: l_var1(5), l_var2(5), l_var3(20).
l_var1 = 'abcde'. l_var2 = '12345'.
CONCATENATE l_var1 l_var2 INTO l_var3 separated by SPACE.
As a result: l_var3 = 'abcdef12345'.
The above is the actual result result.
The desired result is:: l_var3 = 'abcdef12345 ' (10 blank spaces )
How do we go about it?
Hi,
consider this example:
Data: l_var1(5), l_var2(5), l_var3(20).
l_var1 = 'abcde'. l_var2 = '12345'.
CONCATENATE l_var1 l_var2 INTO l_var3 separated by SPACE.
As a result: l_var3 = 'abcdef12345'.
The above is the actual result result.
The desired result is:: l_var3 = 'abcdef12345 ' (10 blank spaces )
How do we go about it?
2007 Aug 07 3:05 PM
Data: l_var1(5), l_var2(5), l_var3(20).
l_var1 = 'abcde'. l_var2 = '12345'.
CONCATENATE l_var1 '##########' l_var2 INTO l_var3.
REPLACE l_var3 with '# '.
Regards.
2007 Aug 07 3:06 PM
Hi,
we can not get the blank spaces in the Charecter type fields, if you want the put a DOT (.) at the last charecter
Regards
Sudheer
2007 Aug 07 3:07 PM
You can do something like this,
data : l_space type char1 value ' '.
" < Type it with num lock on holding the ALT key and 0160 from num pad, by that you will get space ASCII or copy paste the value from character map to the value addition in your constants declaration>
Data: l_var1(5), l_var2(5), l_var3(20).
l_var1 = 'abcde'. l_var2 = '12345'.
CONCATENATE l_var1 l_var2 INTO l_var3 separated by SPACE.
l_var3+10(10) = l_space.
This will put the blanks in the end.
~Ranganath
2007 Aug 07 3:07 PM
for what purpose do u want the spaces... normally ABAP shows without spaces...
if u want spaces and if there is one more field u can concatenate and u will find the spaces. But if this is the last field then the only solution is u need to concatenate with a extra symbol which is of no use as such but it will retain the spaces...
2007 Aug 07 3:16 PM
l_len = strlen(l_var3).
do.
l_initial = 1.
if l_var3+l_initial(1) CA sy-abcde.
concatenate l_var3 ` ` into l_var3.
endif.
if l_var3+l_initial(1) eq '/*'.
exit.
endif.
enddo.
Add the above piece of code to your prog...
Regards,
Pavan.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |