Updating Start, Finish % Complete from excel file to Ms Project

Hi - This is my first post on this forum which i see is a great way to share knowledge.
I’m having a schedule which has around 3000 lines with resources names and a Responsible Person (  where individual resources
report to) updated on the schedule.
I need to work out a good way to get schedule updates from different parties in a efficient way.
My thoughts are to make a solution to generate the tasks which needs to be updated based on the status date and generate a individual excel files for each responsible person and get
their updates back in excel and update the dates and % complete back to the MS Project schedule.<o:p></o:p>
The steps
a) create a filter to list all the tasks which need to be updated based status date ( tasks which are in progress, tasks in the past which have not started yet,
tasks in the past which have finished etc) grouped as per responsible person and create separate excel files for each responsible person.
b) the excel file will contain ( UID, Task name, start date, finish date, %complete, resource name, responsible person)
c) I would like to email these excel files to each responsible person and get their updates for (start date, finish date, %complete)
d) Create a VBA macro to let the user to select the updated excel file and update the data back to MS Project file.
Conditions while updating
a)  
Read the Excel file from Top to bottom and find the correct record based on the UID and update the "duration" in order to change dates as below
b)  
IF Task has started ( the excel file contains % complete and a new start date later than the MS Project start date)
Update MS Project file ( Actual Start date and % Complete)
c)  
IF Task has started as Scheduled ( the excel file contain % complete and the excel file start date is equal to MS Project start date)
        Update MS Project file ( Actual Start date and % Complete)
d)  
IF Task has started and finished as Scheduled ( The excel file start and finish dates are equal to MS Project file but excel file % complete is now 100%)
Update MS Project File ( Actual Start, Actual Finish and Update % Complete 100%)
e)  
If Start date of the task has been rescheduled to a future date ( If Excel file start date is > that Ms project start date and excel file % complete is 0)
Update the MS Project file and inset a lag to match the excel file start date.
I would like to know whether this would be a feasible solutions and if some of you have implemented this kind of thing please share some code snippets.
Thanks a lot

