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

Uploading data using LSMW

Former Member
0 Likes
977

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
922

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

6 REPLIES 6
Read only

Former Member
0 Likes
922

Hi Try to do with secatt.

Read only

Former Member
0 Likes
923

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

Read only

kanishakgupta1
Contributor
0 Likes
922

Upload through text file....

Read only

Former Member
0 Likes
922

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

Read only

Former Member
0 Likes
922

hi,

if u want do ztable update what is the nessary to use lsmw and bdc .

use field-symbols to read the data into internal tables

form here directly u can update u ztable

~linganna

Edited by: katigiri linganna on Apr 8, 2009 2:55 PM

Read only

Former Member
0 Likes
922
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.