Hi,
In my program I have to create a file in Text mode using OPEN DATASET statement. This file is being sent to a third party system for their processing. I came to know while creating the file using OPEN DATASET, one LF character is inserted end of the file resulting a blank line end of the file. Thus if my internal table contains 5 reocrds, in the created text file I can see 6 lines where last is a blank. My question is how to remove this blank line which is causing issue in the thirdparty system.
Here is the Code I have used.
TRY.
Write the file in Text Mode
OPEN DATASET lv_outpf FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE
WITH SMART LINEFEED
MESSAGE lv_msg.
*
IF lv_msg IS NOT INITIAL.
WRITE / lv_msg.
EXIT.
ENDIF.
LOOP AT itab_new INTO st.
TRANSFER st TO lv_outpf.
ENDLOOP.
CLOSE DATASET lv_outpf.
CATCH cx_root. "#EC No Handler
ENDTRY.