Hi John, I've managed to progress further on the code and Split the records as per supervisor and create excel file and email  to supervisor.
However I ran into 2 problems
1) The code  works some time without any error and some times it stalls. I have managed to narrow it down to the sorting code block on the
ExportTaskstobeUpdated mehod where it Selects the Active work book which has all the data based on the filter and Sorts according to Supervisor Name+ Resource Name
I have made the error code Bold and Italic
The error I'm getting is
Run-time error '1004'
Method'Range' of object'_Global' failed
2) Currently I'm creating the Master Excel file which is generated by the
ExportTaskstobeUpdated method and splitting them and creating all the splits + the Master  excel file to a hard coded locationwhich is C:GESProjectEmail folder
When Saving it Prompts to Over wright the existing files , I don't need any prompts coming out for the user.
I've tried using the Application.DisplayAlearts=False but it does not work for me.
In order to overcome this , I created a routine to delete the files after the files have been emailed/Saved as draft but that too fails to delete the original Master excel file.
Is there a way to generate the excel files on the fly and without saving can I attach it to the email ?
Or would like to know your thoughts on a better way to handle this.
Sub ExportTaskstoBeUpdated()
'Start Excel and create a new workbook
'Create column titles
'Export data and the project title
'Tidy up
Dim xlApp As Excel.Application
Dim xlRange As Excel.Range
Dim Dept As Task
Dim Check As String
Dim Prime As String
Dim PrimeEmail As String
Dim OpeningParen, ClosingParen As Integer
'Start Excel and create a new workbook
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Add
'Create column titles
Set xlRange = xlApp.Range("A1")
With xlRange
'.Formula = "Master Schedule Report"
.Font.Bold = True
.Font.Size = 12
.Select
End With
xlRange.Range("A1") = "Supervisor"
xlRange.Range("B1") = "Resource Name"
xlRange.Range("C1") = "UID"
xlRange.Range("D1") = "Task Name"
xlRange.Range("E1") = "Start Date"
xlRange.Range("F1") = "Finish Date"
xlRange.Range("G1") = "% Completed"
xlRange.Range("H1") = "Project"
xlRange.Range("I1") = "Supervisor Email"
With xlRange.Range("A1:N1")
.Font.Bold = True
.HorizontalAlignment = xlHAlignCenter
.VerticalAlignment = xlVAlignCenter
.EntireColumn.AutoFit
.Select
End With
'Export data and the project title
Set xlRange = xlRange.Range("A2") 'Set cursor to the right spot in the worksheet
ViewApply Name:="Task Sheet" 'Get the view that has the Text11 column to filter on
OutlineShowAllTasks 'Any hidden tasks won't be selected, so be sure all tasks are showing
FilterApply Name:=" Telstra - CHECK 5 - Unstatused Tasks" 'This custom filter selects "External"
SelectTaskColumn ("Text2") 'Insures the For Each loop gets all of the filtered tasks, this may be redundant
For Each Dept In ActiveSelection.Tasks 'Pulls data for each task into spreadsheet
If Dept.Text4 <> "" Then ' If there is no Supervisor defined ignore the Task
With xlRange
.Range("A1") = Dept.Text4 ' Supervisor Name, which has a Lookup , where the description on the lookup is the Supervisor Email
.Range("B1") = Dept.ResourceNames
.Range("C1") = Dept.Text1
.Range("D1") = Dept.Name
.Range("E1") = Format(Dept.Start, "dd-mmm-yyyy")
.Range("F1") = Format(Dept.Finish, "dd-mmm-yyyy")
.Range("G1") = Dept.PercentComplete
.Range("H1") = ActiveProject.Name
'This below Code Developed by John Finds the lookup description value for a custom field value
If Dept.Text4 <> "" Then 'This is not required now since its captured above
Dim Found As Boolean
Dim i As Integer, NumSup As Integer
NumSup = ActiveProject.Resources.Count
'Once you have that set up, now you can add this code to your macro to determine the value for the "I1" range.
On Error Resume Next
'cycle through each item in the value list to find the one selected for this task
For i = 1 To NumSup
'once the item is found exit the loop
If CustomFieldValueListGetItem(pjCustomTaskText4, pjValueListValue, i) = _
Dept.Text4 Then
'the loop can exit for two reasons, one, the item has been found, two,
' the item was not found and an error occurred. We need to distinguish between the two
If Err = 0 Then Found = True
Exit For
End If
Next
On Error GoTo 0 'this resets the err function
'now that the corresponding email address is found, set the Excel range value
If Found Then
.Range("I1") = CustomFieldValueListGetItem(pjCustomTaskText4, pjValueListDescription, i)
Else
.Range("I1") = "No Email Defined"
End If
End If
'=====================
End With
Set xlRange = xlRange.Offset(1, 0) 'Point to next row
Else
End If
Next Dept
'Tidy up
FilterApply Name:="All Tasks"
ViewApply Name:="Task Sheet"
With xlRange
.Range("A1").ColumnWidth = 30
.Range("D1").ColumnWidth = 50
.Range("E1").ColumnWidth = 20
.Range("F1").ColumnWidth = 20
.Range("G1").ColumnWidth = 20
.Range("H1").ColumnWidth = 30
End With
'Sort the Active work book for Supervisor Name + Resource Name
Range("A1:I1").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A2:A500") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("B2:B500") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A1:I500")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Set xlApp = Nothing
'Call Method to Split to seperate files and Email
SplitIntoSeparateFiles
'Call the Method to delete the excel files genearated by the above method
Deletefiles
End Sub
Sub SplitIntoSeparateFiles()
'* This method Split the Master excel file which is sorted by Supervisor Name + Resource Name
Dim OutBook, MyWorkbook As Workbook
Dim DataSheet As Worksheet, OutSheet As Worksheet
Dim FilterRange As Range
Dim UniqueNames As New Collection
Dim LastRow As Long, LastCol As Long, _
NameCol As Long, Index As Long
Dim OutName, MasterOutName, SupervisorEmail As String
'set references and variables up-front for ease-of-use
'the current workbook is the one with the primary data, more workbooks will be created later
Set MyWorkbook = ActiveWorkbook
Set DataSheet = ActiveSheet
NameCol = 1 ' This is supervisor Name which will be splitted
LastRow = DataSheet.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LastCol = DataSheet.Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Set FilterRange = Range(DataSheet.Cells(1, NameCol), DataSheet.Cells(LastRow, LastCol))
'loop through the name column and store unique names in a collection
For Index = 2 To LastRow
On Error Resume Next
UniqueNames.Add Item:=DataSheet.Cells(Index, NameCol), Key:=DataSheet.Cells(Index, NameCol)
On Error GoTo 0
Next Index
'iterate through the unique names collection, writing
'to new workbooks and saving as the group name .xls
Application.DisplayAlerts = False
For Index = 1 To UniqueNames.Count
Set OutBook = Workbooks.Add
Set OutSheet = OutBook.Sheets(1)
With FilterRange
.AutoFilter Field:=NameCol, Criteria1:=UniqueNames(Index)
.SpecialCells(xlCellTypeVisible).Copy OutSheet.Range("A1")
End With
OutName = "C:\GESProjectEmail" + "\" 'Path to Save the generated file
SupervisorEmail = OutSheet.Range("I2") 'Supervisor Email
MasterOutName = OutName & "Test" ' This is the First excel file generated by the ExportTasksto Be Updated Method
OutName = OutName & UniqueNames(Index) & Trim(I2)
Application.DisplayAlerts = False
OutBook.SaveAs FileName:=OutName, FileFormat:=xlExcel8 'Create Excel files for each splitted files and save
'Call Send Email method
Send_Email_Current_Workbook (SupervisorEmail)
OutBook.Close SaveChanges:=False
Call ClearAllFilters(DataSheet)
Next Index
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=MasterOutName, FileFormat:=xlExcel8
ActiveWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True
End Sub
Sub Send_Email_Current_Workbook(Email As String)
Dim OutApp As Object
Dim OutMail As Object
Dim rng As Range
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Email
.CC = ""
.BCC = ""
.Subject = "Project Status Update"
.Body = "Please Update the attached file and email it back to the PM"
.Attachments.Add ActiveWorkbook.FullName
.Save
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
'safely clear all the filters on data sheet
Sub ClearAllFilters(TargetSheet As Worksheet)
With TargetSheet
TargetSheet.AutoFilterMode = False
If .FilterMode Then
.ShowAllData
End If
End With
End Sub
Sub Deletefiles()
' This method is to delete the excel files once its saved and to avoid the DO you want to overigt message
' because Application.DisplayAlerts = False command still prompts the user to save
On Error Resume Next
Kill "C:\GESProjectEmail\*.xl*"
On Error GoTo 0
End Sub

