Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Replace Function

former_member611006
Active Participant
0 Likes
506

Hi all !!

How do i remove hex 0d0a characters (carrier return+line feed)from a string ?

I want to replace it with a space (hex 32).

I've tried :

DATA crlf(2) TYPE x VALUE '0D0A'.

DATA sp(1) TYPE x VALUE '32'.

REPLACE ALL OCCURRENCES OF crlf IN wa-aetxt WITH sp IN BYTE MODE.

But it doesn't works...

Thanks for support.

Regards,

David

2 REPLIES 2
Read only

Former Member
0 Likes
481

Hi David

Please use the class attribute for that.

You can use,

CL_ABAP_CHAR_UTILITIES->CR_LF which will do both.

Something like

REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES->CR_LF IN wa-aetxt .

Hope this helps !

~ Ranganath

Edited by: Ranganath Ramesh on Jan 9, 2008 10:33 AM

Read only

former_member611006
Active Participant
0 Likes
481

REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN txt WITH '-'.

REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN txt WITH '-'.

REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>newline IN txt WITH '-'.