Application Development 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: 

Carriage Return problem in Long Text

Former Member
0 Kudos

Hi

I am tyring to download Long text for Interactions (CBIH82) transaction. I am using read_text function module. The read text works fine as far as reading text but the internal table for TDLINE contains two hashes (##) in everyline which is actually a carriage return character (hex value 0A0D). Now when i pass this line to GUI_DOWNLOAD it splits the text at the hashes and wirtes it in a new line for the .txt file.

We tried most of the string operations but it fails to read the ## as it is not actually two hashes but character representation of Carriage return. Is there any function module avaliable to get it converted to a character format.

6 REPLIES 6

Former Member
0 Kudos

Hi shashank,

1. u can use the concept of (carriage + line feed)

CL_ABAP_CHAR_UTILITIES=>CR_LF

for replacing the character/splitting etc.

2. eg.

REPORT ABC.

data : m(10) type c.

m = CL_ABAP_CHAR_UTILITIES=>CR_LF.

regards,

amit m.

Former Member
0 Kudos

Hi,

Please try with the FM 'STPU1_HEX_TO_CHAR'.

TTR

Former Member
0 Kudos

Hi Shashank,

You could do this -

Run a search for the character cl_gui_char_utilities=>cr_lf and remove it. ( Know its too simple, but worth a try )

Regards,

Aniket

0 Kudos

Yes but the system we have does not have the class cl_gui_char_utilities. anyways solved it using the split and the hexadecimal representation of the Carriage return line feed.

0 Kudos

Can you please let me know who you managed to do this ? i am facing the exact problem.

Thanks!

0 Kudos

If you dont have access to the class CL_ABAP_CHAR_UTILITIES, do this instead:


DATA: crlf(2)   TYPE x VALUE '0D0A',
      itab      TYPE TABLE OF string,
      w_input   TYPE string.

   w_input = '<contains the text with the line feed.>'.

   SPLIT w_input AT crlf INTO TABLE itab.

Regards Michael.