Similar Messages

  • ABAP solution to read data from excel file attached with project document

    i have a project created through tcode cj20n and attach an excel file with it. now my objective is to read the contents of that attach file through abap. can any one please help me in this matter? how can i know the path of that file?

    Hi,
    you can't do it in 30 minutes if you never did before.
    Use[ DOI |http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf]
    Regards,
    Clemens

  • How to update Ztable from Excel file and how to check conditions ,

    HI this uday,
    pls help me how can i update Ztable from Excel file and how to check conditions .
    regards
    uday
    Moderator message: please (re)search yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 12:00 PM

    Hi
    Use Fm : ALSM_EXCEL_TO_INTERNAL_TABLE.
    L_INTERN : internal table with your fields .
    make sure that the fields in the Excel should be formatted (as numeric , characher ) depending upon the data types .
    LOOP AT L_INTERN INTO WA_LINTERN .
            MOVE WA_LINTERN-COL TO L_INDEX.
            ASSIGN COMPONENT  L_INDEX OF STRUCTURE WA_INREC TO <FS> .
            IF SY-SUBRC = 0.
              MOVE WA_LINTERN-VALUE TO <FS>.
            ENDIF.
            AT END OF  ROW .                                    "#EC *
              APPEND WA_INREC TO IT_DATA.  "
              CLEAR WA_INREC.
            ENDAT.
         ENDLOOP.
    Regards
    Swapnil

  • How to import data into a Z table from excel file?

    hi,
    i have a custom created Z table into which i want to import some data from an excel file. which function can i use to do so because SE16 allows me to insert data only one by one via a data entry screen. this is time consuming. i want to import data from excel file so that its faster.

    HI,
    this program uploads data from excel and modifies ztable,(inserts records into ztable), check this and modify according to ur requirement)
    This program uploads material number from excel sheet and does
    ******modifications to material number if required by the user
    ******and updates the table zmatnr with new material against the old material number
    REPORT  zmat_no message-id zebg.
    TYPE-POOLS  truxs.
    TABLES:zmatnr.
    DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA row LIKE alsmex_tabline-row.
    data : g_matnr like mara-matnr.
    data : count type i.
    data : itab_count type i.
    data : gi_final like zmatnr occurs 0 with header line.
    *data : begin of gi_final occurs 0,
          mat_old like mara-matnr,
          mat_new like mara-matnr,
          end of gi_final.
    ***********************Selection Screen*************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.
    select-options : records for count.
    SELECTION-SCREEN END OF BLOCK b1.
    *********************At Selection Screen*************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.
      PERFORM search.
    START-OF-SELECTION.
    perform process.
    form process.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = pfname
          i_begin_col             = 1
          i_begin_row             = 2
          i_end_col               = 12
          i_end_row               = 65000
        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.
      describe table itab lines itab_count.
       row = 1.
      loop at itab.
        if itab-row <> row.
          append gi_final.
          clear gi_final.
        endif.
        case itab-col.
          when '1'.
          CLEAR G_MATNR.
          gi_final-OLD_MATNR = itab-value.
          CONCATENATE 'NEW' gi_final-old_matnr INTO itab-value.
            gi_final-new_MATNR = itab-value.
          endcase.
        row = itab-row.
      append gi_final.
      clear gi_final.
      endloop.
      CALL FUNCTION 'PROGRESS_INDICATOR'
      EXPORTING
        I_TEXT  = 'File Has Been Successfully Uploaded from Workstation ' .
      if not gi_final[] is initial.
        if not records-low is initial .
          if not records-high is initial.
            records-high = records-high + 1.
            DESCRIBE TABLE gi_final LINES count.
            IF records-high < count.
              DELETE gi_final FROM records-high TO count.
            ENDIF.
            IF records-low <> 1.
              IF records-low <> 0.
                DELETE gi_final FROM 1 TO records-low.
              ENDIF.
            ENDIF.
          endif.
        endif.
      endif.
      IF NOT GI_FINAL[] IS INITIAL.
        CALL FUNCTION 'PROGRESS_INDICATOR'
         EXPORTING
           I_TEXT  = 'Processing zmatnr table'
           I_OUTPUT_IMMEDIATELY = 'X'.
          if itab_count <> count.
             message i000 with 'records are not matching'.
             exit.
          else.
             modify zmatnr from table gi_final.
             message i000 with 'data base table modified successfully'.
          endif.
      endif.
    endform.
    *&      Form  search
          text
    -->  p1        text
    <--  p2        text
    FORM search .
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = pfname.
    ENDFORM.                    " search
    regards
    siva

  • How to transfer data from excel files into z-tables

    Please help me with a code which transfers data from excel file to z-table.
    Thanks in advance
    Shuvir

    Hi Daniel,
    Export Data
    Purpose
    Use this procedure to export SAP data to a local file such as Microsoft Excel.
    Menu Path
    Use the following menu path to begin this process:
    ·         SystemèListèSaveèLocal File
    Helpful Hints
    When reviewing fields, R = Required,  O = Optional and C = Conditional.
    Procedure
    1.       Start the transaction using the menu path or transaction code.
          Whatever Data You Want to Export
    2.       Select SystemèListèSaveèLocal File.  This works well for any data in SAP.  This is the only option for the top-level (first page) of a report. 
    In a drill-down view within a report the Local File button  on the toolbar may be used and has the same options.
          Choose File Format
    3.       Click  .
    4.       Click  to continue.  If prompted for a format after choosing Spreadsheet, select Excel Table to get an Excel file that can be modified more easily.
          Choose File Save Location Step 1
    5.       Click  to the right of the Directory field to choose a different location.
          Choose File Save Location Step 2
    6.       Click  or browse your computer to locate the directory where you want to save your file.
    7.       Complete the following field:
    ·         File name:
        You must add the proper file extension to the name of your file (.xls for Excel, .rtf for Rich Text, .html for HTML).  The file extension tells your computer what program to open the file with.  If you do not have the file extension at the end, you may not be able to open it.
    8.       Click  to continue.
          Generate File in Location and Format Selected
    9.       Click  to create the file in the location and format selected.  In this example the file was named "example.xls" and saved on the desktop.
    Result
    You have completed the export process.
    thanks
    karthik

  • Error while uploading data to ztable from excel file

    Hi,
    I have a requirement where i have to upload data from excel file to ztable.I have used the fm 'ALSM_EXCEL_TO_INTERNAL_TABLE' for reading the excel file.After reading the excel file i have used INSERT zrb_hdr from table t_zrb_hdr for updating the ztable with data .
    here it is giving error as the data base table zrb_hdr and the internal table t_zrb_hdr should be declared of same type .
    I got this error b'coz i have changed the date and time fields in t_zrb_hdr table to char type.so the structure of zrb_hdr and t_zrb_hdr are not same.If i don't change the date and time fields,in the o/p i am not getting proper date and time formats.
    now how can i upload data into ztable?

    Hi,
    Try this.
    Data: itab type standard table of ztable,
             wa_itab type ztable.
    loop at t_zrb_hdr into wa_t_zrb_hdr.
       wa_itab-date = wa_t_zrb_hdr-date.
       wa_itab-time = wa_t_zrb_hdr-time.
       like  move all the fiedl to wa_itab...........
       append itab with wa_itab.
    Endloop.
    now insert the records from itab to the database table ztable.
    Thanks,
    Muthu.

  • UPLOAD DATA FROM EXCEL FILE

    hi guru,
    I want to upload data from excel file for mm02.. first of all help on the matter of how to upload data from excel...
    i hv used the FM ALSM_EXCEL_TO_INTERNAL_TABLE.. but its not working it uploading garbage value ... so tell me how to used it...
    help me on this matter.

    Check below example.
    parameters :  p_file  LIKE rlgrap-filename OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_file_name.
      PERFORM get_file_to_excel.
    *&      Form  get_file_name
    FORM get_file_name.
      DATA: lv_name LIKE sy-repid.
      lv_name = sy-repid..
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                program_name  = lv_name
                dynpro_number = syst-dynnr
                static        = 'X'
           CHANGING
                file_name     = p_file.
    ENDFORM. " get_file_name
    *&      Form  get_file_to_excel
    FORM get_file_to_excel.
      DATA: idata LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_file
                i_begin_col             = '1'
                i_begin_row             = '2'  "Do not require headings
                i_end_col               = '2'
                i_end_row               = '60000'
           TABLES
                intern                  = idata
           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.
        STOP.
      ENDIF.
    * Get first row retrieved
      READ TABLE idata INDEX 1.
    * Set first row retrieved to current row
      DATA: gd_currentrow TYPE i.
      gd_currentrow = idata-row.
      LOOP AT idata.
    *   Reset values for next row
        IF idata-row NE gd_currentrow.
          APPEND f.  CLEAR f.
          gd_currentrow = idata-row.
        ENDIF.
        CASE idata-col.
          WHEN '0001'.
            f-belnr   = idata-value.
        ENDCASE.
      ENDLOOP.
      APPEND f.  CLEAR f.

  • Upload data from excel file to mii without UDS and PCo

    Hi Experts,
    I am trying to upload data from excel file to mii db without using UDS and PCo. Is there any other ways that we can achieve it.
    I am thinking one solution , writing stored procedure. any other solutions?
    Thanks in advance,
    Eswar.

    Hi,
    Thanks for reply.
    I tried to create OLEDB data server which will point to my excel file in D drive.Its created successfully and i tried to query the datasource using sql query, I am not getting any modes in sql query template.
    can u provide some steps..how to access this file.
    Thanks, Eswar

  • Upload data from excel file to Oracle table

    Dear All,
    I have to upload data from excel file to Oracle table without using third party tools and without converting into CSV file.
    Could you tell me please how can i do this using PLSQl or SQL Loader.
    Thnaks in Advance..

    Dear All,
    I have to upload data from excel file to
    Oracle table without using third party tools and
    without converting into CSV file.
    Could you tell me please how can i do this
    using PLSQl or SQL Loader.
    Thnaks in Advance..As billy mentioned using ODBC interface ,the same HS service which is a layer over using traditional ODBC to access non oracle database.Here is link you can hit and trial and come out here if you have any problem.
    http://www.oracle-base.com/articles/9i/HSGenericConnectivity9i.php[pre]
    Khurram                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • Reading the data from excel file which is in application server.

    Hi,
    Iam trying to read the data from excel file which is in application server.
    I tried using the function module ALSM_EXCEL_TO_INTERNAL_TABLE. But it didn't work.
    I tried just reading using open data set and read data set it is giving junk characters.
    Please suggest me if you have any solution.
    Best Regards,
    Brahma Reddy

    Hi Narendra,
    Please see the below code I have written
    OPEN DATASET pa_sfile for INPUT in text mode ENCODING  DEFAULT MESSAGE wf_mess.
    CHECK sy-subrc = 0.
    DO.
    READ DATASET pa_sfile INTO wf_string.
    IF sy-subrc <> 0.
    EXIT.
    else.
    split wf_string at wl_# into wf_field1 wf_field2 wa_upload-field3
    wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7 wa_upload-field8
    wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13
    wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18
    wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
    wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28
    wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33
    wa_upload-field34 wa_upload-field35 wa_upload-field36 .
    wa_upload-field1 = wf_field1.
    wa_upload-field2 = wf_field2.
    append wa_upload to int_upload.
    clear wa_upload.
    ENDIF.
    ENDDO.
    CLOSE DATASET pa_sfile.
    Please note Iam using ECC5.0 and it is not allowing me to declare wl_# as x as in your code.
    Also if Iam using text mode I should use extension encoding etc.( Where as not in your case).
    Please suggest me any other way.
    Thanks for your help,
    Brahma Reddy

  • How to Load the data from excel file(Extension is .CSV) into the temp.table

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Hello Sachin,
    You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
    Instead of copy values into forms you can save them in your temporary table.
    Kind regards,
    Alex
    If someone's helpful or correct please mark it accordingly.

  • How to load the data from excel file into temprory table in Forms 11g?

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Declare
        v_full_filename         varchar2(500);
        v_server_path           varchar2(2000);
        v_separator             VARCHAR2(1);
        v_filename              VARCHAR2(400);
        filename                VARCHAR2 (100);
        v_stop_load             varchar2 (2000);
        v_rec_error_log         varchar2(4000);
        v_error_log             varchar2(4000);
        ctr                     NUMBER (12);
        cols                    NUMBER (2);
        btn                     number;
        RES                     BOOLEAN;   
        application             ole2.obj_type;
        workbooks               ole2.obj_type;
        workbook                ole2.obj_type;
        worksheets              ole2.obj_type;
        worksheet               ole2.obj_type;
        cell                    ole2.obj_type;
        cellType                ole2.OBJ_TYPE;
        args                    ole2.obj_type;
        PROCEDURE olearg
        IS
        args   ole2.obj_type;
        BEGIN
        args := ole2.create_arglist;
        ole2.add_arg (args, ctr);                                
        ole2.add_arg (args, cols);                                   
        cell := ole2.get_obj_property (worksheet, 'Cells', args);
        ole2.destroy_arglist (args);
        END;
    BEGIN
    v_full_filename := client_get_file_name(directory_name => null
                                     ,file_name      => null
                                     ,file_filter    => 'Excel  files (*.xls)|*.xls|'  
                                                                            ||'Excel  files (*.xlsx)|*.xlsx|'                                                                 
                                     ,message        => 'Choose Excel file'
                                     ,dialog_type    => null
                                     ,select_file    => null
    If v_full_filename is not null Then
    v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
    v_filename := v_separator||v_full_filename ;
    :LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);                                
    RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));     
    --Begin load data from EXCEL
    BEGIN
        filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
        application := ole2.create_obj ('Excel.Application');
        ole2.set_property (application, 'Visible', 'false');
        workbooks := ole2.get_obj_property (application, 'Workbooks');
        args := ole2.create_arglist;
        ole2.add_arg (args, filename); -- file path and name
        workbook := ole2.get_obj_property(workbooks,'Open',args);
        ole2.destroy_arglist (args);
        args := ole2.create_arglist;
        ole2.add_arg (args, 'Sheet1');
        worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
        ole2.destroy_arglist (args);
        ctr := 2;                                                     --row number
        cols := 1;                                                -- column number
        go_block('xxx');
        FIRST_RECORD;  
        LOOP       
                --Column 1 VALUE --------------------------------------------------------------------
            olearg;
            v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            :item1 := v_stop_load;
            cols := cols + 1;                                                      
              --Column 2 VALUE --------------------------------------------------------------------
            olearg;
            :item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            cols := cols + 1;
            --<and so on>
        ole2.invoke (application, 'Quit');
        ole2.RELEASE_OBJ (cell);
        ole2.RELEASE_OBJ (worksheet);
        ole2.RELEASE_OBJ (worksheets);
        ole2.RELEASE_OBJ (workbook);
        ole2.RELEASE_OBJ (workbooks);
        ole2.RELEASE_OBJ (application);
    END;
    --End load data from EXCELPlease mark it as answered if you helped.

  • How  to load the data from excel  file  into table in oracle using UTL_FI

    How to load the data from excel file into table in oracle
    and from table to excel file
    using UTL_FILE package
    Please give me some example

    This is something i tried in oracle apex
    http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    Regards,
    CKLP

  • Error in reading from excel file

    hi,
    I have written a program which reads from excel file
    and based on the value of the column i have to do something.
    Everything is fine but when i run it, it produces an error message
    Exception: For input string: "851.0"
    the value 851.0 is acually the value of the first column.
    Here is the code and i hope someone can help me to find the solution
    try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:exceltest" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$] " );
                               ResultSetMetaData rsmd = rs.getMetaData();
                               int numberOfColumns = rsmd.getColumnCount();
                               while (rs.next()) {
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if(i==1){
                                                            String columnValue1 = rs.getString(i);
                                                            custNo =Integer.parseInt(columnValue1);
                                                           // System.out.println(columnValue1);     
                                                            found=search(custNo);
                                                            if (found==false)
                                                                 insert(custNo);
                                                            System.out.println(columnValue1);     
                                                 else if (i == numberOfColumns && found==false)
                                                           String columnValue = rs.getString(i);
                                                           if(columnValue=="a")
                                                                incrementCusta();
                                                           else if (columnValue=="b")
                                                                incrementCustB();
                                                           else if(columnValue=="c")
                                                                incrementCustc();
                                                           else if(columnValue=="d")
                                                                incrementCustId();
                                            System.out.println("");     
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                                 }

    Maybe 851.0 is float value, not string.
    Try Object columnValue1 =
    rs.getObject(i); instead of String
    columnValue1 = rs.getString(i);
    You are absolutely right i actually change the line
    custNo =Integer.parseInt(columnValue1);
    into
    custNo =Double.parseDouble(columnValue1);
    Thanks alot :)

Maybe you are looking for

  • I can't update to iOS5

    I keep getting message saying that iTunes can't update to iOS5 because applesoftwareupdate.msi cannot be found. I've tried extracting the files from iTunes setup using winRAR, but I'm still getting an error because the old applesoftwareupdate.msi can

  • Any way to back up FAT formatted external hard drive to Time Machine?

    I'm a photographer, and right now my library of photos is a complete mess. I have about 20 GB of photos on one external hard drive and about 30 GB on my Mac's built in hard drive. I recently purchased a new external hard drive to use with Time Machin

  • Advanced Property Editor

    As is the case with previously posted users, I find the persistent appearance of the Editor an annoying nuisance. Why has it not been addressed to the satisfaction of 'us' complaining users Can this function be disabled without impairing the use of t

  • Having trouble w/reader & outlook 2003

    I have Windows XP w/Outlook 2003 just recently i started to get an error through outlook that stated that it encountered an error and needs to shut down. When i reserche the error it says that it is a compatapility issue w/acrobat reader. So i uninst

  • Why the iPad internal speakers not working with some applications and key sound?

    My iPad1 ' internal speakers not fully functioning. It is working with music and video, YouTube , but not working with applications such as games. Also with key pad sound . Please help me in this regard.