Uploading data from XL sheet

Hi,
How to upload data from XL sheet to internal table , can u please provide the sample code.
thanks
krishna

HI Krishna
See this code where i had writen to UPLOAD A EXCEL SHEET AND again pass that to APPLICATION server
i think it wil be very useful for you
you can understand this very easily
REPORT  ZSD_EXCEL_INT_APP.
parameter: file_nm type localfile.
types : begin of it_tab1,
        f1(20),
        f2(40),
        f3(20),
       end of it_tab1.
data : it_tab type table of ALSMEX_TABLINE with header line,
       file type rlgrap-filename.
data : it_tab2 type it_tab1 occurs 1,
       wa_tab2 type it_tab1,
       w_message(100)  TYPE c.
at selection-screen on value-request for file_nm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
  PROGRAM_NAME        = SYST-REPID
  DYNPRO_NUMBER       = SYST-DYNNR
  FIELD_NAME          = ' '
   STATIC              = 'X'
  MASK                = ' '
  CHANGING
   file_name           = file_nm
EXCEPTIONS
   MASK_TOO_LONG       = 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.
start-of-selection.
refresh it_tab2[].clear wa_tab2.
file = file_nm.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                      = file
    i_begin_col                   = '1'
    i_begin_row                   =  '1'
    i_end_col                     = '10'
    i_end_row                     = '35'
  tables
    intern                        = it_tab
EXCEPTIONS
   INCONSISTENT_PARAMETERS       = 1
   UPLOAD_OLE                    = 2
   OTHERS                        = 3
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.
  case it_tab-col.
   when '002'.
    wa_tab2-f1 = it_tab-value.
   when '004'.
    wa_tab2-f2 = it_tab-value.
  when '008'.
    wa_tab2-f3 = it_tab-value.
endcase.
at end of row.
  append wa_tab2 to it_tab2.
clear wa_tab2.
  endat.
endloop.
data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*--- Display error messages if any.
  IF sy-subrc NE 0.
    MESSAGE e001(zsd_mes).
    EXIT.
  ELSE.
*---Data is downloaded to the application server file path
    LOOP AT it_tab2 INTO wa_tab2.
      TRANSFER wa_tab2 TO p_file.
    ENDLOOP.
  ENDIF.
*--Close the Application server file (Mandatory).
  CLOSE DATASET p_file.
loop at it_tab2 into wa_tab2.
  write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
endloop.

Similar Messages

  • Uploading data from excel sheets through BDC's into sap system

    hi guys,
    can you please help me with this. As we use gui_upload to upload data from flat file to sap system, which function module you use to upload data from Excel sheet to sap system through bdc's

    hello pavan,
    welcome to SDN
    check the below program
    REPORT ZEXCEL_TO_INTERNAL .
    data: begin of itab occurs 0,
          name(20) type c,
          addre(20) type c,
          end of itab.
    DATA : ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    DATA : B1 TYPE I VALUE 1,
           C1 TYPE I VALUE 1,
           B2 TYPE I VALUE 100,
           C2 TYPE I VALUE 9999.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                   =
        'C:\Documents and Settings\administrator\Desktop\ppcon001bd_24.xls'
        I_BEGIN_COL                   = B1
        I_BEGIN_ROW                   = C1
        I_END_COL                     = B2
        I_END_ROW                     = C2
      TABLES
        INTERN                        = itab1
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3.
    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 itab1.
    write:/ itab1.
    Endlop.
    Regards,
    Naveen

  • Upload data from excel sheet into md61

    Hi Gurus,
                    Can anybody please tell me the solution like how to upload the data from excel sheet into the MD61
    if u suggest me to write an ABAP code then its fine or any other way would be great
    and can u also send me the abap code i would be thankful to all

    Hi,
    I can be done in 2 ways.
    1. Using LSMW you can upload your MD61 demand thru Excel sheet.
    2. You can use BDC to upload the demand from Excel. For this you need to take help from the ABAP. You need to record the macro usinf SHDB and the table maintenance will be taken care by the developer.
    For LSMW you need not depend on your developer, as a functional consultant you can do it yourself.
    Regards,
    V. Suresh

  • BDC for Uploading data from XL sheet with unknown order of fields

    Hi SAP Gurus,
    My requirement is as follows,
    A BDC is to be developed for uploading data from an XL sheet, but the problem here is , the order of fileds in the sheet can be changed .
    ie,  for example the fields in the XL sheet are :-
      matnr    maktx   menge  amount
    but the user can give as
      matnr  amount  menge  maktx
      or
    maktx   matnr  amount  menge
    how i can solve this problem.
    Thanks and Regards,
    pavan.

    Hi Pavan,
    You need to handle it by your self, you can create a dynamic table based on the file value.
    The field name pass from file with the record as a header, and based on the header name create your dynamic table.
    afterward you can pass your value to BDC.
    for creating dynamic table you can use this method
    call method cl_alv_table_create=>create_dynamic_table
      exporting
       i_style_table             =
        it_fieldcatalog           = it_field[]
       i_length_in_byte          =
      importing
        ep_table                  = dyn_tab
       e_style_fname             =
      exceptions
        generate_subpool_dir_full = 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.
    -Dhirendra

  • Uploading data from excel sheet

    HI,
         Can anyone provide me the details to upload vendor data from excel sheet to database through bdc?
    Thankyou.

    upload the excel file in your internal table and then use BDC to updated the database table.
    FM's to upload Excel:
    GUI_UPLOAD
    KCD_EXCEL_OLE_TO_INT_CONVERT
    ALSM_EXCEL_TO_INTERNALTABLE
    refer to the link:
    http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table-2/
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    With luck,
    Pritam.

  • Uploading Datas From Spread sheet to Database Table

    I went to URL http://htmldb.oracle.com/pls/otn/f?p=38131:1 and download Vikas' CSV Upload application (a zip file) as well as the script to create the HTMLDB_TOOLS package.
    I follow the steps in the link : Re: File Browse, File Upload
    The application is created,Preview shows that the datas in the form of Excel sheet,but I cant upload the spread sheet.
    If I click the Upload button It shows the Error:
    ORA-01861: literal does not match format string
    Error ORA-01861: literal does not match format string
    OK
    Kindly let me know the reason for the error.
    Please help me to solve this Issue.
    Thanks in Advance
    by
    Suresh

    Hi Gussay,
    Thanks for ur reply.
    I found the error,it was due to the date format.
    If i drop the date column from the table and also from spread sheet,then it uploads.
    How can we load dates in spread sheet to database column.
    Thanks in advance
    Suresh

  • Uploading data from Excel sheet into SAP.

    Dear All,
    I want to upload data existing in Excel sheet into SAP. Is there any possibility with the following requirements?
    1) Excel file contains serial numbers with different values.Like power(230Wp),Voc,Isc,Vmp and Imp.
    2) We need to upload the same data into SAP with validations.
    3) Validations are like no serial number should be repeated.
    4) And depending on the Power value, the serial number should be assigned to different batches.Eg:The batches are as follows:
         201 - 210
         210 - 220
         220 - 230
       and if the Pmax of the serial number is 205.It should be assigned to batch 201 - 210 .
    5) At present we are using MB31 to post the serial numbers which are existing in the flat file.
    Thanks and Regards,
    Varun Siddharth

    Hi,
    Refer to the following code:
    DATA: lv_filetype(10) TYPE c,
            lv_gui_sep TYPE c,
            lv_file_name TYPE string.
      lv_filetype = 'ASC'.
      lv_gui_sep = 'X'.
      lv_file_name = pa_dfile.
    FM call to upload file
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lv_file_name
          filetype                = lv_filetype
          has_field_separator     = lv_gui_sep
        TABLES
          data_tab                = gi_zhralcon_file
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    The excel file must be a tab delimited file.
    Hope it helps.
    Regards,
    Rajesh Kumar

  • Regarding uploading data from excel sheet to internal table

    hi,
    while executing the code im getting the output one by one but i want it to be displayed in a table format can any one help me regarding this issue.
    thanks and regards,
    siri

    Hi Sirisha,
    Through this FM we can't get the data in tabular format. After getting data from this FM we have to convert to tabular format. As far as i know there is no FM for Excel upload which directly gives data in tabular format.
    Check below sample code which uploads 3 columns from excel file.
    U can add as many case statements as the number of fields.
    PARAMETERS: po_file TYPE rlgrap-filename DEFAULT 'E:test.xls'.
    TYPES: BEGIN OF t_final,
              empno(10) TYPE c,
              name(30) TYPE c,
              state(25) TYPE c,
           END OF t_final.
    DATA: i_tab    TYPE STANDARD TABLE OF alsmex_tabline,
          i_final  TYPE STANDARD TABLE OF t_final,
          wa_tab   TYPE alsmex_tabline,
          wa_final TYPE t_final.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR po_file.
    PERFORM open_folder.
    START-OF-SELECTION.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
         EXPORTING
              filename                = po_file
              i_begin_col             = 1
              i_begin_row             = 1
              i_end_col               = 3
              i_end_row               = 65256
         TABLES
              intern                  = i_tab
         EXCEPTIONS
              inconsistent_parameters = 1
              upload_ole              = 2
              OTHERS                  = 3.
    CHECK NOT i_tab[] IS INITIAL.
    LOOP AT i_tab INTO wa_tab.
      CASE wa_tab-col.
        WHEN 1.
          wa_final-empno = wa_tab-value.
        WHEN 2.
          wa_final-name = wa_tab-value.
        WHEN 3.
          wa_final-state = wa_tab-value.
      ENDCASE.
      AT END OF row.
        APPEND wa_final TO i_final.
        CLEAR wa_final.
      ENDAT.
    ENDLOOP.
    FORM open_folder .
      DATA: li_file  TYPE TABLE OF sdokpath,
            lwa_file TYPE sdokpath.
      CLEAR: po_file, lwa_file.
      REFRESH li_file[].
      CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
           TABLES
                file_table = li_file
           EXCEPTIONS
                cntl_error = 1
                OTHERS     = 2.
      IF sy-subrc IS INITIAL.
        READ TABLE li_file INTO lwa_file INDEX 1.
        IF sy-subrc IS INITIAL.
          po_file = lwa_file-pathname.
        ENDIF.
      ENDIF.
    ENDFORM.                    " open_folder
    Just try executing above code in debug mode. U will understand the functionality.
    Thanks,
    Vinod.

  • Uploading Data From Excel Sheet to SAP Database Tables

    Dear Friends,
    We are having an Excel Sheet with 90 different columns. Now we want only 2 of the columns to be uploaded in the database tables. So, Plz tell me which function module will be suitable for this. And plz help me with the code also.
    Thanks,
    Nishant Jain

    Hi Nishu,
    A sample for the same..
    data it_excel like table of ALSMEX_TABLINE with header line.
    here we retrieve only 2 cols directly..
    now itab will contain only 2 cols of all rows seperated by comma ..
    data str(1000).
    data itab like table of str with  header line.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = 'C:sample1.xls'
        i_begin_col                   = 1
        i_begin_row                   = 1
        i_end_col                     = 2
        i_end_row                     = 100
      tables
        intern                        =  it_excel
      LOOP AT it_excel.
        AT NEW row.
          CLEAR itab.
        ENDAT.
        IF itab IS INITIAL.
          MOVE it_excel-value TO itab.
        ELSE.
          CONCATENATE itab ',' it_excel-value INTO itab.
        ENDIF.
        AT END OF row.
          APPEND itab.
        ENDAT.
      ENDLOOP.
    regards
    satesh

  • Uploading data from excel sheet using BAPI (BAPI_ACC_MANUAL_ALLOC_POST)

    Hi,
    I am Using BAPI_ACC_MANUAL_ALLOC_POST (Manual cost allocation) for uploading into database. But i am getting the error "DO NOT USE COST ELEMENT xxxxxxxx FOR REPOST COSTS".
    can anyone explain me the possible reasons for  this error.
    any help will be rewarded.
    Thanks and Regards,
    Gautham Paspala

    Hi,
    Refer to the following code:
    DATA: lv_filetype(10) TYPE c,
            lv_gui_sep TYPE c,
            lv_file_name TYPE string.
      lv_filetype = 'ASC'.
      lv_gui_sep = 'X'.
      lv_file_name = pa_dfile.
    FM call to upload file
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lv_file_name
          filetype                = lv_filetype
          has_field_separator     = lv_gui_sep
        TABLES
          data_tab                = gi_zhralcon_file
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    The excel file must be a tab delimited file.
    Hope it helps.
    Regards,
    Rajesh Kumar

  • Errror when uploading data from xcel sheet into cube.

    i created info package .
    after dat when i preview the data i get a error which is 
    Error in conversion exit
    CONVERSION_EXIT_CUNIT_INPUT 1.
    i am unable to find this error....
    but dont know where it is....

    This error usually comes when you have wrong Unit in file or some extra spaces?Just check them once.
    Also=>Error in conversion exit CONVERSION_EXIT_CUNIT_INPUT

  • Upload data from excel to Ztable with statistics

    Hi,
    I have a requirement to upload data from excel sheet to ztable .
    Here i need tp provide the user with the execution statistics like
    1.Number of records read from the Excel spread-sheet
    2. Number records processed successfully
    3. Number records with Error
    4. Name and location of Error Log-file (text-file format)
    5. Name and location of the file containing error records (Excel spread-sheet format)
    I would appreciate if any of you have code written for the same

    See the below example code to upload from xl file to sap
    REPORT ZLWMI151_UPLOAD no standard page heading
                           line-size 100 line-count 60.
    *tables : zbatch_cross_ref.
    data : begin of t_text occurs 0,
           werks(4) type c,
           cmatnr(15) type c,
           srlno(12) type n,
           matnr(7) type n,
           charg(10) type n,
           end of t_text.
    data: begin of t_zbatch occurs 0,
          werks like zbatch_cross_ref-werks,
          cmatnr like zbatch_cross_ref-cmatnr,
          srlno like zbatch_cross_ref-srlno,
          matnr like zbatch_cross_ref-matnr,
          charg like zbatch_cross_ref-charg,
          end of t_zbatch.
    data : g_repid like sy-repid,
           g_line like sy-index,
           g_line1 like sy-index,
           $v_start_col         type i value '1',
           $v_start_row         type i value '2',
           $v_end_col           type i value '256',
           $v_end_row           type i value '65536',
           gd_currentrow type i.
    data: itab like alsmex_tabline occurs 0 with header line.
    data : t_final like zbatch_cross_ref occurs 0 with header line.
    selection-screen : begin of block blk with frame title text.
    parameters : p_file like rlgrap-filename obligatory.
    selection-screen : end of block blk.
    initialization.
      g_repid = sy-repid.
    at selection-screen on value-request for p_file.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                PROGRAM_NAME = g_repid
           IMPORTING
                FILE_NAME    = p_file.
    start-of-selection.
    Uploading the data into Internal Table
      perform upload_data.
      perform modify_table.
    top-of-page.
      CALL FUNCTION 'Z_HEADER'
      EXPORTING
        FLEX_TEXT1       =
        FLEX_TEXT2       =
        FLEX_TEXT3       =
    *&      Form  upload_data
          text
    FORM upload_data.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                FILENAME                = p_file
                I_BEGIN_COL             = $v_start_col
                I_BEGIN_ROW             = $v_start_row
                I_END_COL               = $v_end_col
                I_END_ROW               = $v_end_row
           TABLES
                INTERN                  = itab
           EXCEPTIONS
                INCONSISTENT_PARAMETERS = 1
                UPLOAD_OLE              = 2
                OTHERS                  = 3.
      IF SY-SUBRC <> 0.
        write:/10 'File '.
      ENDIF.
      if sy-subrc eq 0.
        read table itab index 1.
        gd_currentrow = itab-row.
        loop at itab.
          if itab-row ne gd_currentrow.
            append t_text.
            clear t_text.
            gd_currentrow = itab-row.
          endif.
          case itab-col.
            when '0001'.
              t_text-werks = itab-value.
            when '0002'.
              t_text-cmatnr = itab-value.
            when '0003'.
              t_text-srlno = itab-value.
            when '0004'.
              t_text-matnr = itab-value.
            when '0005'.
              t_text-charg = itab-value.
          endcase.
        endloop.
      endif.
      append t_text.
    ENDFORM.                    " upload_data
    *&      Form  modify_table
          Modify the table ZBATCH_CROSS_REF
    FORM modify_table.
      loop at t_text.
        t_final-werks = t_text-werks.
        t_final-cmatnr = t_text-cmatnr.
        t_final-srlno = t_text-srlno.
        t_final-matnr = t_text-matnr.
        t_final-charg = t_text-charg.
        t_final-erdat = sy-datum.
        t_final-erzet = sy-uzeit.
        t_final-ernam = sy-uname.
        t_final-rstat = 'U'.
        append t_final.
        clear t_final.
      endloop.
      delete t_final where werks = ''.
      describe table t_final lines g_line.
      sort t_final by werks cmatnr srlno.
    Deleting the Duplicate Records
      perform select_data.
      describe table t_final lines g_line1.
      modify zbatch_cross_ref from table t_final.
      if sy-subrc ne 0.
        write:/ 'Updation failed'.
      else.
        Skip 1.
        Write:/12 'Updation has been Completed Sucessfully'.
        skip 1.
        Write:/12 'Records in file ',42 g_line .
        write:/12 'Updated records in Table',42 g_line1.
      endif.
      delete from zbatch_cross_ref where werks = ''.
    ENDFORM.                    " modify_table
    *&      Form  select_data
          Deleting the duplicate records
    FORM select_data.
      select werks
             cmatnr
             srlno from zbatch_cross_ref
             into table t_zbatch for all entries in t_final
             where werks = t_final-werks
             and  cmatnr = t_final-cmatnr
             and srlno = t_final-srlno.
      sort t_zbatch by werks cmatnr srlno.
      loop at t_zbatch.
        read table t_final with key werks = t_zbatch-werks
                                    cmatnr = t_zbatch-cmatnr
                                    srlno = t_zbatch-srlno.
        if sy-subrc eq 0.
          delete table t_final .
        endif.
        clear: t_zbatch,
               t_final.
      endloop.
    ENDFORM.                    " select_data
    Reward Points if it is helpful
    Thanks
    Seshu

  • Upload data from excel (not the excle file) into SAP

    Guys,
    how can we upload data from excel sheet into SAP? I mean just the data not the entire file,
    I have a requirement where user press a button in excel sheet and the data in the sheet will get uploaded into SAP.
    I am sure we have to use BAPI and some VB programming for macros, I will really appriciate if anyone can help how to achive this.
    some sample code exampe will help.
    Cheers!

    I think u r writing BDC for Uploading the data from excel flile to sap. for this is the code I am sending u can use then for Uploading data from excel to sap.
    DATA: lv_filename TYPE rlgrap-filename.
    FIELD-SYMBOLS : <fs>.
    DATA : l_intern TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA : l_index TYPE i.
    PARAMETERS : startcol TYPE i ,
          startrow TYPE i ,
          endcol TYPE i ,
          endrow TYPE i .
    PARAMETERS: p_flnam LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_flnam.
      CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       program_name        = sy-repid
      FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_flnam .
      MOVE p_flnam TO lv_filename.
    Uploading the flat file from the desktop
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                      = lv_filename
          i_begin_col                   = startcol
          i_begin_row                   = startrow
          i_end_col                     = endcol
          i_end_row                     = endrow
        TABLES
          intern                        = l_intern
    EXCEPTIONS
      INCONSISTENT_PARAMETERS       = 1
      UPLOAD_OLE                    = 2
      OTHERS                        = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      SORT l_intern BY row col.
      LOOP AT l_intern.
        MOVE l_intern-col TO l_index.
        ASSIGN COMPONENT l_index OF STRUCTURE itab TO <fs>.
        MOVE l_intern-value TO <fs>.
        AT END OF row.
          APPEND itab.
          CLEAR itab.
        ENDAT.
      ENDLOOP.
    I hope it will help u.
    Regards
    Nayan

  • Upload data from excel where one column has text of 3000 characters

    Guyz,
    I have a query. One of my requirments is to upload data from excel sheet & create a material. In the excel sheet one of the columns has text for BASIC DATA TEXT under ADDITIONAL DATA of a Material. This is a text of running length.
    the selection screen has feature of file upload & the users will upload excel files from their respective presentation servers.
    Now my problem is that I need a function module which can convert this column in excel sheet into an internal table & later call the BAPI for MM creation.
    I have used TEXT_CONVERT_XLS_TO_SAP & when i read my internal table to check this column length, it shows only 255 characters where as data in the excel sheet has 3000 characters (say for eg.)
    Can anybody throw some light on this.
    Thanks in advance
    GPK

    Hi,
    You can try using this function module and see that whether all your data is coming into the internal table properly.
    MS_EXCEL_OLE_STANDARD_DAT
    For the other part you needed to convert the internal table data into the structure as need by the BAPI and then call the create BAPI to create the materials in the SAP System.
    Hope this helps.
    Thanks,
    Samantak.

  • Upload data from excel file -URGENT

    Hi All,
    Advanced thanks to ur reply
    How to upload data from excel sheet to itab
    what are the functional modules we are using for that
    Please help me
    i look forward to ur reply
    Regards
    Raja Sekhar.T

    Hi,
         TYPE-POOLS: truxs.
    DATA: i_text_data       TYPE truxs_t_text_data,
          v_filename_string TYPE string.
    DATA: BEGIN OF itab OCCURS 0,
            Name(30),
            Phone(15),
            Fax(500).
    DATA: END OF itab.
    PARAMETERS: p_file LIKE rlgrap-filename.
    START-OF-SELECTION.
      v_filename_string = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_filename_string
          filetype                      = 'ASC'
          has_field_separator           = 'X'
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
          dat_mode                      = ''
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        TABLES
          data_tab                      = i_text_data
        EXCEPTIONS
          file_open_error               = 1
          file_read_error               = 2
          no_batch                      = 3
          gui_refuse_filetransfer       = 4
          invalid_type                  = 5
          no_authority                  = 6
          unknown_error                 = 7
          bad_data_format               = 8
          header_not_allowed            = 9
          separator_not_allowed         = 10
          header_too_long               = 11
          unknown_dp_error              = 12
          access_denied                 = 13
          dp_out_of_memory              = 14
          disk_full                     = 15
          dp_timeout                    = 16
          OTHERS                        = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator          = 'X'
        I_LINE_HEADER              =
          i_tab_raw_data             = i_text_data
          i_filename                 = p_file
        TABLES
          i_tab_converted_data       = itab
        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.
    I think this code will help u.
    With Regards,
    Ranganathan

