11-13-2007 3:37 AM
Hi,
If i have a string variable ' 80 '.I want it as ' 80 ' ie some space appended before it.
I used concatenate ' ' variable into variable..Its not working.How to do it??
Thanks.
11-13-2007 3:43 AM
Hi..
To add spaces before a string use the SHIFT statement.
Eg:
Data : Var(10) type c value 'ABC'.
SHIFT VAR BY 1 PLACES LEFT.
WRITE:/ VAR.
<b>reward if Helpful.</b>
11-13-2007 3:42 AM
11-13-2007 3:43 AM
Hi..
To add spaces before a string use the SHIFT statement.
Eg:
Data : Var(10) type c value 'ABC'.
SHIFT VAR BY 1 PLACES LEFT.
WRITE:/ VAR.
<b>reward if Helpful.</b>
11-13-2007 3:43 AM
check below code
Concatenate ' ' string into string respecting blanks.
<b>
... RESPECTING BLANKS</b>
Effect
The addition RESPECTING BLANKS is only allowed during string processing and causes the closing spaces for data objects dobj1 dobj2 ... or rows in the internal table itab to be taken into account. Without the addon, this is only the case with string.
Note
With addition RESPECTING BLANKS, statement CONCATENATE can be used in order to assign any character strings EX>text - taking into account the closing empty character - to target str of type string: CLEAR str. CONCATENATE str text INTO str RESPECTING BLANKS.
Example
After the first CONCATENATE statement, result contains "When_the_music_is_over", after the second statement it contains "When______the_______music_____is________ over______" . The underscores here represent blank characters.
TYPES text TYPE c LENGTH 10.
DATA itab TYPE TABLE OF text.
DATA result TYPE string.
APPEND 'When' TO itab.
APPEND 'the' TO itab.
APPEND 'music' TO itab.
APPEND 'is' TO itab.
APPEND 'over' TO itab.
CONCATENATE LINES OF itab INTO result SEPARATED BY space.
...
CONCATENATE LINES OF itab INTO result RESPECTING BLANKS.
Rewards if useful.........
Minal