‎2009 Mar 03 7:49 AM
Hi together,
I think I've got a quite easy problem, but no idea how to solve it.
I've got a string for example ' Hello' the spaces are protected ones, represented
in hex as 'A0'.
Using condense to delete the leading spaces has no effect on my string?
Has anyone a hint how to solve this?
King regards
Lars
‎2009 Mar 03 8:20 AM
Try as below
Data : v_space type c value CL_ABAP_CHAR_UTILITIES=>Horizontal_tab.
REPLACE ALL OCCURRENCES OF v_space in v_string with ' '.
condense v_string NO-GAPS.hope this helps...
‎2009 Mar 03 7:55 AM
Hi,
Try it with string operations.
for example:
w_str = 'Hello '.
w_len = strlen( w_str ).
subtract 2 from w_len.
w_str2 = w_str+0(w_len).Regards,
Manoj Kumar P
‎2009 Mar 03 8:20 AM
Try as below
Data : v_space type c value CL_ABAP_CHAR_UTILITIES=>Horizontal_tab.
REPLACE ALL OCCURRENCES OF v_space in v_string with ' '.
condense v_string NO-GAPS.hope this helps...
‎2009 Mar 03 9:37 AM
Thanks your both of your ideas,
but CL_ABAP_CHAR_UTILITIES=>Horizontal_tab.
is represented in hex as '09'.
Kind regards
‎2009 Mar 04 8:36 AM
Hi together,
I've found a working solution, maybe it's interessting for u.
Data: lv_rep(1) TYPE c.
Data: lv_replace type string.
lv_replace = ' Test'.
CALL METHOD cl_abap_conv_in_ce=>uccp
EXPORTING
uccp = '00A0'
RECEIVING
char = lv_rep.
REPLACE ALL OCCURRENCES OF lv_rep IN lv_replace WITH ' '.
This works.
Kind regards.
Lars