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: 

Excel file entries more than 255 chars

Former Member
0 Kudos

Hi Iam facing one issue while uploading excel file. In my excel file some of column enteris are more than 255 chars. After uploading excel file into internal table , the excel file entries if it more than 255 chars, then it  truncated to 252 chars. iam not getting exact entries( more than 255 chars) as per excel file. I tried all FM's related to Upload or excel upload related things. But no use. Could you please suugest me how to handle this problem? Regards Karthik

10 REPLIES 10

Former Member
0 Kudos

I tried all FM's related to Upload or excel upload related things.

There are so many FMs. How is it possible that you tried every available option?

When you say excel file, it could be having 2007, 2003, csv, tsv format. You need to post example input file, and the code that is not working as per expectation. That will result in faster resolution.

former_member212705
Active Participant
0 Kudos

Which FM you are using for uploading . I used GUI_UPLOAD and its working fine. i uploaded file with column length 255.

   TYPES: BEGIN OF demo,
        data  TYPE c LENGTH 315,
       END OF demo.

   DATA: gi_demo TYPE STANDARD TABLE OF demo,
      gw_demo TYPE demo.

    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = lv_file
      filetype                = 'ASC'
      has_field_separator     = ','
    TABLES
      data_tab                = gi_demo
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      OTHERS                  = 17.
  IF sy-subrc <> 0.
* Implement suitable error handling here
  ENDIF.

loop at gi_demo INTO gw_demo.
  lv_len  strlen( gw_demo-data ).
  write lv_len.
  ENDLOOP.

o/p - 255.

former_member184569
Active Contributor
0 Kudos

You can use GUI_UPLOAD FM to upload a file with length greater than 255. Just make sure that it is a tab delimited file to upload as an excel file.

raymond_giuseppi
Active Contributor
0 Kudos

Did you try some OLE2 methods, if yes which ones, and can you provide list of FM you try with no results ?

Regards,

Raymond

Former Member
0 Kudos

I tried the following FM's... GUI_UPLOAD, TEXT_CONVERT_XLS_TO_SAP, C13Z_UPLOAD_DIALOG, C13Z_UPLOAD, ALSM_EXCEL_TO_INTERNAL_TABLE, SX_TABLE_LINE_WIDTH_CHANGE etc.. to try and increase the field char length but got no fruitful results with different file formats .XLS(2003 and also 2007) , .CSV , .TXT  All responses which can resolve the issue are appreciated.

former_member212705
Active Participant
0 Kudos

hey karthik,

i used gui upload and it is working fine.the code i sent u, i uploaded csv file with 255 character.

Former Member
0 Kudos

Hi Ashish, it is EXCEL file, not CSV file. i tired all FM' no use. Regards Karthik

0 Kudos

Can you post the input file and a non-working code as attachment?

It would get better replies.

0 Kudos

Hi Karthik,

I just did.

I uploded excel file with 415 character.

0 Kudos

Post your excel file and code if possible. i will try to check.  As in my code .XLS is uploaded without any issues.