Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8989

Using OPEN DATASET...WINDOWS LINEFEED can't open file on server

$
0
0

Hello Experts,

 

I've been given a requirement of adding linefeed (CL-LF) at the end of each line. I've written the following code but when I go to AL11 and try to view file then I can’t open it. Am I making any mistake? Can somebody please rectify my issue? For reference here is my code.

 

(I was hoping to follow this example “http://scn.sap.com/community/abap/blog/2012/05/15/how-to-add-spaces-at-the-end-of-the-file” but apparently it doesn’t work)

 

Data: p_etc_path(75)   TYPE c.

"Default path

p_etc_path = '/pt/PTdata//interface_2150/archive/ETC.txt'.

  OPEN DATASET lv_flp FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT WITH WINDOWS LINEFEED.

     IF sy-subrc eq 0.

    CLEAR lwa_line.
LOOP AT pgt_emp INTO lwa_emp.
CONCATENATE lwa_emp-pernr   ','
lwa_emp
-vorna   ','
lwa_emp
-nachn   ','
lwa_emp
-group   ','
lwa_emp
-hpten   ','
lwa_emp
-hptfr
INTO lv_line.
TRANSFER lv_line to lv_flp. "length 1190
ENDLOOP.

     ENDIF.

* Close file
CLOSE DATASET lv_flp.

 

I also tried with SMART LINEFEED but nothing gets added at the end of every line.

  OPEN DATASET lv_flp FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT WITH SMART LINEFEED.


Many thanks in advance.


Viewing all articles
Browse latest Browse all 8989

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>