2008 Sep 25 8:05 PM
Hi experts ... my problem is this:
Input: L'Belstar
Output: L Belstar
How I can replace this char?? ... thanks for your help and sry for my bad english =P
2008 Sep 25 8:09 PM
Hello,
DATA:
lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.
REPLACE ALL OCCURRENCES OF '''' IN lv_test WITH space.
OR
DATA:
lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.
TRANSLATE lv_test USING ''' '.
Regards.
Hi experts ... my problem is this:
Input: L'Belstar
Output: L Belstar
How I can replace this char?? ... thanks for your help and sry for my bad english =P
2008 Sep 25 8:09 PM
Hello,
DATA:
lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.
REPLACE ALL OCCURRENCES OF '''' IN lv_test WITH space.
OR
DATA:
lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.
TRANSLATE lv_test USING ''' '.
Regards.
2008 Sep 25 8:21 PM
Hi David for your help but i before tried this, when I put this code, the program trigger this error:
"Literals that take up more than one line not permitted"
I need more help ='(
2008 Sep 25 8:23 PM
i guess that will be a warning check the color it should be yellow , go ahead activate
2008 Sep 25 8:27 PM
Hello,
You need one quote to open the literal, two to represent the quote character and one more to close the literal:
DATA:
lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.
REPLACE ALL OCCURRENCES OF '''' IN lv_test WITH ' ' IN CHARACTER MODE.
or
DATA:
lv_test TYPE c LENGTH 10 VALUE 'L''BELSTAR'.
TRANSLATE LV_TEST USING ''' '.
Regards.
2008 Sep 25 8:36 PM
Thanks my problem is working with TRANSLATE sentence ... thanks 😃
2008 Sep 25 8:39 PM
Hello,
You need to convert the variable to be translated to a type c (just create a variable with type c and the move the contents to this one) and then use one of the commands.
Remember that the length of the c variable must be sufficient to take all characters from the variable to be changed.
Regards.
2008 Sep 25 8:15 PM
Hi,
Try this code:
data: l_text type string.
data: l_char type c value `'`.
l_text = `L'Belstar`.
replace ALL OCCURRENCES OF l_char
IN l_text WITH ' ' IN CHARACTER MODE.
write: l_text.
Regards,
Joy.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |