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: 

# symbol in application server file

Former Member
0 Kudos

Hi Everyone,

I am picking one text file from application server in my program.The format is:

The format of the file is

ITM^^95010620T9S7^^

CONSYMU600408140GE785799475247.00

CTN100069350408001759498163450030443202400027810

While saving the text file in application server,SAP automatically inserts the character # at the end of each line and the file gets stored in this format in application server.

ITM^^95010620T9S7^^#

CONSYMU600408140GE785799475247.00#

CTN100069350408001759498163450030443202400027810#

What does this symbol # represents?

When i read the data in my internal table, the symbol # gets appended at the end of the field.

I am not able to separate the symbol # from value 27810.

I tried with this option also(carriage return)

CONSTANTS: con_cr type x value '0D'.

But not able to split my last field from symbol #.

Any idea how to get rid of symbol #.

Thanks in advance.

Regards,

Tarun

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In which mode are you opening the file..

Regards,

Tanveer.

11 REPLIES 11

vinod_gunaware2
Active Contributor
0 Kudos

use split command

SPLIT T_FLAT AT <b>CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB</b>

<b>CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB</b> this represent #

regards

vinod

0 Kudos

hi,

This question was asked many times in the forum so please search for the same

Regards,

Santosh

0 Kudos

Hi Vinod,

I tried with the method provided by you but this is not working.

Any other solution about this.

Regards,

Tarun

Former Member
0 Kudos

Hi,

In which mode are you opening the file..

Regards,

Tanveer.

0 Kudos

hi Tharun,

Check this out

Regards,

Santosh

0 Kudos

Hi Tanveer,

I am opening the file in this mode:

OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

Regards,

Tarun

0 Kudos

Hi,

In my case, the symbol # automatically gets appended at the end of each line while writing data in the application server.

Any idea how to avoid this symbol #.

Regards,

Tarun

0 Kudos

Hi,

in your case the '#' is coming at the end , that is indicating the newline.

ITM^^95010620T9S7^^#

CONSYMU600408140GE785799475247.00#

CTN100069350408001759498163450030443202400027810#

if you want to avoid that you need to use

replace all occurences of CL_ABAP_CHAR_UTILITIES=>NEWLINE in record with ''.

you should do it inside do loop. since for each record you need to do it.

Regards

vijay

0 Kudos

Hi Vijay,

I tried now with replace option but could not succeed.

REPLACE '#' IN wa_data-height WITH ' '.

wa_data-height still contains the value 27810#

Regards,

Tarun

0 Kudos

Hi Tarun,

Use this code.

data: l_sep1 TYPE c,

l_sep = cl_abap_char_utilities=>cr_lf.

REPLACE ALL OCCURRENCES OF l_sep IN l_wa_data-data WITH space.

Thanks

Swagatika

Former Member
0 Kudos

Dear TRun,

Try using the Function Module 'KCD_CSV_FILE_TO_INTERN_CONVERT'.

CYA,

YJR.