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

Upload_zip file

Former Member
0 Likes
625

Hi

ı am usin fm "upload" to upload zip file its working but   size of my actual file is 4.419 bytes but FM creates 2400 bytes which is equal to multiple of  width and total lines of gt_file . Fm   cuts , exceeding part of width.I tried to use an internal table like xstring ı am getting dumb.How can ı solve this issue thanks

DATA: BEGIN OF gt_file OCCURS 0,
         line TYPE text200,
       END OF gt_file.

DATA gv_filename1 LIKE  RLGRAP-FILENAME.


CALL FUNCTION 'UPLOAD'
     EXPORTING
       filename                = gv_filename1
       filetype                = 'BIN'
       filetype_no_change      = 'X'
     IMPORTING
       act_filename            = gv_filename1
     TABLES
       data_tab                = gt_file
     EXCEPTIONS
       conversion_error        = 1
       invalid_table_width     = 2
       invalid_type            = 3
       no_batch                = 4
       unknown_error           = 5
       gui_refuse_filetransfer = 6
       OTHERS                  = 7.

   IF sy-subrc <> 0.

  MESSAGE  'Error when reading from file. Operation stopped!' type 'I'.
     EXIT.
   ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
590

Hi,

You should declare your internal table as TYPE SOLIX_TAB, and use the method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD instead of that old UPLOAD fm...

Furthermore, if you need to unzip your uploaded package you will need to know the exact file length by using the import parameter filelength of the method.

Kr,

Manu.

2 REPLIES 2
Read only

Former Member
0 Likes
591

Hi,

You should declare your internal table as TYPE SOLIX_TAB, and use the method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD instead of that old UPLOAD fm...

Furthermore, if you need to unzip your uploaded package you will need to know the exact file length by using the import parameter filelength of the method.

Kr,

Manu.

Read only

0 Likes
590

increasing width of table and using filelength solved the problem thanks