Skip to Content
avatar image
Former Member

Read Dataset Issue - #

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 16, 2008 at 08:19 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Oct 16, 2008 at 08:08 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 08:11 AM

    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

    Add comment
    10|10000 characters needed characters exceeded