Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

# problem while reading dataset from application server.

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

varma_narayana
Active Contributor
0 Kudos

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>

Former Member
0 Kudos

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

Former Member
0 Kudos

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.