Access excel sheet uploaded in library on sharepoint using sharepoint development

Hi,
I have an excel sheet which i have uploaded on sharepoint site as a library.
now i want to access this excel sheet using sharepoint development(c#).
Is it possible?
I have one another query- I want to read excel sheet using sharepoint 2010 development.
Please help to solve both issues.
Thanks in advance!
Regards
rajni

Hi rajni,
According to your description, my understanding is that you want to access the excel files uploaded in a library and read the worksheet data by C#.
You can read excel file using Excel Services. The Excel Services REST API is a new feature of Excel Services that enables you to access Microsoft Excel workbook data by using a uniform resource locator (URL) address. Using the REST API, you can retrieve
resources such as ranges, charts, tables, and PivotTables from workbooks stored on SharePoint Server 2010. More inforamtion, please refer to the link below:
http://msdn.microsoft.com/en-us/library/hh124646(v=office.14).aspx
There are other useful links about accessing and reading excel file in library, please take a look at:
http://www.sharepointwithattitude.com/archives/61
http://www.c-sharpcorner.com/uploadfile/vivekbritish/how-to-downloadread-excel-file-from-sharepoint-library-using-excel-services/
http://stackoverflow.com/questions/14496608/read-excel-file-stored-in-sharepoint-document-library
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support

Similar Messages

  • How to Upload Excel sheet in DB or internal table using SAP NetWeaver ABAP

    Dear All experts,
    Pls provide guidance  to Upload Excel sheet in DB or internal table using ABAP in  ( SAP NetWeaver stack  )
    Regards
    Machindra
    Edited by: Machindra Patade on Apr 8, 2010 3:07 PM

    Please search before posting.
    Thread locked.
    Thomas

  • On excel sheet upload read the workbook and populate data to sharepoint list

    Requirement in my current project:
    In a document library when I upload an excel sheet, a specific workbook has to be read and the contents have to be uploaded to a sharepoint custom list.
    The approach followed was create an event receiver and register as a feature. Following is the code for event receiver.
    public override void ItemAdded(SPItemEventProperties properties)
                base.ItemAdded(properties);
                var list = getSPList("{150301BF-D0BD-452C-90D7-2D6CD082A247}");          
                SPListItem doc = properties.ListItem;
                doc["Msg"] = "items deleted from req list";
                doc.Update();
                string excelname=doc.File.Name;
                System.Diagnostics.EventLog.WriteEntry("ExcelUpload", "calling read excel");
                string filepath = doc.File.Url.ToString();
                doc["Msg"] = "excel name" + excelname + filepath;
                doc.Update();
                readExcel(excelname,filepath);
            private static SPList getSPList(String SPListGuid)
               // SPSite Site = SPContext.Current.Site;
                SPSite Site = new SPSite("http://omistestsrv:32252/sites/OMD");
                SPWeb web = Site.OpenWeb();
                Guid listid = new Guid(SPListGuid);
                web.AllowUnsafeUpdates = true;
                SPList List = web.Lists[listid];
                return List;
            private void readExcel(string excelname,string filepath)
                try
                    SPSecurity.RunWithElevatedPrivileges(delegate()
                        using (SPSite Site = new SPSite("http://omistestsrv:32252/sites/OMD"))
                            SPWeb web = Site.OpenWeb();
                            string workbookpath = web.Url + "/" + filepath;
                            web.AllowUnsafeUpdates = true;
                            var _excelApp = new Microsoft.Office.Interop.Excel.Application();
                            System.Diagnostics.EventLog.WriteEntry("ExcelUpload", "iside read excel");
        //my code breaks or fails when cursor reaches this statement. I am not able to open the excel sheet, there is no    //problem related to the permission. same code snippet works in a console application. but when tried as an
    event    //handler in sharepoint it breaks. can anyone help me to resolve the problem
                            workBook = _excelApp.Workbooks.Open(workbookpath, Type.Missing, Type.Missing, Type.Missing, Type.Missing,Type.Missing,
    Type.Missing, Type.Missing, Type.Missing,Type.Missing, Type.Missing, Type.Missing, Type.Missing,Type.Missing, Type.Missing);
                            System.Diagnostics.EventLog.WriteEntry("ExcelUpload", "after excel open");
                                int numSheets = workBook.Sheets.Count;
                                // Iterate through the sheets. They are indexed starting at 1.
                                System.Diagnostics.EventLog.WriteEntry("ExcelUpload", numSheets.ToString());
                                for (int sheetNum = 12; sheetNum < 13; sheetNum++)
                                    System.Diagnostics.EventLog.WriteEntry("ExcelUpload", "inside first for
    loop");
                                    Worksheet sheet = (Microsoft.Office.Interop.Excel.Worksheet)workBook.Sheets[sheetNum];
                                    Microsoft.Office.Interop.Excel.Range excelRange = sheet.get_Range("A13",
    "P89") as Microsoft.Office.Interop.Excel.Range;
                                    object[,] valueArray = (object[,])excelRange.get_Value(
                                        Microsoft.Office.Interop.Excel.XlRangeValueDataType.xlRangeValueDefault);
                                    var list = getSPList("{150301BF-D0BD-452C-90D7-2D6CD082A247}");
                                    for (int L = 1; L <= excelRange.Rows.Count; L++)
                                        string stringVal = valueArray[L, 1] as string;
                                        if ((valueArray[L, 1] != null) && (!string.IsNullOrEmpty(stringVal)))
                                            System.Diagnostics.EventLog.WriteEntry("ExcelUpload",
    "inside second for loop");
                                            SPListItemCollection
    listItems = list.Items;
                                            SPListItem item = listItems.Add();
                                            item["Product"] = valueArray[L,
    1];
                                            item["App"] = valueArray[L,
    2];
                                            web.AllowUnsafeUpdates
    = true;
                                            item.Update();
                                web.AllowUnsafeUpdates = false;
                                //Or Another Method with valueArray Object like "ProcessObjects(valueArray);"
                                _excelApp.Workbooks.Close();
                    //workBook.Close(false, excelname, null);
                    //Marshal.ReleaseComObject(workBook);
                catch (Exception e)
                    System.Diagnostics.EventLog.WriteEntry("ExcelUpload", e.Message.ToString());
                finally
                    System.Diagnostics.EventLog.WriteEntry("ExcelUpload", "finally block");
    Is this the only approach to meet this requirement or is there any other way to crack it. sharepoint techies please help me.

    as you described the scenario of the event that it should happen when user upload excel to a document library. Event Receiver is your best bet. However if you would have a requirement that users can send excel files any time to a network file location and
    you want to pick it, read it and create list items etc. You would write a sharepoint timer job that would run every 10 minute to check for file and if available on the network drive, perform the operation etc. so that users who send excel file does not need
    to come to the sharepoint etc. You can see that you have Event Receivcer option or Timer job option OR you would write a console application to trigger the code at a scheduled time on sharepoint server etc. so you are using the event receiver in the correct
    scenario.
    Moonis Tahir MVP, MCPD, MCSD.net, MCTS BizTalk 2006/SQL 2005/SharePoint Server 2007 (Dev & Config)

  • How to update a custom list when there is a changes in excel sheet uploaded in document library

     
    I have created a document library in which m uploading a excel sheet with values in it and i have created a custom list with same no.of.rows and columns in the excel sheet given the same name of columns. Now i have to make sure that whatever changes i do
    in the excel sheet should automatically gets updated in custom list in sharepoint

    You'll need to create an event receiver for when you add/update a document on the source library (http://msdn.microsoft.com/en-us/library/office/gg749858(v=office.14).aspx)
    Then, with code open the excel file and count the rows. You can use the OpenXmlSDK to do that (http://www.microsoft.com/en-us/download/details.aspx?id=5124)
    Good luck ;)

  • BDC table control using Excel sheet upload

    Hi All,
    I am working BDC table control.I want to upload the From excel sheet.I am using the FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload the the data into my internal table.The data is populating in the internal table.
    Now i have problem tat how to populate this excel sheet data to the Bdc table control.
    Can nybody help me out.\[removed by moderator\]
    Thanks,
    Swapna.
    Edited by: Jan Stallkamp on Jul 25, 2008 10:57 AM

    after fetching data from EXCEL sheet, each column data (in excel sheet) will be uploaded to individual record into your internal table along with row number and column number, loop through that internal table and collect all your excel data into record format.pls refer the below code.
    data:
         i_excel    type alsmex_tabline occurs 0 with header line,
         l_row      type i value 1.
    data:
         begin of x_data occurs 0,
                kunnr     like RF02L-KUNNR,
                klimk(17) type c,
                CTLPC     like knkk-CTLPC,
          end  of x_data,
          begin of x_data1 occurs 0,
                data(106),
          end   of x_data1.
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       exporting
         filename                      = p_fname
         i_begin_col                   = 1
         i_begin_row                   = 1
         i_end_col                     = no.of columns in your excel file
         i_end_row                     = no.of rows in your file
       tables
         intern                        = i_excel.
    if sy-subrc = 0.
       loop at i_excel.
         if l_row <> i_excel-row.
            append x_data.
            clear x_data.
         endif.
         case i_excel-col.
            when 1.
              x_data-kunnr = i_excel-value.
            when 2.
              x_data-klimk = i_excel-value.
            when 3.
              x_data-CTLPC = i_excel-value.
         endcase.
         l_row = i_excel-row.
         clear i_excel.
         at last.
            append x_data.
         endat.
       endloop.
    endif.
    then loop through the internal table X_DATA, pass the data to your table control like.
    tbl_control-field1(1) = x_data-field1.
    tbl_control-field2(1) = x_data-field2.
    tbl_control-fieldn(1) = x_data-fieldn.
    Regards,
    Sreeram.

  • Excel sheet upload from alv report.

    hi friends,
            we created one report which will display about sales from vender,.  we created it as hirarical alv report.  
    we all know when we downloaded the data which is shown on report to excel sheet  standard report will run. but when i saw my excel file most of rows are exported finly but some of rows are clubed into another row colum.  how it is happening. the data is passed to excel sheet  by standard report how this prablem is happening.
    plz guide me
    thanq,
    rajesh.k

    hi
    use code below to upload excel.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME                = 'exccel Worksheet.txt'
       FILETYPE                = '.XLS'
       HAS_FIELD_SEPARATOR     = '#'
       HEADER_LENGTH           = 0
       READ_BY_LINE            = 'X'
       DAT_MODE                = SPACE
       CODEPAGE                = SPACE
       IGNORE_CERR             = ABAP_TRUE
        REPLACEMENT             = '#'
       VIRUS_SCAN_PROFILE      =
    IMPORTING
       FILELENGTH              =
       HEADER                  =
    CHANGING
       DATA_TAB                = <fs_dict>
    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
       NOT_SUPPORTED_BY_GUI    = 17
       ERROR_NO_GUI            = 18
       others                  = 19
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.

  • Excel sheet upload

    Hi all
    Is it possibilityt to upload Excel sheet in enjoyable transactions like fb50,fb60&fb70. Pls.brief,if having facility.
    Is it ABAP development required?
    Best Rgds
    Suma

    HI Suma,
    U will have to do a recording of FB60/ FB70 and upload the same using LSMW or a BDC.
    Regards,
    Kiran

  • Copy ID from one library to list using sharepoint designer workflow 2013

    Hello,
    I am new In SharePoint Designer workflow.
    I want to copy ID [by default] from one SharePoint Library to SharePoint List by using SharePoint Designer workflow 2013.
    So Please provide me any solution on it.
    Thanks,
    Samadhan.

    Hi Bjorn,
    Please create a workflow based on SharePoint 2010 platform, there is OOB action "Copy List Item" which can copy attachment to another list.
    Then use "Update List Item" action to update fields value for the new item. In this action, we could use Item title to locate the newly created item. For your reference:
    However, we cannot make this workflow to start automatically. As workaround, we could use SharePoint Designer to create a Custom Action in the Source List and initiate the workflow. In my test, I created a Custom Action in the type of List Item Menu. Then
    the custom action would appear in the Item ellipsis dropdown menu:
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Access excel sheet values

    hi,
    can anyone tell
    how to access the values on the Excel Spreadsheet and store them in Java Collection?
    thanks......

    hi,
    now am not getting the 0th cell value
    my code is here
    public class POIExample {
    public static void main( String [] args ) {
    try {
                HSSFWorkbook hssfworkbook = null;
                   ArrayList stringValues = new ArrayList();
                   ArrayList numericValues = new ArrayList();
    InputStream input = POIExample.class.getResourceAsStream( "work.xls" );
    POIFSFileSystem fs = new POIFSFileSystem( input );
    HSSFWorkbook wb = new HSSFWorkbook(fs);
    HSSFSheet sheet = wb.getSheetAt(0);
    // Iterate over each row in the sheet
    Iterator rows = sheet.rowIterator();
    while( rows.hasNext() ) {
    HSSFRow row = (HSSFRow) rows.next();
    System.out.println( "Row #" + row.getRowNum() );
    // Iterate over each cell in the row and print out the cell's content
    Iterator cells = row.cellIterator();
    while( cells.hasNext() )
         HSSFCell cell = (HSSFCell) cells.next();
         System.out.println( "Cell #" + cell.getCellNum() );
         switch ( cell.getCellType() )
              case HSSFCell.CELL_TYPE_NUMERIC:
                 numericValues.add(String.valueOf(cell.getNumericCellValue()));
              //System.out.println( cell.getNumericCellValue() );
                        if(cell.getCellNum() == 2)
                                double items = cell.getNumericCellValue();
                                System.out.println("items--------->"+items);
                        else if(cell.getCellNum() == 6)
                                double priority = cell.getNumericCellValue();
                                System.out.println("priority--------->"+priority);
              break;
              case HSSFCell.CELL_TYPE_STRING:
                           stringValues.add(cell.getStringCellValue());
                        //System.out.println( cell.getStringCellValue() );
                        if(cell.getCellNum() == 0)
                                String operating_unit = cell.getStringCellValue();
                                System.out.println("operating_unit--------->"+operating_unit);
                        else if(cell.getCellNum() == 1)
                                String request_no = cell.getStringCellValue();
                                System.out.println("request_no--------->"+request_no);
                        else if(cell.getCellNum() == 3)
                                String actionof = cell.getStringCellValue();
                                System.out.println("actionof--------->"+actionof);
                        else if(cell.getCellNum() == 4)
                                String datereq = cell.getStringCellValue();
                                System.out.println("datereq--------->"+datereq);
                        else if(cell.getCellNum() == 5)
                                String datesent = cell.getStringCellValue();
                                System.out.println("datesent--------->"+datesent);
                        else if(cell.getCellNum() == 7)
                                String targetdate = cell.getStringCellValue();
                                System.out.println("targetdate--------->"+targetdate);
                        else if(cell.getCellNum() == 8)
                                String expecte = cell.getStringCellValue();
                                System.out.println("expecte--------->"+expecte);
              break;
              case HSSFCell.CELL_TYPE_BLANK:
                        System.out.println( cell.getStringCellValue() );
              break;
              default:
                        System.out.println( "unsupported sell type" );
              break;
    } catch ( IOException ex ) {
    ex.printStackTrace();
    }thanks...

  • Excel Sheet Upload: Program reads file for a long time

    Hi All,
    I'm using the function modules GUI_UPLOAD and TEXT_CONVERT_XLS_TO_SAP to upload data from an excelsheet on the presentation server into a table in SAP. The call to the TEXT_CONVERT_XLS_TO_SAP function takes too long. The task bar says "Converting Line 1" and the number continues to increase to more than 50,000 when I just end the transaction. My input file has less than 2000 rows and 8 columns. Has anyone encountered such a problem with this function module, or does anyone know what to do in such cases?
    Thanks.

    Hi,
    I wrote program using <b>FM ALSM_EXCEL_TO_INTERNAL_TABL</b>
    Have look on sample program:
    REPORT  yload_allocation_pattern                .
    TABLES : zfibnr_alloc_pat.
    TYPES t_itab1 TYPE alsmex_tabline.
    DATA: it_itab1 TYPE STANDARD TABLE OF t_itab1 WITH HEADER LINE.
    DATA :BEGIN OF it_allocation OCCURS 0,
          ibnr_aloc_patid LIKE zfibnr_alloc_pat-ibnr_aloc_patid,
          rel_loss_year LIKE zfibnr_alloc_pat-rel_loss_year,
          kind_loss LIKE zfibnr_alloc_pat-kind_loss,
          prem_alloc_pcnt LIKE zfibnr_alloc_pat-prem_alloc_pcnt,
          claim_paid_pcnt  LIKE zfibnr_alloc_pat-claim_paid_pcnt,
          claim_ostd_pcnt LIKE zfibnr_alloc_pat-claim_ostd_pcnt,
          claim_rep_pcnt LIKE  zfibnr_alloc_pat-claim_rep_pcnt,
          res_segid LIKE zfibnr_alloc_pat-res_segid,
         valid_from LIKE zfibnr_alloc_pat-valid_from,
         valid_to LIKE zfibnr_alloc_pat-valid_to,
         END OF it_allocation.
    DATA  : it_alloc_pat LIKE zfibnr_alloc_pat OCCURS 0 WITH HEADER LINE.
    DATA : wa_allocation TYPE zfibnr_alloc_pat.
    FIELD-SYMBOLS : <fs>.
    DATA : v_index TYPE i.
    S E L E C T I O N S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-012.
    *SELECTION-SCREEN SKIP 1.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT  1(18) text-013.
    *SELECTION-SCREEN POSITION 19.
    PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY, " File name
    *>>Insertion by Chetan --Row and Column in Excel.
               p_row type I default 1000,
               p_col type I default 50.
    *<< end of Insertion.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    A T S E L E C T I O N S C R E E N
    AT SELECTION-SCREEN.
      IF NOT p_file IS INITIAL.
    **-----validating the file path & file name
       PERFORM VALID_FILE USING P_PC_CHK P_FILE.
      ENDIF.
    *----Gettting the local file with f4 button
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_local_file_name USING p_file.
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_file
          i_begin_col             = 1
          i_begin_row             = 1
          i_end_col               = p_col
          i_end_row               = p_row
        TABLES
          intern                  = it_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.
      IF it_itab1[] IS INITIAL.
        MESSAGE s003(zz) WITH 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT it_itab1 BY row col.
        LOOP AT it_itab1.
          MOVE : it_itab1-col TO v_index.
          ASSIGN COMPONENT v_index OF STRUCTURE it_allocation TO  <fs>.
          MOVE : it_itab1-value TO <fs>.
          AT END OF row.
            it_alloc_pat-entry_date = sy-datum.
            MOVE-CORRESPONDING it_allocation TO it_alloc_pat.
            APPEND it_alloc_pat.
            CLEAR it_alloc_pat.
            CLEAR  it_allocation.
          ENDAT.
        ENDLOOP.
      ENDIF.
      LOOP AT it_alloc_pat INTO wa_allocation.
        MODIFY zfibnr_alloc_pat FROM  wa_allocation.
        CLEAR wa_allocation.
      ENDLOOP.
    *&      Form  GET_LOCAL_FILE_NAME
          text
         -->P_P_FILE  text
    FORM get_local_file_name  USING    p_p_file.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          file_name = p_file.
      IF sy-subrc <> 0.
        MESSAGE i000(zmur) WITH  'Error in getting filename'(014).
        STOP.
      ENDIF.
    ENDFORM.                    " GET_LOCAL_FILE_NAME
    Thanks,
    Pramod

  • How to open and read Excel Sheet from SharePoint 2013 Document Library using C# Visual Studio 2012

    Hi,
    To achieve these are the steps that I had followed :
    1. Add the document Library path into Central Admin -> Application Mgmt -> Manage Service App -> Excel Service App -> Trusted File Locations
    2. Add Documnet Library link to Trusted Connection Proivder
    3. Open Visual Studio as Run as Administrator
    4.Create an SharePoint 2013 Empty Project.
    5.Add Service Reference : http:\\<server>\_vti_bin/excelservice.asmx
    6.Service added successfully
    7.Create a class file and add the Service Reference namespace
    There is no such class as ExcelService to call. 
    Please let me know if somebody knows how to open the Excel file into C#(2012)  either using ExcelService or any other way to open. I tried old methods of Sharepoint 2010 server but it's not able to access classes.
    Requirement is :
    Need to read the excel sheet  from Document Library and transfer all data into DataTable.
    Please help asap. 

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, I'll move your question to the SharePoint 2013 development forum
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/home?forum=sharepointdevelopment
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • How to consume the sharepoint online Library data to Excel sheet using ODATA connection. That ODATA connection file resides in "SharePoint Online -Data Connections Library"

    I have created a OData Connection to my Library and published to SharePoint online site.
    To refresh the data, property is set like "Refresh when opening file"
    When I downloaded and open the file, the new data is consumed to me successfully because this ODF file referenced to my local computer
    If any other user downloads the file its not opening as reference file points to my local machine.
    I want to keep this ODF file in "Data connections" Library (or in any site/Library) and establish the connection to the excel sheet. so that any one can use the ODF file.
    or else any other alternative to use ODF file globally and get the SP Library data to excel ?

    Hi,
    it will use the connection in the ADF library. I recommend though that you not save database connect information in the ADF library. Instead:
    - define the ADF BC model to use JDBC data sources
    - In the ADF library, configure it to only contain the data source name
    - In the view project (the workspace) configure the database connection exposed by the library
    When the library is imported, check Application Resources --> Connections and right click on the imported connection name to configure it
    Frank

  • 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

  • Problems in uploading from excel sheet to internal table

    hi experts,
    i got one problem regarding uploading data from excel sheet to int.table. I used FM ALSM_EXCEL_TO_INTERNAL_TABLE but in that the value is char of 50. but i need a case where i have to send value more than 50 characters. please suggest me any other FM to overcome this problem.
    advanced thanks
    vijay

    Hi,
    >
    Vijay Krishna Arvapalli wrote:
    > hi tarun,
    >
    > thank you for your reply
    >
    > but when i tried to use FM TEXT_CONVERT_XLS_TO_SAP it is giving error actually that 'Error generating the test frame'.
    >
    > so can you suggest me with some other option where i can upload the field with more than 50 character length.
    >
    > thank you
    > regards
    > vijay
    Yes, when you execute the FM from SE37, then it displays a message.
    Just copy the below code and paste it in a report (SE38) and execute.
    Create a file in C:/ with name test.xls and execute it will display the records even with more than 50 characters of length.
    I have tested and its working.
    I have taken three fields in the excel file empid, name and doj.
    TYPE-POOLS : truxs.
    PARAMETERS : p_file TYPE rlgrap-filename DEFAULT 'C:\TEST.XLS'.
    DATA : BEGIN OF itab OCCURS 0,
             empid(150) TYPE c,
             name(150) TYPE c,
             doj(150) TYPE c,
           END OF itab.
    DATA: it_raw TYPE truxs_t_text_data.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM f4_file_process USING p_file.
    AT SELECTION-SCREEN.
      PERFORM validate_file_path USING p_file.
    START-OF-SELECTION.
      PERFORM upload_data.
    END-OF-SELECTION.
      PERFORM display_data.
    *&      Form  F4_FILE_PROCESS
    *       text
    *      -->P_FILE_PATH  text
    FORM f4_file_process USING p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
      IF sy-subrc NE 0.
        MESSAGE e000(zsd).
      ENDIF.
    ENDFORM.                    " F4_FILE_PROCESS
    *&      Form  VALIDATE_FILE_PATH
    *       text
    *      -->P_FILE  text
    FORM validate_file_path USING p_file.
      DATA : lv_dir TYPE string,
             lv_file TYPE string,
             lv_result(1) TYPE c.
      DATA : lv_filename TYPE string.
      lv_filename = p_file.
      CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
        EXPORTING
          full_name     = p_file
        IMPORTING
          stripped_name = lv_file
          file_path     = lv_dir
        EXCEPTIONS
          x_error       = 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.
      CALL METHOD cl_gui_frontend_services=>directory_exist
        EXPORTING
          directory            = lv_dir
        RECEIVING
          result               = lv_result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF lv_result IS INITIAL.
        MESSAGE 'Invalid Directory' TYPE 'E'.
      ENDIF.
      CLEAR lv_result.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = lv_filename
        RECEIVING
          result               = lv_result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF lv_result IS INITIAL.
        MESSAGE 'Invalid File' TYPE 'E'.
      ENDIF.
    ENDFORM.                    " VALIDATE_FILE_PATH
    *&      Form  UPLOAD_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM upload_data .
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator    = 'X'
          i_line_header        = 'X'
          i_tab_raw_data       = it_raw
          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.
    ENDFORM.                    " UPLOAD_DATA
    *&      Form  DISPLAY_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_data .
      LOOP AT itab.
        WRITE : / itab-empid, itab-name, itab-doj.
      ENDLOOP.
    ENDFORM.                    " DISPLAY_DATA
    Hope this helps you.
    Regards,
    Tarun

  • Non-English string access from excel sheet through JDBC

    My excel sheet data is
    Test ������������
    I am using JDBC connectivity for accessing the Excel sheet.
    Code looks like,
    List Output = new List();
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    c = DriverManager.getConnection( "jdbc:odbc:qa-list", "", "" );
    stmnt = c.createStatement();
    ResultSet rs = stmnt.executeQuery("select * from [Sheet1$];");
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    for(int i=1; i <= numberOfColumns; i++){
    Output.add(rsmd.getColumnLabel(i));
    catch( Exception e )
    System.err.println( e );
    finally
    try
    stmnt.close();
    c.close();
    catch( Exception e )
    System.err.println( e );
    Now. I am showing those data into the table(JTable) Applet programming.
    For, English string it is showing properly but, for non-English string are showing �???????????????????�
    I would like to know what could be the reason.
    Addional info:
    ava version "1.6.0_01"
    Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
    Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
    If possible please send some reference code .

    I have one excel sheet which having differenct countries specific meaining of common words.
    I am using JDBC connectivity for accessing that Excel sheet.
    Code looks like,
    List Output = new List();
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    c = DriverManager.getConnection( "jdbc:odbc:qa-list", "", "" );
    stmnt = c.createStatement();
    ResultSet rs = stmnt.executeQuery("select * from [Sheet1$];");
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    for(int i=1; i <= numberOfColumns; i++){
    Output.add(rsmd.getColumnLabel(i));
    catch( Exception e ){
    System.err.println( e );
    finally{
    try{
    stmnt.close();
    c.close();
    catch( Exception e ){
    System.err.println( e );
    Now. I am showing those output data into the table(JTable) in my Applet programming.
    For, English string it is showing properly but, for non-English strings are showing question marks like, �?????�
    I would like to know what could be the reason.
    Please help me, i am stuck in my project.

Maybe you are looking for

  • IPod won't sync to iTunes, hangs and freezes

    Part of the way through autosyncing my songs to the iPod, the process appears to freeze, and iTunes will not respond. It doesn't seem to be any particular song, as it's happened on at least three songs at separate times. All of the songs play in iTun

  • When I created rectangle to pinned but pin is not coming up in adobe muse

    HI. When I create rectangle and want to pin it (stay on) the pin is not come up

  • Problems with the Built in Camera - Help!

    Dear Comunity, In my Mac Book, when I turn on the built In camera, I get 4 horizontal red lines in the midle of the screen. i have the standard version of Leopard. Is there something I can do to change this? Thank you very much for your help

  • What did we do to tick off Verizon? Why is Yarnell's service so poor?

    The call quality of many and sometimes most of our local calls (within Yarnell, AZ 85362) is so poor that it is impossible to hold a conversation with anyone. For instance, the person at the other end might hear us OK but we're not hearing many or mo

  • Bluetooth disconnecting

    I have a Nokia 9300. When I connect it to my IBM Thinkpad via bluetooth, using the Nokia PC suite, it will disconect again after about a minute. Also I cannot get it to automatically reconnect. Has anybody got some advise please.