05-20-2009 9:57 AM
Hello Abappers,
I'm facing the following problem, i need to delete the carraiage return code CR from the extracted file. I've done some research for that and found some topics talking about using 'cl_abap_char_utilities=>CR_LF', but unfortunitly we have SAP 4.6C wich doesn't have this class. Is there any way to delete these CRs ?
Thank you in advance.
Best Regards.
05-20-2009 10:17 AM
05-20-2009 10:20 AM
Hi,
See below sample code for deleting the carriage return code. Hope it give u some idea.
CONSTANTS: c_cr TYPE x VALUE '0D'. " Carriage Return
Check for Carriage Return in longText
DO.
SEARCH i_lines-tdline FOR c_cr.
IF sy-subrc = 0.
REPLACE c_cr WITH space INTO i_lines-tdline.
ELSE.
EXIT.
ENDIF.
ENDDO.
05-20-2009 10:22 AM
Hello,
The HEX value of CRLF is '0D0A'.
DATA: V_CRLF TYPE X VALUE '0D0A'.
You can try using this.
BR,
Suhas
PS: Have a look in SDN may be you can find some solutions.
05-20-2009 10:23 AM
Hi Fayssal,
Declare an hexadecimal variable which holds value '0D0A' and use REPLACE to delete carriage returns.
DATA: V_CR(2) type X value '0D0A'.
replace all occurrences of V_CR in str with space.
Thanks,
Vinay
05-20-2009 10:24 AM
Hi,
Attribute 'cl_abap_char_utilities=>CR_LF' is just a constant and its value is '0D' in hexa. So you can use '0D' (type X) instead.
To delete the CRs in your text you have to you must process your text in hexa mode and clear the '0D' in each line.
Hope this will help you,
Issa
05-20-2009 3:22 PM