Application Development and Automation 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: 
Read only

# symbol in application server file

Former Member
0 Likes
1,712

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
Read only

Former Member
0 Likes
1,569

Hi,

In which mode are you opening the file..

Regards,

Tanveer.

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

11 REPLIES 11
Read only

vinod_gunaware2
Active Contributor
0 Likes
1,569

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

Read only

0 Likes
1,569

hi,

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

Regards,

Santosh

Read only

0 Likes
1,569

Hi Vinod,

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

Any other solution about this.

Regards,

Tarun

Read only

Former Member
0 Likes
1,570

Hi,

In which mode are you opening the file..

Regards,

Tanveer.

Read only

0 Likes
1,569

hi Tharun,

Check this out

Regards,

Santosh

Read only

0 Likes
1,569

Hi Tanveer,

I am opening the file in this mode:

OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

Regards,

Tarun

Read only

0 Likes
1,569

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

Read only

0 Likes
1,569

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

Read only

0 Likes
1,569

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

Read only

0 Likes
1,569

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

Read only

Former Member
0 Likes
1,569

Dear TRun,

Try using the Function Module 'KCD_CSV_FILE_TO_INTERN_CONVERT'.

CYA,

YJR.