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

Problem with GUI_UPLOAD

Former Member
0 Likes
1,241

Hi Everyone,

I have a file and i want to upload this with GUI_UPLOAD. but some lines of this file has more than 256 characters (eg 320) and lines of the file is not TAB delimited. When i try to upload the file it cuts the line from 256th ch. Can anyone help about this?

Thanks ...

13 REPLIES 13
Read only

former_member386202
Active Contributor
0 Likes
1,204

Hi,

Try this fm CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

i_field_seperator = 'X'

i_tab_raw_data = it_rawdata

i_filename = p_xlfile

TABLES

i_tab_converted_data = <dyn_table>

EXCEPTIONS

conversion_failed = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Regards,

PRashant

Read only

0 Likes
1,204

Hi Prashant;

this FM cant solve the problem i think.

one of the line is :

1;10003000000006;10003[3];10037[10003[3];1];19;01/05/2009 09:08:59;
10003000000004[3307];;0;0;         7;01/05/2009 
09:09:56;0[];2008380000048887;31;2,2001;0;0;0;0;;;10003000000000[10003[3];
10037[10003[3];1];490;01/05/2009 21:50:30];0[];0
[];;;0;01/05/2009 10:59:00;1[];01/05/2009 10:59:00;1[];10003[];10003[];1

this is only one line

Edited by: Matt on Dec 8, 2009 1:21 PM - fixed formatting

Read only

0 Likes
1,204

cl_gui_frontend_Services=>GUI_UPLOAD just wraps the function module GUI_UPLOAD, so while, yes, you should use it, it won't fix the problem.

I dealt with this problem a few years ago by uploading the file as filetype BIN, rather than text, then splitting the resultant data by carriage return, into an internal table.

matt

Read only

0 Likes
1,204

hi matt when i set the filetype to 'BIN' the result is :

u3B31u3031u3030u3033u3030u3030u3030u3630u313Bu3030u3330...

Edited by: Matt on Dec 8, 2009 1:39 PM - removed formatting corrupting symbols

Read only

0 Likes
1,204

Where do you see this, and what do you expect to see?

matt

Read only

0 Likes
1,204

Hi Matt;

my itab

data: file_content type table of flt_text.
* flt_text = char400

upload func

CALL METHOD cl_gui_frontend_services=>gui_upload
    EXPORTING
      filename                = file_name
      filetype                = 'BIN'
    CHANGING
      data_tab                = file_content
    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
      not_supported_by_gui    = 17
      error_no_gui            = 18
      OTHERS                  = 19.

one of the line

1;10003000000006;10003[3];10037[10003[3];1];19;01/05/2009 09:08:59;10003000000004[3307];;0;0;         7;
01/05/2009 09:09:56;0[];2008380000048887;31;2,2001;0;0;0;0;;;10003000000000[10003[3];10037[10003[3];1];490;
01/05/2009 21:50:30];0[];0[];;;0;01/05/2009 10:59:00;1[];01/05/2009 10:59:00;1[];10003[];10003[];1

i want to see this line.

Read only

0 Likes
1,204

Hi!

What about raising the size of your table field?

TYPES: BEGIN OF t_tab,
         line(1000) TYPE c,
       END OF t_tab.
DATA: file_content TYPE STANDARD TABLE OF t_tab,
      file_line LIKE LINE OF file_content.

Regards

Tamá

Read only

0 Likes
1,204

Hi tamas

yeah i tried it but it didnt work.

thanks anyway

Read only

0 Likes
1,204

Hi,

Try this.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = FILE_NAME

filetype = 'ASC' " type ASC

tables

data_tab = data_all.

or you can try this with declarin length perhaps..

types: begin of ty_dw,

i_length(600) type C,

end of ty_dw.

data: dw type table of ty_dw.

data: typety type STRING.

typety = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = typety

FILETYPE = 'ASC'

TABLES

DATA_TAB = down

Read only

0 Likes
1,204

Hi,

did you tried what i have mentioned?

regards, Dieter

Read only

0 Likes
1,204

>

> Hi Matt;

>

> my itab

>

>

1;10003000000006;10003[3];10037[10003[3];1];19;01/05/2009 09:08:59;10003000000004[3307];;0;0;         7;
> 01/05/2009 09:09:56;0[];2008380000048887;31;2,2001;0;0;0;0;;;10003000000000[10003[3];10037[10003[3];1];490;
> 01/05/2009 21:50:30];0[];0[];;;0;01/05/2009 10:59:00;1[];01/05/2009 10:59:00;1[];10003[];10003[];1

>

> i want to see this line.

Yes but WHERE do you want to see this? In the debugger, with a write statement, AL11, what?

Read only

Former Member
0 Likes
1,204

Hi!

Try using cl_gui_frontend_Services=>GUI_UPLOAD method instead.

Regards

Tamá

Read only

Former Member
0 Likes
1,204

Hi,

try this:


DATA: IT_ITAB TYPE TABLE OF STRING.
*
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
  EXPORTING
    FILENAME = 'C:\TEST.TXT'
  CHANGING
    DATA_TAB = IT_ITAB[].

regards, Dieter