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: 

Read Dataset Issue - #

Former Member
0 Kudos

Hi,

Im trying to read internal table which has just one field. In the application server, tab is recognised as # and so at the end of every line we have #. Here as we have only one column,so the value is having #.

In application server :

Directory /usr/sap/B01/SYS/global/

Name: plants_of_salesorg_cc1_txt.csv

Plants of Sorg 1#

210#

250#

280#

290#

Generally if there are more number of columns we use SPLIT by which this # issue is not raised. In my requirement as we have only column the value is containg # at the end.

Tried

gc_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab .

REPLACE gc_tab IN wa_upload WITH gc_b.

APPEND wa_upload TO gi_upload.

Here # is not being recognised in wa_upload.

How can this issue be resolved.

Thanks in advance.

Regards,

Dedeepya

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

chances are there for a new line also

data : line TYPE c VALUE cl_abap_char_utilities=>newline .

REPLACE line IN wa_upload WITH gc_b.
APPEND wa_upload TO gi_upload.

if still you are facing then try with cr / lf

try with carrage return.

data: cr TYPE c VALUE cl_abap_char_utilities=>cr_lf .

REPLACE cr  IN wa_upload WITH gc_b.
APPEND wa_upload TO gi_upload.

if it is not working , try with line feed.

data : lf  TYPE c VALUE cl_abap_char_utilities=>cr_lf .
lf = cl_abap_char_utilities=>cr_lf +1(1).
REPLACE lf IN wa_upload WITH gc_b.
APPEND wa_upload TO gi_upload.

4 REPLIES 4

rainer_hbenthal
Active Contributor
0 Kudos

Check in the debugger what # is really is. maybe not a tab but a CR or LF.

Former Member
0 Kudos

Hello,

The # occurs in application server when u upload the file data in the application server if u r file contains space after the field value

Ex: Material number is '050594 ' then it will take space # so first u download all the data from the application server into the flat file and save to u r PC.

And upload all the data after removing space to upload the data to application sever to upload to application server SXDA_TOOLS.

SXDA_TOOLS is the Tcode to upload and download the data from PC to AL11 or AL11 to PC

former_member188685
Active Contributor
0 Kudos

chances are there for a new line also

data : line TYPE c VALUE cl_abap_char_utilities=>newline .

REPLACE line IN wa_upload WITH gc_b.
APPEND wa_upload TO gi_upload.

if still you are facing then try with cr / lf

try with carrage return.

data: cr TYPE c VALUE cl_abap_char_utilities=>cr_lf .

REPLACE cr  IN wa_upload WITH gc_b.
APPEND wa_upload TO gi_upload.

if it is not working , try with line feed.

data : lf  TYPE c VALUE cl_abap_char_utilities=>cr_lf .
lf = cl_abap_char_utilities=>cr_lf +1(1).
REPLACE lf IN wa_upload WITH gc_b.
APPEND wa_upload TO gi_upload.

0 Kudos

Hi,

Issue solved with carrage return.

data: cr TYPE c VALUE cl_abap_char_utilities=>cr_lf .

REPLACE cr IN wa_upload WITH gc_b.

APPEND wa_upload TO gi_upload.

Thanks to everyone and specially Vijay

Dedeepya