10-21-2008 9:38 AM
Hello friends,
I am downloading one tab delimited .txt file from internal table using OPEN dataset , READ dataset.
But output looks like...
4500603096 20081008[]4500603095 20081003[]4500603087 20080924[]4500603083 20080910[]4500603084 20080910[]
and I want output as follows in .TXT file
4500603096 20081008
4500603095 20081003
4500603087 20080924
4500603083 20080910
4500603084 20080910
While same file i open with excel it works correctly.
Why this is happening?
My code is below...
OPEN DATASET l_file FOR OUTPUT IN TEXT MODE.
IF sy-subrc = 0.
LOOP AT i_po_extarct INTO lw_po_extract.
CONCATENATE lw_po_extract-ebeln
lw_po_extract-aedat
INTO l_string
SEPARATED BY wc_tab.
* Get the logs to the file.
TRANSFER l_string TO l_file.
ENDLOOP.
* Close the dataset
CLOSE DATASET l_file.
ELSE.
MESSAGE e303(me) WITH 'File not found'.
ENDIF.
note : l_string and l_file are type STRING.
Edited by: Ronny Hanks on Oct 21, 2008 10:39 AM
Edited by: Ronny Hanks on Oct 21, 2008 10:40 AM
10-21-2008 9:41 AM
10-21-2008 9:42 AM
OPEN DATASET a_plant FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET a_plant INTO w_string.
IF sy-subrc <> 0.
EXIT.
ENDIF.
SPLIT w_string AT cl_abap_char_utilities=>horizontal_tab
INTO w_txt1-werks w_txt1-name1 w_txt1-country .
MOVE w_txt1 TO it_plant.
APPEND it_plant.
CLEAR w_txt1.
CLEAR w_string.
ENDDO.
CLOSE DATASET a_plant.
hope it will useful to you
12-02-2008 1:52 PM