Upload Excel File to SharePoint using VBA

Hi,
I copied and modified the code from a friend which he got it from this website forum.
This apprantely works for some people and not me. Please tell me what I am doing wrong.
Ignore xxxxxx part of the Sharepoint site. Nothing wrong with the site, i tried many combinations, but I get not response, not even an error.
Public Const HR_URL = "http://sun.xxxxxx.com/eng/st/Lists/Database%20Change% 20Request"
Sub test()
'Upload new Excel sheet to SharePoint
Call copyToSharePoint(HR_URL, ThisWorkbook.FullName)
End Sub
'''''''code block from Forum
Public Sub copyToSharePoint(sharepointURL As String, filePath As String)
'On Error GoTo errhandler
'sharePointUrl should not end in a "/"
'Initialize Variables
Dim LlFileLength As Long
Dim Lvarbin() As Byte
Dim LobjXML As Object
Dim LvarBinData As Variant
Dim LstrFileName As String, PstrFullfileName As String, PstrTargetURL As String
Dim fileName As String, lenFileName As Long
'Extract file name
lenFileName = Len(filePath) - InStrRev(filePath, "\")
fileName = Right(filePath, lenFileName)
'Check that the webUrl ends in an "/"
If Right(sharepointURL, 1) <> "/" Then
sharepointURL = sharepointURL & "/"
End If
'**************************** Upload binary files *****************
Set LobjXML = CreateObject("Microsoft.XMLHTTP")
PstrFullfileName = filePath
LlFileLength = FileLen(PstrFullfileName) - 1
' Read the file into a byte array.
ReDim Lvarbin(LlFileLength)
Open PstrFullfileName For Binary As #1
Get #1, , Lvarbin
Close #1
' Convert to variant to PUT.
LvarBinData = Lvarbin
PstrTargetURL = sharepointURL & fileName
' Put the data to the server; false means synchronous.
LobjXML.Open "PUT", PstrTargetURL, False
' Send the file in.
LobjXML.Send LvarBinData
Set LobjXML = Nothing
Exit Sub
errhandler:
If Err.Number = 53 Then
MsgBox "Excel was unable to create the HR file to submit to SharePoint. " & vbNewLine & _
"Please check that you are not running out of disk space and that no MS Office add-in is causing issues with Excel.", vbCritical, "File Error"
Exit Sub
Else
MsgBox "Your HR could not be submitted to SharePoint. The following error occurred:" & vbNewLine & _
"Error " & Err.Number & ": " & Err.Description, vbCritical, "Error Uploading to SharePoint"
Exit Sub
End If
End Sub

I have made the following code work successfully on a Windows 8 machine with the VBA executing from an Excel 2010 file and the file you want to upload going to a SharePoint 2010 site. If you don't need to use SP content types then simply
take that out of the code. Also, pay attention to the FieldInformation as the Field Display names and Field Internal names can sometimes be different. Cheers.
Public Sub copyDocToSP()
Const strLocalFile = "C:\temp\myLocalFile.pdf"
Const spBASE_URL = "https://thesharepointdomian/sites/yoursite/"
Const spDOC_LIB = "Your SP Doc Library Name"
Const spFILE_NAME = "FileNameOnceOnSharepoint.pdf"
Const spCONTENT_TYPE = "0x000000000000000000000000000000000000000"
Set ObjectStream = CreateObject("ADODB.Stream")
Set ObjectDOM = CreateObject("Microsoft.XMLDOM")
Set ObjectElement = ObjectDOM.createElement("TMP")
Set ObjectHTTP = CreateObject("Microsoft.XMLHTTP")
'Reading binary file
ObjectStream.Open
ObjectStream.Type = 1 'Type Binary
ObjectStream.LoadFromFile (strLocalFile)
BinaryFile = ObjectStream.Read()
ObjectStream.Close
'Conversion Base64
ObjectElement.DataType = "bin.base64" 'Type Base64
ObjectElement.nodeTypedValue = BinaryFile
EncodedFile = ObjectElement.Text
'Build request to load document
strURLService = spBASE_URL + "_vti_bin/copy.asmx"
strSOAPAction = "http://schemas.microsoft.com/sharepoint/soap/CopyIntoItems"
strSOAPCommand = "<?xml version='1.0' encoding='utf-8'?>" & _
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" & _
"<soap:Body>" & _
"<CopyIntoItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>" & _
"<SourceUrl>" + strLocalFile + "</SourceUrl>" & _
"<DestinationUrls>" & _
"<string>" + spBASE_URL + spDOC_LIB + "/" + spFILE_NAME + "</string>" & _
"</DestinationUrls>" & _
"<Fields>" & _
"<FieldInformation Type='Text' InternalName='Title' DisplayName='Title' Value='this is the title value' />" & _
"<FieldInformation Type='Choice' InternalName='Our_x0020_Status' DisplayName='Our Document Status' Value='Ready-to-distribute' />" & _
"<FieldInformation Type='Text' InternalName='ContentTypeId' DisplayName='Content Type ID' Value='" + spCONTENT_TYPE + "' />" & _
"</Fields>" & _
"<Stream>" + EncodedFile + "</Stream>" & _
"</CopyIntoItems>" & _
"</soap:Body>" & _
"</soap:Envelope>"
ObjectHTTP.Open "Get", strURLService, False
ObjectHTTP.SetRequestHeader "Content-Type", "text/xml; charset=utf-8"
ObjectHTTP.SetRequestHeader "SOAPAction", strSOAPAction
ObjectHTTP.Send strSOAPCommand
MsgBox (ObjectHTTP.responseText)
End Sub

Similar Messages

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • Uploading Excel file to SAP

    Hi Friends,
    Iam trying to Upload Excel file into SAP using the FM
    ALSM_EXCEL_TO_INTERNAL_TABLE. But it is going to dump n the error is                                                                             
    The call to the function module "ALSM_EXCEL_TO_INTERNAL_TABLE" is incorrect:                                                                               
    In the function module interface, you can specify only                          
    fields of a specific type and length under "INTERN".                            
    Although the currently specified field                                          
    "ITAB" is the correct type, its length is incorrect.                            
    I have attached the code also.
    Please let me know where iam getting the error.
    Code :
    Tables : mara,
             ztable.
    parameters : p_infile like rlgrap-filename.
    data : begin of itab occurs 0,
           matnr like mara-matnr,
           mbrsh like mara-mbrsh,
           matkl like mara-matkl,
           end of itab.
           CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
             EXPORTING
               FILENAME                      = p_infile
               I_BEGIN_COL                   = 1
               I_BEGIN_ROW                   = 1
               I_END_COL                     = 100
               I_END_ROW                     = 100
             TABLES
               INTERN                        = itab
           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 itab by matnr.
    loop at itab.
    write:/ itab.
    *modify ztable from table itab.
    endloop.

    hi check this code:
    DATA : BEGIN OF TYP_INPUT ,
               MATNR LIKE MARA-MATNR,
               WERKS LIKE MARC-WERKS,
               LGORT LIKE MARD-LGORT,
               LGNUM LIKE MLGN-LGNUM,
               LGTYP LIKE MLGT-LGTYP,
               LTKZA LIKE MLGN-LTKZA,
               LTKZE LIKE MLGN-LTKZE,
               LGBKZ LIKE MLGN-LGBKZ,
               LGPLA LIKE MLGT-LGPLA,
            END OF TYP_INPUT.
    *Input File Data
    DATA : IT_FILE LIKE TYP_INPUT OCCURS 0 WITH HEADER LINE.
    *"INTERNAL TAB TO TAKE EXCEL SHEET.
    DATA : IT_EXCEL    LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
           CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
            EXPORTING
                 FILENAME                = P_PFILE
                 I_BEGIN_COL             = 1
                 I_BEGIN_ROW             = 2
                 I_END_COL               = 9
                 I_END_ROW               = 6000
            TABLES
                 INTERN                  = IT_EXCEL
            EXCEPTIONS
                 INCONSISTENT_PARAMETERS = 1
                 UPLOAD_OLE              = 2
                 OTHERS                  = 3.
    * IT_EXCEL CONTAINS DATA IN THE FORM OF ROW, COL, VALUE       *
    * CONVERTING THAT INTERNAL TABLE TO FORMAT THAT OF EXCEL SHEET *
       IF NOT IT_EXCEL[] IS INITIAL.
         SORT IT_EXCEL BY ROW COL.
         LOOP AT IT_EXCEL.
           CASE IT_EXCEL-COL.
            WHEN 1.
                  IT_FILE-MATNR = IT_EXCEL-VALUE.
            WHEN 2.
                  IT_FILE-WERKS = IT_EXCEL-VALUE.
            WHEN 3.
                  IT_FILE-LGORT = IT_EXCEL-VALUE.
            WHEN 4.
                  IT_FILE-LGNUM = IT_EXCEL-VALUE.
            WHEN 5.
                  IT_FILE-LGTYP = IT_EXCEL-VALUE.
            WHEN 6.
                  IT_FILE-LTKZA = IT_EXCEL-VALUE.
            WHEN 7.
                  IT_FILE-LTKZE = IT_EXCEL-VALUE.
            WHEN 8.
                  IT_FILE-LGBKZ = IT_EXCEL-VALUE.
            WHEN 9.
                  IT_FILE-LGPLA = IT_EXCEL-VALUE.
           ENDCASE.
           AT END OF ROW.
             APPEND IT_FILE.
             CLEAR IT_FILE.
           ENDAT.
         ENDLOOP.
       ELSE.
         MESSAGE I000  WITH 'The input file is empty'.
         STOP.
       ENDIF.

  • Error Raised while uploading Excel file to SAP

    Hi All,
    I am getting error while uploading excel file into SAP using the function module 'TEXT_CONVERT_XLS_TO_SAP'.
    Error Message is UX(893) -  'Excel file & cannot be processed' .
    Please let me know what went wrong.
    Regards,
    Deepthi

    Hi,
    1 .TEXT_CONVERT_XLS_TO_SAP  Funtion module will work if you have installed Microsoft Excel at front end.
    2. Whenyou declare internal table for upload, specify the char only in the strcture ,don't specify any data element or dictionary reference.    If the data element and dictionaly reference is character field then its ok.
    eg.
    types:begin of st_data,
               field1 type char15,
               field2 type char23,
              endif.
    3. Close the excel before you upload
    Hope this might solve your issue.
    Regards
    Aromal R

  • Download all excel files from sharepoint location to local folder

    Hi,
    How to I copy all excel files stored at sharepoint location to local folder?
    Regards,
    Nidhi

    Hi NidhiP,
    To download Excel files from a SharePoint library by using SSIS, we need to make use of the Script Task. In the Script Task, we can use the methods provided by
    Lists Web Service to work with SharePoint files, and then use the
    WebClient.DownloadFile Method or
    FileStream Class to transfer the files from SharePoint to local file system.
    For the code examples, please refer to:
    http://www.codeproject.com/Questions/457161/how-to-download-files-from-Sharepoint-document-lib?tab=mostrecent 
    http://blogs.msdn.com/b/sowmyancs/archive/2007/09/15/how-to-download-files-from-a-sharepoint-document-library-remotely-via-lists-asmx-webservice-sps-2003-moss-2007.aspx 
    http://sqlblogcasts.com/blogs/drjohn/archive/2007/11/04/downloading-excel-files-from-sharepoint-using-ssis.aspx 
    Regards,
    Mike Yin
    TechNet Community Support

  • 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

  • SharePoint 2013 Foundation error when uploading Excel files

    Hello 
    I have a specific problem. I have an xlsx file that I cannot upload in SharePoint. Normally our SharePoint can upload Excel files and other file formats normally but this one has data with nearly 5000 rows. The size of the file is less then 500 KB. The error
    message is: "The URL is invalid. Perhaps it refers to a nonexistent file or folder, or it refers to a valid file or folder in the current Web." When I am uploading this file I am getting the same error message in every library. When I save
    the file as a 97-2003 compatible xls then it works. Sometimes even Excel files with Macros won't upload. 
    Kind regards
    ivicapro1987

    Hi,
    This issue occurs when the Version column is configured as an Indexed Column. 
    To work around this issue, remove the Version column from the list of Indexed Columns for the list that has this issue. To do this, follow these steps:
    Browse to the list where the issue exists.
    In the ribbon, click the Library tab, and then click
    Library Settings.
    In the fields list, click Indexed Columns.
    In the Indexed Columns list, click Version.
    Click Delete, and then click OK.
    Upload any files that you previously experienced the issue with.
    Reference:
    https://support.microsoft.com/kb/2796640?wa=wsignin1.0
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to upload excel file in Webdynpro application using ABAP

    Hi Experts,
    Am developing a webdynpro application in which it will take an excel file as input and display the contents in the form of a table in output. I am able to upload tab delimited text file and populate the table using the below code but not able to do the same with .xls file. Pls let me know if I need to use a different function module for upload excel file.
    get single attribute
      wd_context->get_attribute(
        EXPORTING
          name =  `DATASOURCE`
        IMPORTING
          value = l_xstring ).
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          in_xstring = l_xstring
        IMPORTING
          out_string = l_string.
      SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
    Bind With table Element.
      LOOP AT i_data INTO l_string.
        SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
        READ TABLE fields INTO lv_field INDEX 1.
        fs_table-name = lv_field.
        READ TABLE fields INTO lv_field INDEX 2.
        fs_table-age = lv_field.
        APPEND fs_table TO t_table1.
      ENDLOOP.
    lo_nd_data = wd_context->get_child_node( 'DATA_TAB' ).
    lo_nd_data->bind_table( T_TABLE1 ).
    Thanks,
    Subathra

    Dear Exports
    Can anyone guide me how to uplode the .xlsx or ..xls formatted excel file using abap webdynpro without converting it to .txt file. Because my client requirement is only to upload the excel file. because to convert the .xlsx flie to .txt file it will be time taking and cost expanssive. Another requirement is suppose today i have create a application for uploading a file which has 8 columns and 10 rows. suppose tomorrow the client will make some changes in that flat file means the client will add 2 extra columns and 10 more columns in that fil. and will upload that file. Then the new file will be display on the browser or old file. but my requirement is to display the new file in browser.
    Can anyone kindly help to solve my problem. I am completely fresher in this field and I need to do it as soon as possible. Please help to solve the problem. 
    Regards
    Rashmita

  • Uploading Excel file  using 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    Hi,
    I am uploading excel file into an internal table using 'ALSM_EXCEL_TO_INTERNAL_TABLE' FM.
    but I'm getting a popup with the message
    'There is a large amount of the information on the clipboard. Do you want to be able to paste this information into another programme later.' and there are three buttons in the popup 'YES', 'CANCEL' and 'NO'. but for any choice there is no data in the internal table. 
    the progrsm is working in other systems but giving problem in customer laptop, can you please tell me is there any settings need to set for EXCEL or SAP.
    system details are as below
    OS: windows 7
    MS-Office - 2007
    SAP : ECC06

    Looks like there was an intention to clear the clipboard in the code, but this does not seem to work.
    I copied the function module to my own version and added the following code, which seems to work :
    * clear clipboard
      refresh excel_tab.
      call method cl_gui_frontend_services=>clipboard_export
         importing
            data                 = excel_tab
         changing
            rc                   = ld_rc
         exceptions
            cntl_error           = 1
    *       ERROR_NO_GUI         = 2
    *       NOT_SUPPORTED_BY_GUI = 3
            others               = 4
    * Copy only one cell to prevent the clipboard data message.
      call method of worksheet 'Cells' = h_cell
          exporting #1 = 1 #2 = 1.
      m_message.
      call method of worksheet 'Cells' = h_cell1
          exporting #1 = 1 #2 = 1.
      m_message.
      call method  of worksheet 'RANGE' = range
                     exporting #1 = h_cell #2 = h_cell1.
      m_message.
      call method of range 'SELECT'.
      m_message.
    * copy marked area (whole spread sheet) into Clippboard
      call method of range 'COPY'.
      m_message.
    * quit Excel and free ABAP Object - unfortunately, this does not kill
    * the Excel process
      call method of application 'QUIT'.
      m_message.

  • Can 'GUI_UPLOAD'  to be used to upload excel file lonely?

    Hi experts,
    I wonder that can 'GUI_UPLOAD'  to be used to upload excel file lonely. I tried and use 'asc' as the L_FILETYPE, but the data uploaded contain many '###yyy'. But if I save the excel file as a txt file,
    the data can be uploaded by 'GUI_UPLOAD' correctly. So what is the problem?

    Excel files be can't uploaded using "GUI_UPLOAD".
    Use the FM "ALSM_EXCEL_TO_INTERNAL_TABLE"
    Try this code:
    * Upload data direct from excel.xls file to SAP
    REPORT ZEXCELUPLOAD.
    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
                begcol TYPE i DEFAULT 1 NO-DISPLAY,
                begrow TYPE i DEFAULT 1 NO-DISPLAY,
                endcol TYPE i DEFAULT 100 NO-DISPLAY,
                endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    * Tick don't append header
    PARAMETERS: kzheader AS CHECKBOX.
    DATA: BEGIN OF intern OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern.
    DATA: BEGIN OF intern1 OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern1.
    DATA: BEGIN OF t_col OCCURS 0,
           col LIKE alsmex_tabline-col,
           size TYPE i.
    DATA: END OF t_col.
    DATA: zwlen TYPE i,
          zwlines TYPE i.
    DATA: BEGIN OF fieldnames OCCURS 3,
            title(60),
            table(6),
            field(10),
            kz(1),
          END OF fieldnames.
    * No of columns
    DATA: BEGIN OF data_tab OCCURS 0,
           value_0001(50),
           value_0002(50),
           value_0003(50),
           value_0004(50),
           value_0005(50),
           value_0006(50),
           value_0007(50),
           value_0008(50),
           value_0009(50),
           value_0010(50),
           value_0011(50),
           value_0012(50),
           value_0013(50),
           value_0014(50),
           value_0015(50),
           value_0016(50),
           value_0017(50),
           value_0018(50),
           value_0019(50),
           value_0020(50),
           value_0021(50),
           value_0022(50),
           value_0023(50),
           value_0024(50),
           value_0025(50),
           value_0026(50),
           value_0027(50),
           value_0028(50),
           value_0029(50),
           value_0030(50),
           value_0031(50),
           value_0032(50),
           value_0033(50),
           value_0034(50),
           value_0035(50),
           value_0036(50),
           value_0037(50),
           value_0038(50),
           value_0039(50),
           value_0040(50),
           value_0041(50),
           value_0042(50),
           value_0043(50),
           value_0044(50),
           value_0045(50),
           value_0046(50),
           value_0047(50),
           value_0048(50),
           value_0049(50),
           value_0050(50),
           value_0051(50),
           value_0052(50),
           value_0053(50),
           value_0054(50),
           value_0055(50),
           value_0056(50),
           value_0057(50),
           value_0058(50),
           value_0059(50),
           value_0060(50),
           value_0061(50),
           value_0062(50),
           value_0063(50),
           value_0064(50),
           value_0065(50),
           value_0066(50),
           value_0067(50),
           value_0068(50),
           value_0069(50),
           value_0070(50),
           value_0071(50),
           value_0072(50),
           value_0073(50),
           value_0074(50),
           value_0075(50),
           value_0076(50),
           value_0077(50),
           value_0078(50),
           value_0079(50),
           value_0080(50),
           value_0081(50),
           value_0082(50),
           value_0083(50),
           value_0084(50),
           value_0085(50),
           value_0086(50),
           value_0087(50),
           value_0088(50),
           value_0089(50),
           value_0090(50),
           value_0091(50),
           value_0092(50),
           value_0093(50),
           value_0094(50),
           value_0095(50),
           value_0096(50),
           value_0097(50),
           value_0098(50),
           value_0099(50),
           value_0100(50).
    DATA: END OF data_tab.
    DATA: tind(4) TYPE n.
    DATA: zwfeld(19).
    FIELD-SYMBOLS: <fs1>.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                mask      = '*.xls'
                static    = 'X'
           CHANGING
                file_name = filename.
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = filename
                i_begin_col             = begcol
                i_begin_row             = begrow
                i_end_col               = endcol
                i_end_row               = endrow
           TABLES
                intern                  = intern
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE:/ 'Upload Error ', SY-SUBRC.
      ENDIF.
    END-OF-SELECTION.
      LOOP AT intern.
        intern1 = intern.
        CLEAR intern1-row.
        APPEND intern1.
      ENDLOOP.
      SORT intern1 BY col.
      LOOP AT intern1.
        AT NEW col.
          t_col-col = intern1-col.
          APPEND t_col.
        ENDAT.
        zwlen = strlen( intern1-value ).
        READ TABLE t_col WITH KEY col = intern1-col.
        IF sy-subrc EQ 0.
          IF zwlen > t_col-size.
            t_col-size = zwlen.
    *                          Internal Table, Current Row Index
            MODIFY t_col INDEX sy-tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.
      DESCRIBE TABLE t_col LINES zwlines.
      SORT intern BY row col.
      IF kzheader = 'X'.
        LOOP AT intern.
          fieldnames-title = intern-value.
          APPEND fieldnames.
          AT END OF row.
            EXIT.
          ENDAT.
        ENDLOOP.
      ELSE.
        DO zwlines TIMES.
          WRITE sy-index TO fieldnames-title.
          APPEND fieldnames.
        ENDDO.
      ENDIF.
      SORT intern BY row col.
      LOOP AT intern.
        IF kzheader = 'X'
        AND intern-row = 1.
          CONTINUE.
        ENDIF.
        tind = intern-col.
        CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
        ASSIGN (zwfeld) TO <fs1>.
        <fs1> = intern-value.
        AT END OF row.
          APPEND data_tab.
          CLEAR data_tab.
        ENDAT.
      ENDLOOP.
      CALL FUNCTION 'DISPLAY_BASIC_LIST'
           EXPORTING
                file_name     = filename
           TABLES
                data_tab      = data_tab
                fieldname_tab = fieldnames.
    *-- End of Program

  • Help Required:How Upload Excel file Into Oracle Table Using PLSQL Procedure

    Please Help , Urgent Help Needed.
    Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
    Case's are :
    1. Excel File is On Users/ Client PC.
    2. Application is on Remote Server(Oracle Forms D2k).
    3. User Is Using Application Using Terminal Server LogIn.
    4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
    5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
    6. we are Using Oracle 8.7
    So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
    Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
    Jus help to Sort This Issue ........
    you can also write me on :
    [email protected], [email protected]

    TEXT_IO is a PL/SQL package available only in Forms (you'll want to post in the Forms forum for more information). It is not available in a stored procedure in the database (where the equivalent package is UTL_FILE).
    If the Terminal Server machine and the database machine do not have access to the file system on the client machine, no application running on either machine will have access to the file. Barring exceptional setups (like the FTP server on the client machine), your applications are not going to have more access to the client machine than the operating system does.
    If you map the client drives from the Terminal Server box, there is the potential for your Forms application to access those files. If you want the files to be accessible to a stored procedure in the database, you'll need to move the files somewhere the database can access them.
    Justin

  • Problem in Uploading excel file using WebDynpro for Java

    Hi  All
    I have followed for Uploading excel file using WebDynpro for Java added by  Tulasi Palnati
    I done all, but I'm getting 500 Exception please contact u r system admin meag  at run time also  Jxl/Workbook class not found msag  but i downloaded Jxl.jar file and  there is no error signals  in coding part. How can I solve the Problem.
    Thanks
    Polaka

    Please ask the people in the Web Dynpro Java forum for a solution.

  • Getting error while uploading multiple files in sharepoint hosted app in 2013 with REST API

    Hi All,
    In one of my tasks, I was struck with one issue, that is "While uploading multiple files into custom list with REST API".
    Iam trying to upload multiple files in library with REST calls for an APP development, my issue is if i wants to upload 4 image at once its storing only
    3 image file and further giving "Conflict" error". Below is the attached screenshot of exact error.
    Error within screenshot are : status Code : 409
    status Text :conflict
    For this operation i am uploading different files as an attachment to an list item, below is the code used for uploading multiple files.
    my code is
    function PerformUpload(listName, fileName, listItem, fileData)
        var urlOfAttachment="";
       // var itemId = listItem.get_id();
        urlOfAttachment = appWebUrl + "/_api/web/lists/GetByTitle('" + listName + "')/items(" + listItem + ")/AttachmentFiles/add(FileName='" + fileName + "')"
        // use the request executor (cross domain library) to perform the upload
        var reqExecutor = new SP.RequestExecutor(appWebUrl);
        reqExecutor.executeAsync({
            url: urlOfAttachment,
            method: "POST",
            headers: {
                "Accept": "application/json; odata=verbose",
                "X-RequestDigest": digest              
            contentType: "application/json;odata=verbose",
            binaryStringRequestBody: true,
            body: fileData,
            success: function (x, y, z) {
                alert("Success!");
            error: function (x, y, z) {
                alert(z);

    Hi,
    THis is common issue if your file size exceeds 
     upload a document of size more than 1mb. worksss well for kb files.
    https://social.technet.microsoft.com/Forums/office/en-US/b888ac78-eb4e-4653-b69d-1917c84cc777/getting-error-while-uploading-multiple-files-in-sharepoint-hosted-app-in-2013-with-rest-api?forum=sharepointdevelopment
    or try the below method
    https://social.technet.microsoft.com/Forums/office/en-US/40b0cb04-1fbb-4639-96f3-a95fe3bdbd78/upload-files-using-rest-api-in-sharepoint-2013?forum=sharepointdevelopment
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Upload excel file in SAP BI-7.0

    Hi ,
    i  need to  upload an excel  file in SAP BI 7.0 where the standard r/3 fm are not available.
    Currently we uploading a file in CSV format but now we want to upload using XLS also.
    ia way to upload excel  file in SAP BI 7.0
    Best Regards,
    Sharad
    Edited by: sharad narayan on Jan 7, 2011 10:58 AM
    while searching the forum i  found the fm MS_EXCEL_OLE_STANDARD_DAT .
    but while using this FM i  am getting the exception file not exist.
    Kindlu  suggest what  to  do
    i  even tried the FM TMP_GUI_GET_FILE_EXIST' to  check  the existence of the file.
    even then same problem.
    Please suggest
    Edited by: sharad narayan on Jan 10, 2011 2:51 PM

    Hi,
    Scheduled jobs are the jobs for which we have scheduled for a time, may be daily so that each day the scheduled jobs will trigger at the time given.So that every time u need not to trigger the job manully urself as the schedule time will hit the job will trigger itself.
    Released job means the job which is in between Sheduled state and active state.say For eg: 10 jobs are Scheduled in a queue Job no 1 is released from the queue that means any moment it will be in active state.So it is the state between Schedule and Active state of a job.
    Thanks
    Varun

  • Upload Excel Files to ITable

    Hi... maybe someone of you have been reading about how to upload excel files to an internal table using function module ALSM_EXCEL_TO_INTERNAL_TABLE.
    The problem that I found with this technique is that it is not possible to use this FM with the SAP WAS because it gives a runtime dump (it only works if the file is on the client machine and if the function module is called from SAPGUI.
    Then I have found the topic
    Re: BSP and Excel
    And one guy puts something interesting like this:
    1. In the application use file upload to upload the file.
    2. caputure the content and length
    DATA: data TYPE REF TO CL_HTMLB_FILEUPLOAD.
    data ?= CL_HTMLB_MANAGER=>GET_DATA(
    request = runtime->server->request
    name = 'fileUpload'
    id = 'xx').
    name = data->file_name.
    content = data->file_content.
    length = data->file_length.
    content_type = data->file_content_type.
    3. Then read the data using the class
    DATA: conv TYPE REF TO CL_ABAP_CONV_IN_CE.
    conv = CL_ABAP_CONV_IN_CE=>CREATE( input = CONTENT ).
    conv->READ( importing data = Variable len = length ).
    Now... has anyone continued with this sample? has anyone put the contents into an internal table (with the READ method)...
    If someone did it please show me how to..
    Thanks
    Ariel

    Hi Craig,
    Ok, I was reading the Thomas's Blog and the thread about excel. The blog talks about encoding and the thread is about how to "download" the table. I want to upload the excel to an internal table.
    So, I am almost finishing the code.. But I have a problem (named DUMP) when I create the "conv" object (check the code) the problem is because I dont know how to call the create method indicating 'UFT-16' as encoding.
    I show you my "OnInputProcessing" code:
    IF button_event->id = 'btnUpload'.
      fileUpload ?= CL_HTMLB_MANAGER=>GET_DATA(
                           request = request
                           id      = 'txtFile'
                           name    = 'fileUpload' ).
      IF ( fileUpload->file_name  NE '' ) AND
         ( fileUpload->file_length GT 0 ).
         IF fileUpload->file_content_type
            = 'application/vnd.ms-excel'.
            DATA: content   TYPE ZMTVEMAT,
                  conv      TYPE REF TO CL_ABAP_CONV_IN_CE,
                  viewoff   TYPE REF TO CL_ABAP_VIEW_OFFLEN,
                  it_off    TYPE ABAPOFFLENTAB,
                  wa_off    TYPE ABAPOFFLEN,
                  dd_fields TYPE DDFIELDS,
                  wa_fields TYPE DFIES,
                  len       TYPE I.
            conv = CL_ABAP_CONV_IN_CE=>CREATE(
                      encoding = 'UTF-16'
                      endian   = 'L'
                      input    = fileUpload->file_content ).
            CALL FUNCTION 'TR_NAMETAB_GET'
               EXPORTING
                IV_TABNAME                   = 'ZMTVMAT'
                IV_GET_LENGTHS_IN_CHARMODE   = 'X'
                IV_GET_TEXTS                 = ' '
               IMPORTING
                ET_DFIES                     = dd_fields.
                LOOP AT dd_fields INTO wa_fields.
                  MOVE wa_fields-offset TO wa_off-ioff.
                  MOVE wa_fields-intlen TO wa_off-ilen.
                  APPEND wa_off TO it_off.
                ENDLOOP.
       viewoff = CL_ABAP_VIEW_OFFLEN=>CREATE( tab = it_off ).
                conv->READ(
                            exporting
                              view = viewoff
                            importing
                              data = content
                              len = len ).
    This is the DUMP
    Runtime Errors         CONVT_CODEPAGE_INIT                               
    Exception              CX_SY_CODEPAGE_CONVERTER_INIT                     
           Occurred on     30.11.2004 at 13:20:47                                                                               
    The conversion of some code pages is not supported.                                                                               
    What happened?                                                                               
    The conversion of texts in code page 'UTF-' to code page '1100' is not   
    supported.                                                               
    Thanks
    Ariel

Maybe you are looking for

  • Help in performance

    Hi All, i want to know if from performace side ,if it's good to select data and see if it's need to be update,or update any way. e.g. i get data on user and my quesion is if to do select single and see if the user is exist and if the user exist see i

  • How to use ListModel

    allScore1 is a simple Vector of Strings and no problem to use in a JList. allScore2 is a Vector of Objects including int and String and I guess that ListModel can be the solution when displaying both the integer and string at the same line in a list

  • Calendar events disappear in "Day" View. iphone4

    I am resubmitting this problem in the correct forum. I have two separate event entries in the calendar, one on the 31st Oct and another on the 1st November. While in the "Day" view and scrolling foreword from the 29th, the event on 31st October is vi

  • Weblogic Platform 8.1 Evaluation - Can't start server

    I downloaded the platform and completed all the steps listed in the appendix of the BEA Weblogic Platform Evaluation Guide. When I try and start Weblogic through Workshop as outlined in Chapter 1, I receive the following 2 errors: ####<Mar 3, 2004 9:

  • Just got an iPad mini. In mail I want to create a folder to save certain emails. I'll call the folder "Saved". Should be simple, right?

    Just got an iPad mini. In mail I want to create a folder to save certain emails. I'll call the folder "Saved". Should be simple, right?