2007 Jan 25 11:28 AM
hai all,
in my internal table i have only one field of type string.
which has 'this is -
test file ' . "----
" is space.
so i am looping the internal table which i am getting
this
is
--- " it represent space
--
test
file
now i have to concatenate the contents of internal table in to string
the output should be like " THIS IS TEST FILE".
PLEASE GIVE ME SUGGESTION .
BYE
LAXMI
hai all,
in my internal table i have only one field of type string.
which has 'this is -
test file ' . "----
" is space.
so i am looping the internal table which i am getting
this
is
--- " it represent space
--
test
file
now i have to concatenate the contents of internal table in to string
the output should be like " THIS IS TEST FILE".
PLEASE GIVE ME SUGGESTION .
BYE
LAXMI
2007 Jan 25 11:33 AM
Hi There
Do try "RESPECTING BLANKS" at the end of concatenate.
Hope it helps
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.
2007 Jan 25 11:33 AM
2007 Jan 25 11:33 AM
Hi Laxmi ,
All you need to do is
Data : final type string.
LOOP AT IT_1.
concatenate final it_1-text to final separated BY space.
ENDLOOP.
This must solve the issue , if it does not the use CONDENSE FINAL.
Regards
Arun
*Assign points if reply is helpful
2007 Jan 25 11:34 AM
data : v_string type string.
delete table itab where str eq space. " str is the field of ur itab
loop at itab.
concatenate v_string itab-str into v_string.
endloop.
write : v_string.
2007 Jan 25 11:38 AM
Hi laxmi,
check this code
data :name(5) value 'this',
name1(2) value 'is',
name3(3) value ' ',
name4(10) value 'test file',
name5 type string.
concatenate name name1 name4 into name5 separated by ' '.
write : name5.
try this
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |