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 in GUI_upload

Former Member
0 Likes
473

Hi everyone,

I am using the FM GUI_upload to upload a .txt tab seperated

file .

when when the FM executes i am finding that the internal table

does not hold all the values in the file.

i ckecked and the no of fields and their type is equal in both the internal table and the file.

what could be the reason for this?

3 REPLIES 3
Read only

Former Member
0 Likes
444

Hi

what could be the reason for this?

You can find out the reason..with the help of a tool called Debugging. The best tool an ABAPer can get..

Just debug right from the start...and see in the FM...whats happening..

Regards,

Vishwa.

Read only

Former Member
0 Likes
444

Hi Aditya,

Check out the other sample program to upload the data into the xls file.


REPORT  ZCC_EXCEL_UPLOAD.
type-pools: truxs.
data:p_file type RLGRAP-FILENAME.
p_file = 'H:\INT221\testmat1.xlsx'.

*data : sw_string type string.
*sw_string = 'H:\INT221\testmat1.xlsx'.

*p_file = sw_string .



types:begin of t_mara,
    matnr(10) ,
    end of t_mara.
data:it_tab type standard table of t_mara with header line.
data:w_tab type TRUXS_T_TEXT_DATA.



CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
  EXPORTING
*   I_FIELD_SEPERATOR          =
   I_LINE_HEADER              = 'X'
    i_tab_raw_data             = w_tab
    i_filename                 = p_file
    tables
    i_tab_converted_data       = it_tab
* 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.


loop at it_tab.
write:/ it_tab-matnr.
endloop.

Thanks,

Chidanand

Read only

Former Member
0 Likes
444

Hi,

Are you giving the exporting parameter HAS_FIELD_SEPARATOR = 'X' ?

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = p_filename

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

tables

data_tab = t_output.