08-31-2007 6:03 AM
hi all,
I uplodaed a text file which is tab delimeted, to the application server using transaction code cg3z directly. now that file is stored with # in place of tab(space) in application server.
my broblem is that when i am reading that file using READ DATASET its comming with that # symbol also.
how i split that dataset .
or if there is any other solution ,like openning file into another mode,
help me.
thank uou
08-31-2007 6:06 AM
Hi Pawan,
The # symbols is a horizontal tab, You use <b>CL_CHAR_ABAP_UTILITIES=>HORIZONTAL_TAB</b> instead of # symbol to split the dataset.
Thanks,
Vinay
08-31-2007 6:11 AM
Hi Pawan..
you can access the Tab character using CL_CHAR_ABAP_UTILITIES=>HORIZONTAL_TAB
Do like this After READ DATASET.
DATA : V_RECORD(100).
DO.
READ DATASET P_FILE INTO V_RECORD.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
SPLIT V_RECORD INTO FIELD1 FIELD2 SEPARATED BY <b>CL_CHAR_ABAP_UTILITIES=>HORIZONTAL_TAB.</b>
<<<<further operations here>>>>
ENDDO.
reward if Helpful.
<b></b>
08-31-2007 6:16 AM
u need to use opendataset in binary mode with encoding default..............
Using the LEGACY TEXT MODE ensures that the data is stored and read in the old non-Unicode format. In this mode, it is also possible to read or write non-character-type structures. However, be aware that data loss and conversion errors can occur in Unicode systems if there are characters in the structure that cannot be represented in the non-Unicode codepage.
reward points if helpful.............
Message was edited by:
raam
08-31-2007 6:29 AM
Hello Pawan Kumar,
I also got same problem. it Just simple. Open data set in binary mode. This problem is due to new line which is reflected with # symbol.
Reward If Helpful.
Regards
--
Sasidhar Reddy Matli.