‎2008 Jun 16 2:15 PM
I've problem with space into a string.
I have this string.
000006602002-09724600002009____215618_ 10.000,00_ 0,00_ 0,00
After this istruction...
REPLACE ALL occurrences of '_' in string_lv with ' '.
The value is the followings
000006602002-09724600002009215618 10.000,00 0,00 0,00
I'have to tabulate the fields into a file, but doesn't respect the heading space, if I write concatenate f1 f2 into f3 respecting space, there is an check error.
How I can do?
Edited by: Antonio Sanseverino on Jun 16, 2008 3:22 PM
‎2008 Jun 16 3:04 PM
hi send the string into the char string field like
data: test(200) type c .
and use the offset values while populating into the table like this..
itab-field1 = test+0(20) .
‎2008 Jun 16 2:27 PM
Hello,
Try using the TRANSLATE command.
Converts the characters "A" to "B", "a" to "b", and vice versa. text contains "Abracadabra" after the conversion.
DATA text TYPE string.
text = `Barbcbdbarb`.
TRANSLATE text USING 'ABBAabba'.
Regards.
‎2008 Jun 16 2:30 PM
Hi Antonio,
use concatenate statement
*Concatenate <f1> <f2> into <result> RESPECTING BLANKS.
Example
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.
Reward if found helpful.
Regards,
Boobalan Suburaj
‎2008 Jun 16 2:39 PM
‎2008 Jun 16 2:30 PM
Hi,
Instead of giving '' write space . Your problem will be solved.
Regards,
Anomitro Guha
‎2008 Jun 16 3:04 PM
hi send the string into the char string field like
data: test(200) type c .
and use the offset values while populating into the table like this..
itab-field1 = test+0(20) .
‎2008 Jun 16 3:27 PM
Yes!!
But why I can't use Concatenate... respecting blanks?
And why I can't fill headings blanks into string?
It's the first time i see this!
Bah Thanks a lot You have had a good idea
‎2008 Jun 16 3:25 PM
Hello Antonio,
Check if this suits your requirement:
DATA lv_data TYPE string VALUE '000006602002-09724600002009____215618_ 10.000,00_ 0,00_ 0,00'.
DATA lv_table TYPE TABLE OF string.
SPLIT lv_data AT '_' INTO TABLE lv_table.
CONCATENATE LINES OF lv_table INTO lv_data SEPARATED BY SPACE.
WRITE lv_data.
Kind regards.
‎2008 Jun 16 3:33 PM
"CONCATENATE LINES OF"
"CONCATENATE F1 F2 INTO F3 RESPECTING BLANKS"
I' have an error
Maybe my biggest problem is the system...
With offset it's ok!!!