Transferring User-Entry Cells from Excel Files

Hello,
I apologize in advance if this is a question better answered in a Microsoft Excel forum, but I saw some really good discussions here, and I think my question applies just as much to Acrobat.
I work at a college and we create a lot of excel files -- one for each student. I'd like to be able to create excel files with fields that would accept user-entered data, then save this excel file as a PDF so that the user-entry fields are preserved. I can't seem to figure out a way to do this, but I'd like to avoid having to go into each PDF with Acrobat after the fact to add the appropriate fields to each form.
If not that, is there a way to change acrobat settings such that the user will be allowed, using Reader, to enter text anywhere on the form (without altering the text that's already there)?
Thanks so much for your time and thoughts!
-Devin

There is not a built-in way to convert from Excel to PDF so that the cells are automatically converted to form fields in Acrobat with the data retained.
To allow Reader users to add text to a PDF, it needs to be enabled for commenting (Tools > Typewriter > Enable Typewriter too in Adobe Reader, for example), which allows Reader to add text using the Typewriter tool. Or "Comments > Enable for Commenting and Analysis in Adobe Reader", which allows other types of comments (e.g., Text Box) to be added with Reader.
If the layout is static, you can import data exported from Excel and fill fields in a PDF form. The data file needs to be a text file in tab-delimited format, with the PDF field names provided in the first row, and subsequent rows being the corresponding field data. You can import in Acrobat using: Forms > Manage Form Data > Import Data. When you select the text file, it will promt you to import a row of data from the text file.

Similar Messages

  • 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

  • Store data in mysql after reading from excel files

    i am trying to make o program where i will read the data from excel files and i will store them in a database. I am using eclipse as editor and mySQL. I am using APACHE POI to read the excel files and JDBC for the connection. The excel files have the structure as shown below:
    ID NAME SALARY STREET
    321 TIM 1254 14 avenue
    121 PAUL 1265 28h oktovriou
    432 NICK 4521 papaflessa
    I have of course plenty of such files which contains many more rows and columns. The purpose of my program is to read the data, create table named as the name of the excel file and the fields of each table to be the first rows of the excel file. Afterwards the values will be the rest data of the excel file. In the code below i have managed to read them, show the data in the console. Afterwrds i am trying to call a database with JDBC but there i have problem when i create the table.
    try
    String[] allFields;
    String createTableStr = "CREATE TABLE" + createTableStr
    + "(" + org.apache.commons.lang3.StringUtils.join(allFields,
    ",") + ")";
    Could anyone help me?
    Thank you in advance!:)
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.commons.lang3.StringUtils;
    import org.apache.poi.ss.usermodel.Cell;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class exam1 {
    @SuppressWarnings({ "unchecked", "unchecked" })
    static void main (String[] args) throws Exception {
    String filename = "C:\\Users\\Efi\\Documents\\test5.xls";
    List sheetData = new ArrayList();
    FileInputStream fis = null;
    try {
    fis = new FileInputStream(filename);
    HSSFWorkbook workbook = new HSSFWorkbook(fis);
    HSSFSheet sheet = workbook.getSheetAt(0);
    Iterator rows = sheet.rowIterator();
    while (rows.hasNext()) {
    HSSFRow row = (HSSFRow) rows.next();
    Iterator cells = row.cellIterator();
    List data = new ArrayList();
    while (cells.hasNext()) {
    HSSFCell cell = (HSSFCell) cells.next();
    data.add(cell);
    sheetData.add(data);
    } catch (IOException e) {
    e.printStackTrace();
    } finally {
    if (fis != null) {
    fis.close();
    showExcelData(sheetData);
    @SuppressWarnings("unused")
    HashMap<String, String> tableFields = new HashMap();
    for (int i=0; i<sheetData.size();i++){
    List list = (List) sheetData.get(i);
    for (int j=0; j<list.size(); j++){
    Cell cell = (Cell) list.get(j);
    if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
    System.out.print(cell.getNumericCellValue());
    }else if(cell.getCellType()==Cell.CELL_TYPE_STRING) {
    System.out.print(cell.getRichStringCellValue());
    } else if(cell.getCellType()==Cell.CELL_TYPE_BOOLEAN) {
    System.out.print(cell.getBooleanCellValue());
    if (j < list.size() - 1) {
    System.out.print(", ");
    private static void showExcelData(List sheetData) {
    @SuppressWarnings("unchecked")
    private HashMap parseExcelData (List sheetData){
    HashMap<String,Integer> tableFields = new HashMap();
    List list = (List) sheetData.get(0);
    for (int j=0; j<list.size(); j++){
    Cell cell=(Cell) list.get(j);
    tableFields.put(cell.getStringCellValue(),cell.getCellType());
    return tableFields;
    @SuppressWarnings({ "unchecked", "unchecked", "unchecked", "unchecked", "unused" })
    private String getCreateTable(String tablename, HashMap<String, Integer> tableFields){
    Iterator iter = tableFields.keySet().iterator();
    String str="";
    String[] allFields = new String[tableFields.size()];
    int i = 0;
    while (iter.hasNext()){
    String fieldName = (String) iter.next();
    Integer fieldType=(Integer)tableFields.get(fieldName);
    switch (fieldType){
    case Cell.CELL_TYPE_NUMERIC:
    str=fieldName + "INTEGER";
    break;
    case Cell.CELL_TYPE_STRING:
    str= fieldName + "VARCHAR(255)";
    break;
    case Cell.CELL_TYPE_BOOLEAN:
    str=fieldName + "INTEGER";
    break;
    allFields[i++]= str;
    return str;
    public Connection getConnection() throws SQLException {
    try {
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/kainourgia","root", "root");
    Statement stmt = con.createStatement();
    try
    System.out.println( "Use the database..." );
    stmt.executeUpdate( "USE kainourgia;" );
    catch( SQLException e )
    System.out.println( "SQLException: " + e.getMessage() );
    System.out.println( "SQLState: " + e.getSQLState() );
    System.out.println( "VendorError: " + e.getErrorCode() );
    try
    String[] allFields;
    String createTableStr = "CREATE TABLE" + createTableStr
    + "(" + org.apache.commons.lang3.StringUtils.join(allFields,
    *",") + ")";*
    System.out.println( "Create a new table in the database" );
    stmt.executeUpdate( createTableStr );
    catch( SQLException e )
    System.out.println( "SQLException: " + e.getMessage() );
    System.out.println( "SQLState: " + e.getSQLState() );
    System.out.println( "VendorError: " + e.getErrorCode() );
    catch( Exception e )
    System.out.println( ((SQLException) e).getSQLState() );
    System.out.println( e.getMessage() );
    e.printStackTrace();
    return null;
    }

    Please don't multipost! Also crossposted: http://www.java-forums.org/jdbc/71612-store-data-mysql-after-reading-excel-files.html
    Mod: I'm locking this thread.

  • How to read the data from excel file and store into the table?

    Hi All,
    I have table with BLOB datatype contains a excel file. I have to read that data from excel and store into one table with all the fields in excel.
    All the excel fields and my table columns are same.
    Can you share with me how can acheive this using LOB's?
    Thanks

    Hi OraSuirya,
    you can try with external tables .
    syntax as follows
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    For this you need to create directory
    Directory Creation syntax:
    create or replace directory ext_dir as 'D:\oracle\user_dir\ext_dir';
    grant read, write on directory ext_dir to <User>;
    please paste the excel file in the particular directory .
    I hope this will help you.
    Please correct me if I am wrong anywhere .
    Thanks,
    Tippu.

  • 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.

  • Reading long text from excel file to an internal table

    Hi
    Can any body tell me how to read long text from excel file to an internal table.
    When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
    But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
    may i know which FM or what logic i need to use for this problem.
    Regards

    Hi,
    Here is an example program.  It will upload an Excel file with two columns.  You could also assign the Excel structure dynamically, but I wanted to keep the example simple.  The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
    Remember, this is just an example to help you figure out how to properly use the technique.  It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
    *& Report  zexcel_upload_test                            *
    REPORT  zexcel_upload_test.
    TYPE-POOLS: truxs.
    TYPES: BEGIN OF ty_excel,
             col_a(10) TYPE n,
             col_b(35) TYPE c,
           END OF ty_excel.
    DATA: l_data_tab         TYPE TABLE OF string,
          l_text_data        TYPE truxs_t_text_data,
          l_gui_filename     TYPE string,
          it_excel           TYPE TABLE OF ty_excel.
    FIELD-SYMBOLS: <wa_excel>  TYPE ty_excel.
    PARAMETERS: p_file TYPE rlgrap-filename.
    * Pass the file name in the correct format
    l_gui_filename = p_file.
    * Upload data from PC
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = l_gui_filename
        filetype                = 'ASC'
        has_field_separator     = 'X'
      CHANGING
        data_tab                = l_data_tab
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    * Convert from Excel into the appropriate itab
    l_text_data[] = l_data_tab[].
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        i_field_seperator    = 'X'
        i_tab_raw_data       = l_text_data
        i_filename           = p_file
      TABLES
        i_tab_converted_data = it_excel
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    LOOP AT it_excel ASSIGNING <wa_excel>.
    *  Do something here...
    ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM filename_get CHANGING p_file.
    *       FORM filename_get                                             *
    FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
      DATA: l_in_file  TYPE string,
            l_filetab  TYPE filetable,
            wa_filetab TYPE LINE OF filetable,
            l_rc       TYPE i,
            l_action   TYPE i,
            l_init_dir TYPE string.
    * Set the initial directory to whatever you want it to be
      l_init_dir = 'C:\'.
    * Call the file open dialog without multiselect
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Load file'
          default_extension       = '.XLS'
          default_filename        = l_in_file
          initial_directory       = l_init_dir
          multiselection          = 'X'
        CHANGING
          file_table              = l_filetab
          rc                      = l_rc
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
        REFRESH l_filetab.
      ENDIF.
    * Read the selected filename
      READ TABLE l_filetab INTO wa_filetab INDEX 1.
      IF sy-subrc = 0.
        p_in_file = wa_filetab-filename.
      ENDIF.
    ENDFORM.                    " filename_get
    Regards,
    Jamie

  • 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

  • Read data from Excel file and diaplay in Webdynpro

    Hi all,
    I need some help. I have a Excel file with set of  name, phonenumbers . I want to know how to display the data using Webdynpro. Could some one help me. help is appreciated and I promise to award points for right answer.
    Thank you
    Maruti

    <b>Hi
    i can explain you to read data from Excel file
    First You have to download the jxl.jar file. You can get this file from the Below site
    </b><a href="http://www.andykhan.com/jexcelapi/download.html">jexcelapi jar</a>
    It will be in Compressed Fromat So Unzip it to get the Contents
    After Unzipping The File You will get a Folder (jexcelapi/jxl.jar)
    Now in NWDS open web dynpro explorer, Right Click Your Project, a popup menu will appear and in that click Properties
    You will get window displaying your Project Properties
    On Left Side of the window You Will Find "Java Build Path"
    Click That "Java Build Path" and you will get 4 Tabs Showing ( Source,Projects,Libraries,Order and Export)
    Click Libraries Tab
    You will find options many options buttons
    In that click the Button "Add External Jars"
    You will get Window in order to fecth the jxl.jar file from the location you had stored
    After selecting the jxl.jar i will get displayed and click ok
    Now Open Navigator
    Open Your Project
    You will find Lib folder
    Copy the jxl.jar to that lib folder
    Note : You cannot Read the Content from the excel file directly
    First You Have to copy that file to the Server,
    And from the Server you can get the file absolute path
    With the absolute path you can read the contents of the Excel file
    You have to save the Excel file as .xls Format and Not as xlsx format i will not accept that...
    You have Upload the Excel file from the Server Using the File Upload UI Element
    This Coding will extract 3 columns from the Xls File
    Coding
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import jxl.Cell;
    import jxl.Sheet;
    import jxl.Workbook;
    import com.sap.fileupload.wdp.IPrivateFileUpload_View;
    import com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;
    public void onActionUpload_File(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload_File(ServerEvent)
        IPrivateFileUpload_View.IContextElement element1 = wdContext.currentContextElement();
        IWDResource resource = element1.getFileResource();
        element1.setFileName(resource.getResourceName());
        element1.setFileExtension(resource.getResourceType().getFileExtension());
        //@@end
    public void onActionUpload_File_in_Server(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload_File_in_Server(ServerEvent)
        InputStream text=null;
        int temp=0;
        try
             File file = new File(wdContext.currentContextElement().getFileResource().getResourceName().toString());
             FileOutputStream op = new FileOutputStream(file);
             if(wdContext.currentContextElement().getFileResource()!=null)
                  text=wdContext.currentContextElement().getFileResource().read(false);
                  while((temp=text.read())!=-1)
                       op.write(temp);                                      
             op.flush();
             op.close();
             path = file.getAbsolutePath();
             wdComponentAPI.getMessageManager().reportSuccess(path);
        catch(Exception e)
             e.printStackTrace();
        //@@end
    public void onActionUpload_Data_into_Table(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload_Data_into_Table(ServerEvent)
        try
              Workbook wb =Workbook.getWorkbook(new File(path));
              Sheet sh = wb.getSheet(0);
              //wdComponentAPI.getMessageManager().reportSuccess("Columns = "+sh.getColumns());
              //wdComponentAPI.getMessageManager().reportSuccess("Rows = "+sh.getRows());
              int columns = sh.getColumns();
              int rows = sh.getRows();
              int i=0;
             for(int j=1;j<=rows;j++)
                       ele=wdContext.nodeTable_Data().createTable_DataElement();
                       Cell c1 = sh.getCell(i,j);
                      ele.setTab_Name(c1.getContents());
                       Cell c2 = sh.getCell(i+1,j);
                       ele.setTab_Degree(c2.getContents());
                          Cell c3 = sh.getCell(i+2,j);
                       ele.setTab_Percentage(c3.getContents());
                       wdContext.nodeTable_Data().addElement(ele);
        catch(Exception ex)
             wdComponentAPI.getMessageManager().reportSuccess(ex.toString());
        //@@end
       * The following code section can be used for any Java code that is
       * not to be visible to other controllers/views or that contains constructs
       * currently not supported directly by Web Dynpro (such as inner classes or
       * member variables etc.). </p>
       * Note: The content of this section is in no way managed/controlled
       * by the Web Dynpro Designtime or the Web Dynpro Runtime.
      //@@begin others
      String path;
      IPrivateFileUpload_View.ITable_DataElement ele;
    //@@end
    Regards
    Chandran S

  • How to copy only some coulums and rows from excel files to a Oracle Table

    Dear all,
    I have the following problems:
    How to copy only some wanted coulums ( I.e DATETIME(format:17/09/2007 00:00:01 ) and TIME (format: 00:00:01 ) from excel files to oracle table.
    HOPE TO GET HELP FROM YOU GUYS!
    SINCERELY,
    MONOJSHARMALUITEL

    How about Heterogeneous Services so that the Excel sheet is an external database:
    1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
    2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
    EXCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EXCL)
    (HS = OK)
    Here SID is the name of data source that you have just created.
    3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = <hs_sid>)
    (ORACLE_HOME = <oracle home>)
    under SID_LIST_LISTENER like:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\ORA9DB)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORA9DB)
    (ORACLE_HOME = d:\ORA9DB)
    (SID_NAME = ORA9DB)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = EXCL)
    (ORACLE_HOME = D:\ora9db)
    Dont forget to reload the listener
    c:\> lsnrctl reload
    4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
    In this file set following two parameters:
    HS_FDS_CONNECT_INFO = excl
    HS_FDS_TRACE_LEVEL = 0
    5- Now connect to Oracle database and create database link with following command:
    SQL> CREATE DATABASE LINK excl
    2 USING 'excl'
    3 /
    Database link created.
    Now you can perform query against this database like you would for any remote database.
    SQL> SELECT table_name FROM all_tables@excl;
    TABLE_NAME
    DEPT
    EMP

  • How to  read from excel file and write it using implicit jsp out object

    our code is as below:Please give us proper solution.
    we are reading from Excel file and writing in dynamicaly generated Excel file.it is writing but not as original excel sheet.we are using response.setContentType and response.setHeader for generating pop up for saveing the original file in to dynamically generated Excel file.
    <%@ page contentType="application/vnd.ms-excel" %>
    <%     
         //String dLoadFile = (String)request.getParameter("jspname1");
         String dLoadFile = "c:/purge_trns_nav.xls" ;
         File f = new File(dLoadFile);
         //set the content type(can be excel/word/powerpoint etc..)
         response.setContentType ("application/msexcel");
         //get the file name
         String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());
         //set the header and also the Name by which user will be prompted to save
         response.setHeader ("Content-Disposition", "attachment;     filename="+name);
         //OPen an input stream to the file and post the file contents thru the
         //servlet output stream to the client m/c
              FileInputStream in = new FileInputStream(f);
              //ServletOutputStream outs = response.getOutputStream();
              int bit = 10;
              int i = 0;
              try {
                        while (bit >= 0) {
                        bit = in.read();
                        out.write(bit) ;
    } catch (IOException ioe) { ioe.printStackTrace(System.out); }
              out.flush();
    out.close();
    in.close();     
    %>

    If you want to copy files as fast as possible, without processing them (as the DOS "copy" or the Unix "cp" command), you can try the java.nio.channels package.
    import java.nio.*;
    import java.nio.channels.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    class Kopy {
         * @param args [0] = source filename
         *        args [1] = destination filename
        public static void main(String[] args) throws Exception {
            if (args.length != 2) {
                System.err.println ("Syntax: java -cp . Kopy source destination");
                System.exit(1);
            File in = new File(args[0]);
            long fileLength = in.length();
            long t = System.currentTimeMillis();
            FileInputStream fis = new FileInputStream (in);
            FileOutputStream fos = new FileOutputStream (args[1]);
            FileChannel fci = fis.getChannel();
            FileChannel fco = fos.getChannel();
            fco.transferFrom(fci, 0, fileLength);
            fis.close();
            fos.close();
            t = System.currentTimeMillis() - t;
            NumberFormat nf = new DecimalFormat("#,##0.00");
            System.out.print (nf.format(fileLength/1024.0) + "kB copied");
            if (t > 0) {
                System.out.println (" in " + t + "ms: " + nf.format(fileLength / 1.024 / t) + " kB/s");
    }

  • UPLOADING DATA FROM EXCEL FILE.

    Hi All,
    i have to upload the data from excel file to an internal table.I am using FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' for that. But the problem is it taking upto 50 characters only from each cell of  excel sheet. in each cell i have more than 100 characters.
    How to read these type of data?..
    Plz help me in this regard.
    thank you in advance!!!!
    Regards,
    Ravi

    Hi,
      Check my previous post for the same question for referance
    Re: Excel to itab
    Guess this will help you.
    Regards,
    Ram.

  • Change Value While Uploading data From Excel File

    Dear Expert,
    Please guide me is it Possible?, if yes then How?
    We have one BDC Uploader there After uploading data from Excel File, i want to check one field like this....
    if it_f65data-newbs contains any Alphabet.
    then user Should be able to change value on the same time while executing Program in table.
    Please tell me how i can change value in running program
    Regards'
    Shelly Malik

    Hi,
    What you can probably do is, perform a consistency check on your data in the internal table and segregate all those rows that have inconsistent data (in your case, the field NEWBS containing albhabets) into another temporary internal table. Display the temporary internal table in an editable ALV grid saying that these data have not been inserted to the database, coz they have inconsistent data in the field NEWBS. Allow the user to edit and then save the data which will consequently refresh the internal table contents.

  • I wish to link a  cell from one file or "shell" with a specific quantity to another cell in another file or "shell".

    I wish to link or send a  cell from one file or "shell" with a specific quantity or text to another cell in another file or "shell".  For example.  I wish to  send all general ledger (one data enty File or "sheet")  entries into their specific individual accounts. (in seperate files or "sheets").   Is this possible in Numbers?

    Hi cochise0011;
    A picture of tables would be much easier to comprehend the querry.
    Regards,

  • 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

Maybe you are looking for

  • Enabling data management for  a coldfusion  data service

    Hello,     i have problem in calling a service withen a data service ,, that if i enable the data management  i cant insert or update records , if i desable the data manabemt i can insert records but dont have result for get all or any get service al

  • FYI Pro App update for Logic Studio

    The lastest Pro App update is available from Apple. This includes Final Cut apps and Logic Studio. Cheers, RealDave

  • Acrobat Reader 10.1.4 won't open

    Hi Recently I've been having problems with Acrobat Reader. When I open a document, after say 5 seconds it freezes every time, regardless of the document. This went on a few days, until I uninstalled it and downloaded the most recent version for Vista

  • Issues w/ iPod audio streaming from iPad 2 to AppleTV 2?

    Are there known issues with streaming music from iPad 2 to ATV2 via AirPlay? Streaming the exact same music at the exact same bit rate from my iPhone 4 works flawlessly. However, from the iPad 2, 256K MP3s are extremely choppy -- whether I'm using th

  • Release schedule, Oracle/Sun deal etc ...

    Hi, I am a newbie to RIA and am trying to come upto speed with JavaFX. This technology choice wins over Adobe-Flash and Silverlight for me, given that my app is in Java and consequently the fact that JavaFX and Java both run on the same JVM is the mo