Skip to Content
-2
May 03, 2018 at 03:49 AM

How to set CR (Carriage Return) at end of line in ABAP?

7234 Views

Hi experts,

We are creating a flat file on the application server using 'open dataset'.

I need to place a CR at the end of each line.

I tried the below syntax, but it doesn't give a CR at end of line.

OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CONCATENATE l_data cl_abap_char_utilities=>cr_lf(1) INTO l_data.
TRANSFER l_data  TO p_file.

Please suggest how to set CR (Carriage Return)?

Thanks for your help in advance.

Lucy