‎2009 Apr 08 12:35 PM
Hi Experts,
I have created ztable, & uploading data with LSMW from excel.
But it takes lot of time to upload,
The excel file contails around 30-40 lakhs entry.
I have tried with BDC also.But too much is taken by both the options.
I have trying with the dividing excel sheet also. But problem remain same.
Can any one better solution for this.
Thanks & Regards,
Anagha Deshmukh
‎2009 Apr 08 12:43 PM
Hi,
This is because of quantity of data which is being uploaded into the table. If it is not running into a short dump, there is nothing worry.
As data is being uploaded into Ztable, so recording is the only approach either from LSMW or BDC.
Regards,
Brajvir
‎2009 Apr 08 12:38 PM
‎2009 Apr 08 12:43 PM
Hi,
This is because of quantity of data which is being uploaded into the table. If it is not running into a short dump, there is nothing worry.
As data is being uploaded into Ztable, so recording is the only approach either from LSMW or BDC.
Regards,
Brajvir
‎2009 Apr 08 1:40 PM
‎2009 Apr 08 1:47 PM
Hi,
If your intension is just to upload data from excel to a z table, why dont you directly upload data into a internal table in smaller chunks and do a insert of internal table to z table.
insert itab into z table should do instead of a bdc.
R,
srini
‎2009 Apr 08 1:55 PM
‎2009 Apr 08 2:57 PM
REPORT Ztest .
type-pools: truxs.
data: fname_length type rlgrap-filename,
start type i,
file_name type rlgrap-filename.
data: t_upload like *Ztable* occurs 0 with header line.
data: g_year type p,
flag type i value 1,
g_futdate like sy-datum,
g_subty like pa0034-subty,
g_exist_flg type c,
g_mode(1).
data: it_raw type truxs_t_text_data.
selection-screen begin of block blk_01 with frame title text-001.
parameter: p_fname like rlgrap-filename obligatory.
selection-screen end of block blk_01.
at selection-screen on value-request for p_fname.
call function 'F4_FILENAME'
exporting
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = 'PATH'
importing
file_name = p_fname.
at selection-screen.
perform f_file_check. " CHECK EXISTENCE OF FILE
clear g_mode.
g_mode = 'X'.
perform f_upload_file .
perform insert_pms_data.
*&---------------------------------------------------------------------*
*& Form F_UPLOAD_FILE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form f_upload_file .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
* I_LINE_HEADER =
i_tab_raw_data = it_raw
i_filename = p_fname
tables
i_tab_converted_data = t_upload[]
* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
.
endform. " F_UPLOAD_FILE
*&---------------------------------------------------------------------*
*& Form INSERT_PMS_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form insert_pms_data .
modify *Ztable* from table t_upload.
endform. " INSERT_PMS_DATA
*&---------------------------------------------------------------------*
*& Form f_file_check
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form f_file_check .
data : l_len type i,
l_len1 type i.
clear : g_exist_flg,
file_name.
file_name = p_fname.
l_len = strlen( file_name ).
l_len1 = l_len - 3 .
shift file_name by l_len1 places.
find 'xls' in section offset 0 length 3 of file_name ignoring case.
call function 'TMP_GUI_GET_FILE_EXIST'
exporting
fname = p_fname
importing
exist = g_exist_flg
exceptions
fileinfo_error = 1
others = 2.
if sy-subrc <> 0.
* Warning : Error while checking for file information !
endif.
if g_exist_flg is initial.
** Error : File & does not exists !!!
else.
file_name = p_fname.
endif.
endform.