Upload to Excel option in Table maintenence View

Hello Gurus,
I have a Z table, for which we have created a table maintenence view generated and then we've attached a Z taransaction code to the same.
So if the user want, he can go to this transaction and add/edit/delete table entries right then and there.
But now the user wants a upload from excel utility/option from the same screen.
I have read somewhere on SDN that we can create custom routines and attach it to table maintenence generator, but i donno how to do it.
Can anyone please guide me or point me to some links...it would be very helpful.
Thanks in advance.
Cheers,
Tatvagna Shah.

HI ALL,
Recently I faced the same issue, I had to upload 1300 records into the table using table maintenance, First I thought of wiritng a Z program, but realised that it is not acceptable to client, because if the table is uploaded in testing servor or production servor, we have to trasport the program,and this this will only increase no of programs in the produiction servor and this many of these one are required for one time only, because we may require  to  create table miantenace for many z tables has a whole for the complete project.
My suggestion is to upload the data from excel by pasting (if possible) or manually.
Please correct me if I am wrong.
Thanks,
Vengal Rao.

Similar Messages

  • Upload an excel file to table data

    Hi  ,
    I could succesfully develope an application for uploading an excel file and displaying the data in tabular format (i.e through table  display ) .  But on  Action <<Export TO Table>> it is not showing the details in tabular format . After uploadinfg file it is providing successful msg but when i m clicking on Export to table it is not displaying table data .
    Its a demo WD program in java given below
    Could anybody please guide me in this approach ?
    public void onActionUploadFileData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        InputStream text = null;
        int temp = 0 ;
        String path ;
        try
                File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());
                FileOutputStream output = new FileOutputStream(file);
                if (wdContext.currentContextElement().getResource()!= null )
                      text = wdContext.currentContextElement().getResource().read(false);
                      while ((temp=text.read())!= -1)
                            output.write(temp);
                output.flush();
                output.close();
                path = file.getAbsolutePath();
                wdComponentAPI.getMessageManager().reportSuccess(path);
        catch (Exception ex)
          ex.printStackTrace();
      public void onActionExport_To_Table(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionExport_To_Table(ServerEvent)
        try {
          Workbook workbook = Workbook.getWorkbook(new File(path));
          Sheet sheet = workbook.getSheet(0);
          int columns = sheet.getColumns();
          int rows = sheet.getRows();
          int i=0;
          int j;
          for (j=1;j<=rows;j++)
                element = wdContext.nodeTableData().createTableDataElement();
                Cell cell1 = sheet.getCell(i,j);
                element.setEmpId(cell1.getContents());
                Cell cell2 = sheet.getCell(i+1,j);
                element.setFirstname(cell2.getContents());
                      Cell cell3 = sheet.getCell(i+2,j);
                      element.setLastname(cell3.getContents());
                      wdContext.nodeTableData().addElement(element);
         catch (Exception ex)
                ex.printStackTrace();
    Edited by: Trina_Saheli on Feb 26, 2010 4:22 PM

    Hi Trina,
    Check onAction method(onActionExporttotable) of "Export to Table ". Print the c1.getContents(), c2.getContents,c3.getContents value with MessageManager while setting vaule to node attribute.
    Once the all the attribute added to node TableData, print the table attribute in onActionExporttotable method itself.
    Also check the TableData node properties which is bind to table of displaying in the screen.
    Hopt it helps
    Regards,
    Arun

  • Upload the excel sheet in table maintenance

    Hi,
    I have a requirement to add a button in the application toolbar of the table maintenance screen of a custom table. This button should upload the excel sheet data into the maintenance screen online.
    I have created the button in the table maintenance generator. Also, uploaded the data into the internal table from the excel sheet.
    The problem is I am unable to populate the data from the internal table to the maintenance screen online.
    Any pointers in this regards will be appreciated.
    Thanks,
    Best regards,
    Ajith

    Hi Mukul,
      I created a custom table ZHEDGERES. Then in the table maintenance -> environment -> modification -> user interface I selected Individual interface.
      Then, in the Menu painter for the program SAPLZHEDGERES, modified the PF status EULG and added the additional button in the Application toolbar. This application toolbar needs to be used to trigger the upload of excel into the custom table.
      Below is the standard code which is generated in the screen painter of the custom table.
    PROCESS BEFORE OUTPUT.
    MODULE LISTE_INITIALISIEREN.
    LOOP AT EXTRACT WITH CONTROL
      TCTRL_ZHEDGERES CURSOR NEXTLINE.
       MODULE LISTE_SHOW_LISTE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
    MODULE LISTE_BEFORE_LOOP.
    LOOP AT EXTRACT.
       MODULE LISTE_INIT_WORKAREA.
       CHAIN.
        FIELD ZHEDGERES-HDATE .
        FIELD ZHEDGERES-CHAIN .
        FIELD ZHEDGERES-HEDGE_VALUE .
        FIELD ZHEDGERES-CURRENCY .
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
       ENDCHAIN.
       FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
       CHAIN.
        FIELD ZHEDGERES-HDATE .
        MODULE LISTE_UPDATE_LISTE.
       ENDCHAIN.
    ENDLOOP.
    MODULE LISTE_AFTER_LOOP. 
      Need to add logic to extract the values from the excel sheet to an internal table and append the values from the internal table to the table control of the table maintenance.
    Thanks,
    Best regards,
    Ajith

  • Upload multiple excel files into tables using APEX

    Hi folks,
    I'm wondering if anyone has ever uploaded multiple .csv files simultaniously and store the data into the database using APEX XE before.
    I can browse for a single file, and execute that okay and a good example of doing that can be found at http://advait.wordpress.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    This works fine when the user browses to a specific file on their network and then uploads the data from that one file.
    However I need the ability to 'grab' every file in a specific directory one after the other to process rather than having to specify which one to load everytime, and wondered if anyone has come across this before.
    Many thanks
    Graham.

    Just for completeness ...
    Got this to work, but it's a pl/sql issue as opposed to an APEX issue.
    Anyway, if anyone needs to have the ability to read multiple files then a quick easy way to do it (as lomg as they know the file names that will be read), is to create a directory on the database which points to the actual harddrive on your PC, then create a table (called an external table) and read from that external table as if it was an actual database table ...
    1 - Log on as sys and grant CREATE ANY DIRECTORY to whatever user you are logging in as (assuming you are not using sys to create apps)
    2 - Create a directory e.g....CREATE OR REPLACE DIRECTORY GB_TEST AS 'c:\gbtest';
    3 - Create an external table as ...
    CREATE TABLE gb_test
    (file_name varchar2(10),
    rec_date date
    rec_name VARCHAR2(20),
    rec_age number,
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY GB_TEST
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION ('data1.csv','data2.csv','data3.csv','data4.csv')
    PARALLEL 5
    REJECT LIMIT 20000;
    That's it then ...
    select * from gb_test
    where file_name = 'xxx'
    will return all the data where the file_name = 'xxx'
    very easy to use.

  • Authorization group for table maintenance view

    I  need to create table maintenence view for a custom table, client provide name for auth. group, but no clue how to create auth. group.
    can someone provide the steps to do this?

    Hi,
    Follow below steps to create table maintenance for a table and to assign authorization group to a table:
    step1: Go to SE11 enter the table name
    step2: In the standard toolbar you will find UTILITIES
    Go to UTILITIES -> TABLE MAINTENANCE GENERATOR
    You will go to first screen of Table maint. gen.
    Here you will find to enter authorization group.
    Thanks and Regards,
    Shravan G.

  • How to upload a word/excel doc for z table and view ltr

    Hi to all,
    I have a requirement to upload word/excel or ppt files from pc, so that i can store them in table with some other values. These files will be used by number of users to view or download.
    Please guide me how to upload the files and store the file deatils in z table so that users can view the file later.
    I can get a static folder to store all document in app server.
    Thanks in advance,
    Sanjeev

    hi
    use <b>gui_upload</b> to upload execl , txt ot dat files
    into itab & then append them into ztables which u hav to create.
    i'm not sure of ppt files
    *sample code to upload a text document to app.server
    open dataset v_header for output in text mode encoding default.
        if sy-subrc <> 0.
          message i000 with 'ERROR OPENING FILE'.
        endif.
        loop at gt_changed_pohd.
          transfer gt_changed_pohd to v_header.
        endloop.
      close dataset v_header.
    ****sample gui_upload to upload tab seperated text file
    ***to upload dat files use the seperator '|' instead ****of 'X' in the foll.
    call function 'GUI_UPLOAD'
          exporting
            filename                      = v_file
           filetype                      = p_type
           has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
          tables
            data_tab                      = gt_data
         exceptions
           file_open_error               = 1
           file_read_error               = 2
           no_batch                      = 3
           gui_refuse_filetransfer       = 4
           invalid_type                  = 5
           no_authority                  = 6
           unknown_error                 = 7
           bad_data_format               = 8
           header_not_allowed            = 9
           separator_not_allowed         = 10
           header_too_long               = 11
           unknown_dp_error              = 12
           access_denied                 = 13
           dp_out_of_memory              = 14
           disk_full                     = 15
           dp_timeout                    = 16
           others                        = 17

  • Upload excel data in a table maintenance view

    Hi,
      I have a requirement to add a button in the application toolbar of the table maintenance screen of a custom table. This button should upload the excel sheet data into the maintenance screen online.
      I have created the button in the table maintenance generator. Also, uploaded the data into the internal table from the excel sheet.
      The problem is I am unable to populate the data from the internal table to the maintenance screen online.
      Any pointers in this regards will be appreciated.
    Thanks,
    Best regards,
    Ajith

    Hi,
    I think you have to use BDC call transaction (SM30) and use that table control to upload the data. Try and see..
    Cheers,
    Phani.

  • Upload data from excel to oracle table

    Hi,
    if i'm user and using an application and i want to upload data from excel to oracle table on button click . Is it possible by using sql loader.
    If yes then please clarify it .
    is it possible from client end.
    thanks
    kam

    Yes it is possible using SQL*LDR, External tables and ORCL Export Utility. Though I didn't try Export Utility to load the external files.
    SQLLdr sysntax:
    Create a control file.
    It looks like this
    Load data
    Infile 'source.dat' 
    Into Table tablename
    Fields terminated by ',' optionally enclosed by '"'
    {code}
    then use sqlldr command from your OS.
    {code}
    sqlldr userid/password@sid control = filename.ctl, data = source.dat, log = logname.log, bad = badname.log, discard = discardname.discard
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Pasting data from Excel sheet to Table in web dynpro View

    Hii All,
    Is it possible to copy data ( some rows) from Excel sheet and paste in table in a view?
    I tried doing this, but only first element is getting pasted..
    Does anybody know how to do this?
    Is there any way to perform similar thing?
    Pls help.
    regards,
    Amey

    Hi,
    Copy paste may work if you have that many rows in your table(not sure).
    One thing you can do is upload the excel and then populate the context of the node bound to the table by fetching data from the excel
    For this you can make use of JXL or APACHE POI.
    Regards
    Ayyapparaj

  • Upload openoffice excel file into internal table

    Hi Everyone,
    I have a requirement where in we need to upload vendor master data into SAP.
    The data is available in excel format. But the excel sheet was created in openoffice s/w and client is not allowing
    us to install MS-Office so that we cut and paste the data by creating anexcel file.
    Now there is an option of saving the excel file in openoffice s/w as MS-Excel 95 format with .xls extension.
    But since we are saving this in openoffice enivoronment   the FM ALSM_EXCEL..... data is not improting this excel file into
    Did somebody faced this issue before. Pls share the approach to solve this issue.
    Regards,
    Vinay

    Hi !
    you can use the Function module TEXT_CONVERT_XLS_TO_SAP to upload xcel file to internal table
    please go through the code below.
    REPORT zupload_excel_to_itab.
    TYPE-POOLS: truxs.
    PARAMETERS: p_file TYPE rlgrap-filename.
    TYPES: BEGIN OF t_datatab,
    col1(30) TYPE c,
    col2(30) TYPE c,
    col3(30) TYPE c,
    END OF t_datatab.
    DATA: it_datatab type standard table of t_datatab,
    wa_datatab type t_datatab.
    DATA: it_raw TYPE truxs_t_text_data.
    At selection screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    field_name = 'P_FILE'
    IMPORTING
    file_name = p_file.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR =
    i_line_header = 'X'
    i_tab_raw_data = it_raw " WORK TABLE
    i_filename = p_file
    TABLES
    i_tab_converted_data = it_datatab[] "ACTUAL DATA
    EXCEPTIONS
    conversion_failed = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    END-OF-SELECTION.
    END-OF-SELECTION.
    LOOP AT it_datatab INTO wa_datatab.
    WRITE:/ wa_datatab-col1,
    wa_datatab-col2,
    wa_datatab-col3.
    ENDLOOP.
    hope this will help you.
    Regards,
    Kiran

  • Upload data from Excel to Internal table

    Hi,
    I am facing a peculiar problem in uploading the data in excel sheet to internal table.
    The excel file contains material number and product hierarchy number. The product hierarchy number for some material is downloaded as 5.73101E17 for the value 573100910115782000. Though I expand the sheet the display is the same 5.73101E17. When i upload the sheet using the f'n module "ALSM_EXCEL_TO_INTERNAL_TABLE" the value is taken as it is (5.73101E+17) into the internal table which is wrong. I tried to change the data type to type n. Then the value is uploaded as 5731011700000000.
    Please propose a solution to this without having to change the format of the column from general to "number without decimals"
    Regards,
    Sam

    HI
    see this example code which EXCEL TO INTERNAL TABLE AND THEN TO APPLICATION
    *& Report  ZSD_EXCEL_INT_APP
    REPORT  ZSD_EXCEL_INT_APP.
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       STATIC              = 'X'
      MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.

  • Upload data from Excel to Internal table in ECC

    Hello SDN,
    Here I am facing a problem for uploading the data from excel sheet to internal table in ECC6.0
    Main problem is we don't have any FM ALSM_EXCEL_TO_INTERNAL_TABLE.
    Please provide me the solution how to upload the data from excel to internal table through class. If possible please provide me the sample code so that it will be very helpful for me.
    Waitingfor your valuable response.
    Thanks & Regards,
    Kumar.

    Hi,
    you can use OLE to acces (not only) excel, but this will only work in dialog processing.
    regards,
    Hans

  • In SRM How to upload data from Excel to Internal Table

    Hello Experts,
    As seen the Function Module 'ALSM_EXCEL_TO_INTERNAL_TABLE' does not exists in SRM.
    Is there any alternative to upload the data direct from excel to Internal table using any other FM. As seach did't get any relevant FM.
    Please advice..
    Thanks..

    did u try this
    TEXT_CONVERT_XLS_TO_SAP
    in this manner
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header              = 'X'
          i_tab_raw_data             = lt_raw
          i_filename                 = p_path
        TABLES
          i_tab_converted_data       = gt_output
        EXCEPTIONS
          conversion_failed          = 1
          OTHERS                     = 2.
    this FM works on DOI
    so
    SAP document about DOI:
    http://help.sap.com/saphelp_nw2004s/helpdata/EN/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
    SAP Demo Program about DOI: SAPRDEMOEXCELINTEGRATION.
    the fm you mentioned works on OLE
    so you could refer,
    SAP document about OLE:
    http://help.sap.com/saphelp_46c/helpdata/EN/59/ae3c98488f11d189490000e829fbbd/frameset.htm
    Also you can refer this post
    Download of SRM Contracts in Excel - Unit of Measurement Missing
    Let me know if this works ..
    Regards
    Manthan.
    Edited by: Manthan_R on Feb 23, 2010 12:18 PM

  • To upload data from excel to internal table

    hi
    in excel sheet it contains 4 tabs.to upload data from excel to internal table i have used this fm
    text_convert_xls_to_sap .but error wil comeing.that error in tables parameter.iternal table does not contain data.ple help me.(v 6.0) ple give me one example with coding

    Hello,
    Take a look on this: [ABAP - Upload data from Excel to Sap using OO|https://wiki.sdn.sap.com/wiki/x/xOw].
    Regards.

  • Error in Upload file-table or view does not exist-wwv_flow_file_objects$

    Hi,
    i am trying to upload a file and then store the contents of the file into one of my tables in the schema.I wrote one package for uploading the file and then a process to insert each record in the uploaded file to the table in my schema.When i try compiling the package it gives an error.
    PL/SQL: ORA-00942: table or view does not exist
    The name of the table is wwv_flow_file_objects$
    The package is as follows-
    CREATE OR REPLACE PACKAGE BODY Text_File_Pkg AS
    FUNCTION get_file_lines (
    p_file_name IN VARCHAR2,
    p_lines IN OUT line_tab_type,
    p_rec_sep IN VARCHAR2 DEFAULT dos_new_line
    ) RETURN INTEGER
    IS
    v_binary_file BLOB;
    v_text_file CLOB;
    v_dest_offset INTEGER := 1;
    v_src_offset INTEGER := 1;
    v_lang_context INTEGER := DBMS_LOB.default_lang_ctx;
    v_warning INTEGER;
    v_rec_sep_len CONSTANT INTEGER := LENGTH(p_rec_sep);
    v_start_pos INTEGER := 1;
    v_end_pos INTEGER := 1;
    v_line_num INTEGER := 1;
    v_file_length INTEGER;
    BEGIN
    IF p_file_name IS NULL
    THEN
    RETURN 1;
    END IF;
    IF p_rec_sep IS NULL
    THEN
    RETURN 2;
    END IF;
    SELECT blob_content
    INTO v_binary_file
    FROM wwv_flow_file_objects$
    WHERE NAME = p_file_name
    AND (mime_type = 'text/plain' OR mime_type = 'application/octet-stream')
    AND doc_size &gt; 0;
    DBMS_LOB.createtemporary(v_text_file, TRUE);
    DBMS_LOB.converttoclob(v_text_file, v_binary_file,
    DBMS_LOB.lobmaxsize, v_dest_offset,
    v_src_offset, DBMS_LOB.default_csid,
    v_lang_context, v_warning);
    IF v_warning = DBMS_LOB.warn_inconvertible_char
    THEN
    -- Unable to convert file.
    RETURN 3;
    END IF;
    v_file_length := DBMS_LOB.getlength(v_text_file);
    LOOP
    EXIT WHEN v_start_pos &gt; v_file_length;
    v_end_pos := DBMS_LOB.INSTR(v_text_file, p_rec_sep, v_start_pos);
    IF v_end_pos = 0
    THEN
    v_end_pos := v_file_length + 1;
    END IF;
    IF (v_end_pos - v_start_pos) &gt; 4000
    THEN
    -- Line exceeds 4000 characters.
    RETURN 4;
    END IF;
    p_lines(v_line_num) := DBMS_LOB.SUBSTR(v_text_file, v_end_pos - v_start_pos, v_start_pos);
    v_line_num := v_line_num + 1;
    v_start_pos := v_end_pos + v_rec_sep_len;
    END LOOP;
    RETURN 0;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    RETURN 5;
    END get_file_lines;
    END Text_File_Pkg;
    Any suggestions.
    Many Thanks,
    Sanjai

    Hi,
    i am trying to upload a file and then store the contents of the file into one of my tables in the schema.I wrote one package for uploading the file and then a process to insert each record in the uploaded file to the table in my schema.When i try compiling the package it gives an error.
    PL/SQL: ORA-00942: table or view does not exist
    The name of the table is wwv_flow_file_objects$
    The package is as follows-
    CREATE OR REPLACE PACKAGE BODY Text_File_Pkg AS
    FUNCTION get_file_lines (
    p_file_name IN VARCHAR2,
    p_lines IN OUT line_tab_type,
    p_rec_sep IN VARCHAR2 DEFAULT dos_new_line
    ) RETURN INTEGER
    IS
    v_binary_file BLOB;
    v_text_file CLOB;
    v_dest_offset INTEGER := 1;
    v_src_offset INTEGER := 1;
    v_lang_context INTEGER := DBMS_LOB.default_lang_ctx;
    v_warning INTEGER;
    v_rec_sep_len CONSTANT INTEGER := LENGTH(p_rec_sep);
    v_start_pos INTEGER := 1;
    v_end_pos INTEGER := 1;
    v_line_num INTEGER := 1;
    v_file_length INTEGER;
    BEGIN
    IF p_file_name IS NULL
    THEN
    RETURN 1;
    END IF;
    IF p_rec_sep IS NULL
    THEN
    RETURN 2;
    END IF;
    SELECT blob_content
    INTO v_binary_file
    FROM wwv_flow_file_objects$
    WHERE NAME = p_file_name
    AND (mime_type = 'text/plain' OR mime_type = 'application/octet-stream')
    AND doc_size &gt; 0;
    DBMS_LOB.createtemporary(v_text_file, TRUE);
    DBMS_LOB.converttoclob(v_text_file, v_binary_file,
    DBMS_LOB.lobmaxsize, v_dest_offset,
    v_src_offset, DBMS_LOB.default_csid,
    v_lang_context, v_warning);
    IF v_warning = DBMS_LOB.warn_inconvertible_char
    THEN
    -- Unable to convert file.
    RETURN 3;
    END IF;
    v_file_length := DBMS_LOB.getlength(v_text_file);
    LOOP
    EXIT WHEN v_start_pos &gt; v_file_length;
    v_end_pos := DBMS_LOB.INSTR(v_text_file, p_rec_sep, v_start_pos);
    IF v_end_pos = 0
    THEN
    v_end_pos := v_file_length + 1;
    END IF;
    IF (v_end_pos - v_start_pos) &gt; 4000
    THEN
    -- Line exceeds 4000 characters.
    RETURN 4;
    END IF;
    p_lines(v_line_num) := DBMS_LOB.SUBSTR(v_text_file, v_end_pos - v_start_pos, v_start_pos);
    v_line_num := v_line_num + 1;
    v_start_pos := v_end_pos + v_rec_sep_len;
    END LOOP;
    RETURN 0;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    RETURN 5;
    END get_file_lines;
    END Text_File_Pkg;
    Any suggestions.
    Many Thanks,
    Sanjai

Maybe you are looking for

  • Flash and quicktime export not possible at all!

    hi iwork dev team! as there was no result on my prev post, here again: i use keynote'08 4.02 on imac with 2gb and osx 10.5.2. i created a presentation with 15 slides and over all 16,5 minutes. each slide has a mp3 sound file attached (the speakers vo

  • HT5731 I have an iPhone 4S and when I sync it, the "purchased" and "recently added" playlists do not show up on my phone.

    I have an iPhone 4S and when I sync it, the "purchased" and "recently added" playlists do not show up on my phone. For some reason I can't get all the playlists I have set up in iTunes to show up on my phone. 

  • Constraint with condition?

    I need some help with creating some sort of a constraint or check on a table row. I have the following table: create table mytable o_no number null, o_name varchar2(255) null, type char(1) not null, valid char(1) not null alter table mytable add cons

  • Concept of Commit Unit in OWB

    Hi All, Asking this question again. How does OWB cope with the concept of a commit unit? In PL/SQL, you have rollback, and savepoint. What happens if you have to insert child records and rollback the changes. - Jojo

  • Where can I get Lion?

    Now that Mountain Lion has been released, and the App Store confirms that it will not run on my Mac Pro tower, where can I get Lion?  I'm currently running Snow Leopard but would obviously like to move up to the latest available OS for my machine. Un