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

program not uploading xls file

Former Member
0 Likes
433

Hi all

I hav created a bdc to upload data . My program is working well with txt flat file

but when i try to execute it with a xl file it colect garbage value instead of values

from flat file.

what should i do so that i can upload data from both xl and txt file.

plz help me.

thanx in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
387

Hi,

Check this link for upload the date from excel file into internal table..it is not possible to upload the excel file using the GUI_UPLOAD

Check this link for other FM's

[KCD_EXCEL_OLE_TO_INT_CONVERT|http://docs.google.com/Doc?docid=0AZqwnQpzX9wBZGZ2MmhtZ3NfMTFjZzRqZmRw&hl=en]

[ALSM_EXCEL_TO_INTERNAL_TABLE|]

2 REPLIES 2
Read only

Former Member
0 Likes
388

Hi,

Check this link for upload the date from excel file into internal table..it is not possible to upload the excel file using the GUI_UPLOAD

Check this link for other FM's

[KCD_EXCEL_OLE_TO_INT_CONVERT|http://docs.google.com/Doc?docid=0AZqwnQpzX9wBZGZ2MmhtZ3NfMTFjZzRqZmRw&hl=en]

[ALSM_EXCEL_TO_INTERNAL_TABLE|]

Read only

venkat_o
Active Contributor
0 Likes
387

Hi, Try this way. <li>We can use the Function module TEXT_CONVERT_XLS_TO_SAP to read the Excel file into the internal table. From this internal table you can fill the target internal table.

REPORT ztest_notepad.
DATA: BEGIN OF it_data OCCURS 0,
       bukrs TYPE t001-bukrs,
       butxt TYPE t001-butxt,
       ort01 TYPE t001-ort01,
     END OF it_data.
TYPE-POOLS:truxs.
DATA:it_tab_raw_data TYPE  truxs_t_text_data.
"Call TEXT_CONVERT_XLS_TO_SAP fm
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
 EXPORTING
   i_tab_raw_data       = it_tab_raw_data
   i_filename           = 'C:\test.xls'
 TABLES
   i_tab_converted_data = it_data
 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.
ELSE.
 "Loop the data table  
 LOOP AT it_data.
   WRITE:/ it_data-bukrs,it_data-butxt, it_data-ort01.
 ENDLOOP.
ENDIF.
Thanks Venkat.O