‎2010 Apr 26 2:23 PM
Hi Experts!!
I have next code:
CLEAR l_leng.
l_leng = STRLEN( l_descripcion ).
l_leng = l_leng - 1.
DO l_leng TIMES.
REPLACE ' ' WITH '_' INTO l_descripcion.
IF sy-subrc NE 0.
EXIT.
ENDIF.
ENDDO.
I want change blank space for '_', but I don't Know.
Example: l_descripcion = 'DES CRIP CION'. --> DES_CRIP_CION___________
I tried with REPLACE ALL OCURRENCE , but when I use condition ' ', dump ocurred.
How Can I do it?
Thaks.
‎2010 Apr 26 2:43 PM
data:lv_char type char20.
data:lv_len type i.
lv_char = 'DE SC RI PT ION'.
lv_len = strlen( lv_char ).
replace all occurrences of ` ` in lv_char(lv_len) with '_' .
write lv_char.
or
data:lv_char type char20.
lv_char = 'DE SC RI PT ION'.
replace all occurrences of ` ` in lv_char with '_' .
write lv_char.
Edited by: Keshav.T on Apr 26, 2010 7:18 PM
‎2010 Apr 26 2:43 PM
data:lv_char type char20.
data:lv_len type i.
lv_char = 'DE SC RI PT ION'.
lv_len = strlen( lv_char ).
replace all occurrences of ` ` in lv_char(lv_len) with '_' .
write lv_char.
or
data:lv_char type char20.
lv_char = 'DE SC RI PT ION'.
replace all occurrences of ` ` in lv_char with '_' .
write lv_char.
Edited by: Keshav.T on Apr 26, 2010 7:18 PM