Maybe you are looking for

  • Quota generation in IT2006

    Hello Experts. need your help in this issue, i am running time evaluation with schema ZM00 where annual leave quota is generated with TE. my problem here is that the quota is being generated on a monthly basis with 1.25 day/month and it is showing in

  • Iphoto, the App Store, iMessage problems on OSX 10.8.5

    I have a couple of problems. Firstly, my imessage does not work. When I send messages it does not deliver them, and puts this little red exclamation point next to the message. When Imessge is not active i recieve old texts from weeks ago in the top r

  • Output type for PO's

    We have a new PO type which we have assigned to a new Output type in transaction NACE have configured as follows. Application "EF" Purchase Order for Condition Records --> Key Combination ->Purchasing Output Determination: Document Type and tagged th

  • Problem opening Premiere Pro project after upgrades to 4.1.0 and Shockwave

    I cannot open my project. During this project which has many CS4 AfterEffect pieces and with the Premiere Pro 4.1.0 upgrade and with the installation of the Shockware and updating the Flash Player to 10.0., I am no longer able to open my project!! I

  • Slow boot up - Caused by internal USB

    Often (not allways) my computer uses an abnormal amount of time  before booting up. It stops on post for about 20-30 sec at the very start (right before memory messages apperas with RAM size and timings). Info about my memory stics (supported by Neo2