Background processing and downloading the data into File

Hi ,
Can you please let me know how to find out the Programname whic is downloadng the data into Excel sheet from application server...
thanks

Hi Ramreddy,
You can use: CG3Y : Transactions for uploading from application server to
                                 Presentation server
                      CG3Z : Transactions for uploading from Presentation server- to
                                 Application server
In both the cases u can put the path to spreadsheet to download to excel...
Reward if found useful....
Message was edited by:
        Susanth Swain

Similar Messages

  • How can i open a DOC or TXT file and insert the data into table?

    How can i open a DOC or TXT file and insert the data into table?
    I have a doc file . the doc include some columns and some rows.(for example 'ID,Name,Date,...').
    I'd like open DOC file and I'd like insert them into the table with same columns.
    Thanks.

    Use the SQL*Loader utility or the UTL_FILE package.

  • Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin

    Hi ,
    We have a catalog that defines 2 types of products (they have too many different properties), so wanted to keep them on two different MDEX engines and serve the applications requests. Here DB catalog and front end ATG application is same for both the MDEX instances.
    Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin?
    Thanks
    Dev

    Hi, also have had some problem some monthes ago - I created separete component ProductCatalogSimpleIndexingAdminSecond. After that one of my colleage gave me some advice:
    The creating separate component like ProductCatalogSimpleIndexingAdmin for the second IOC is possible way for resolving your situation. But I afraid that this way will be required creating mane duplicates for already existed components.
    In my opinion the better way is the following:
    starting from AssemblerApplicationConfiguration and ApplicationConfiguration component. It contains details for connecting between ATG and Endeca. Of course you should configure different components for different Endeca Apps.
    After that:
    Find all components that uses AssemblerApplicationConfiguration and ApplicationConfiguration. Customize these components for using one or another  *Configuration component depending on what index works. (many variants released it: the most simple global custom component with flag.)
    Then customize the existed ProductCatalogSimpleIndexingAdmin. Using one or another IOC  and setting the flag in global custom component when index started. You can add some methods into your custom ProductCatalogSimpleIndexingAdmin like:
    Execute baseline index for both IOC (one by one)
    Execute baseline for IOC 1
    Execute baseline for IOC 2.
    Note: you should be afraid about incremental (partial) index in this configuration. But resolving conflicts in incremental index should be done after full implementation these changes.
    Regards

  • Can i get the easy process to download the data from CDHDR & CDPOS?

    Hi,
    I want to download the data from CDHDR & CDPOS..i tried with GUI_download..but i am unable to download the huge date into XLS sheet so, can any one help me in this to download the data from CDHDR & CDPOS?
    for a month in single execution(Min for Month).
    Can i get the easy process to download the data from CDHDR & CDPOS?
    Thanks,
    Kumar.

    split your internal tables in each 65K till office 2003 and 1048576 for office 2010
    and then keep downloading part by part..

  • Connecting to SQl server ( MS acess front end) and pull the data into BI

    Dear all,
    i need to extract the data from SQl server ( MS acess front end) and pull the data into BI .
    i need to know what are the steps need to follow on this..
    can any one help me on this...!
    Thanks,
    Siva

    Hi,
    1. login to sql server u2013 with ur server credentials  and connect.
    2. select ur sql for ex: sap bw
    3. Right click u2013 sapbw - task - export data  From sql to excel I m exporting So give sql details 
    4. Destination u2013 select excel.. and browse where u want to save the fileu2026
    5. give next
    6. select from which table u want to export
    7. click on  next
    8. click on finish
    9. close
    10. go to desktop and open the xyz.xls file
    11. not make it as csv file and load the data to BI as a flat file
    Hope it will help you.
    Regards,

  • Download the data into excel sheet

    hello experts,
    I am using the GUI_DOWNLOAD fm to download the data in to excell sheet on to the desktop but here i am getting some problem
    For some of the fields i put constant values like '004' or '001' when it is downloaded the data into to .xls its removing the leading zeros.. and just downloading the values as 4 or 1
    can anyone guide me how to hold those leading zeros
    its bit urgent plz

    These are XL Issue ,you can use diffrenet logic
    Check the below logic :
    REPORT ZTEST3 line-size 400.
    <b>DATA : V_CHAR(1) TYPE C VALUE ''''.</b>
    data : v_field(12) type c.
    data : begin of itab occurs 0,
           fld1(12) type c,
           end of itab.
    start-of-selection.
    v_field = '0000012345'.
    CONCATENATE V_CHAR  V_FIELD  INTO V_FIELD.
    itab-fld1 = v_field.
    append itab.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
        FILENAME                      =
        'C:\Documents and Settings\smaramreddy\Desktop\fff.xls'
       FILETYPE                      = 'ASC'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = itab
      FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       OTHERS                        = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    I have used one field here ,i am not sure for many fields in internal table.
    Thanks
    Seshu

  • Dynamically generating the ssrs dataset and filling the data into the dataset and binding it to ssrs report dynamically

    I have a work to do, in ssrs we are using server reports in our project. i am looking for dynamically generating the ssrs dataset and filling the data into the dataset and binding the dataset to ssrs report(RDL) dynamically.
    Getting the dataset dynamically has a solution by using Report Definition Customization Extension (RDCE), but the problem is binding that dataset to the report(RDL) dynamically was not there.
    Here is the reference for RDCE http://www.codeproject.com/Articles/355461/Dynamically-Pointing-to-Shared-Data-Sources-on-SQL#6
    I looked for binding the dataset to the report(RDL) dynamically and searched many sites but i did not get the solution. Can anyone help me here.
    Is there any custom assemblies or any Custom data processing extensions to work around. Please help.
    Thanks in advance

    Hi Prabha2233,
    Thank you for your question.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Taking the data from interactive forms and load the data into SAP system?

    hi all,
    I want to know how to take the data from interactive forms and load the data into sap system?
    if u have any sample scenario, explain with that.
    thanks in advance
    Raja

    Hello,
    Check the program...
    SAPBC480_DEMO.
    Check the below threads
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/88e7ea34-0501-0010-95b0-ed14cfbeb85a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bfbcd790-0201-0010-679d-e36a3c6b89fa
    Thanks
    Seshu

  • (Urgent help needed) how to read txt file and store the data into 2D-array?

    Hi, I have a GUI which allow to choose file from the file chooser, and when "Read file" button is pressed, I want to show the array data into the textarea.
    The sample data is like this followed:
    -0.0007     -0.0061     0.0006
    -0.0002     0.0203     0.0066
    0     0.2317     0.008
    0.0017     0.5957     0.0008
    0.0024     1.071     0.0029
    0.0439     1.4873     -0.0003
    I want my program to scan through and store these data into 2D array.
    However for some reason, my source code issues errors, and I don't know what's wrong with it, seems to have a problem in StringTokenizer though. Can anybody help me?
    Thanks in advance.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.StringTokenizer;
    public class FileReduction1 extends JFrame implements ActionListener{
    // GUI features
    private BufferedReader fileInput;
    private JTextArea textArea;
    private JButton openButton, readButton,processButton,saveButton;
    private JTextField textfield;
    private JPanel pnlfile;
    private JPanel buttonpnl;
    private JPanel buttonbar;
    // Other fields
    private File fileName;
    private String[][] data;
    private int numLines;
    public FileReduction1(String s) {
    super(s);
    // Content pane
         Container cp = getContentPane();
         cp.setLayout(new BorderLayout());     
    // Open button Panel
    pnlfile=new JPanel(new BorderLayout());
         textfield=new JTextField();
         openButton = new JButton("Open File");
    openButton.addActionListener(this);
    pnlfile.add(openButton,BorderLayout.WEST);
         pnlfile.add(textfield,BorderLayout.CENTER);
         readButton = new JButton("Read File");
    readButton.addActionListener(this);
         readButton.setEnabled(false);
    pnlfile.add(readButton,BorderLayout.EAST);
         cp.add(pnlfile, BorderLayout.NORTH);
         // Text area     
         textArea = new JTextArea(10, 100);
    cp.add(new JScrollPane(textArea),BorderLayout.CENTER);
    processButton = new JButton("Process");
    //processButton.addActionListener(this);
    saveButton=new JButton("Save into");
    //saveButton.addActionListener(this);
    buttonbar=new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonpnl=new JPanel(new GridLayout(1,0));
    buttonpnl.add(processButton);
    buttonpnl.add(saveButton);
    buttonbar.add(buttonpnl);
    cp.add(buttonbar,BorderLayout.SOUTH);
    /* ACTION PERFORMED */
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Open File")) getFileName();
         if (event.getActionCommand().equals("Read File")) readFile();
    /* OPEN THE FILE */
    private void getFileName() {
    // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
    if (result == JFileChooser.APPROVE_OPTION)
         fileName = fileChooser.getSelectedFile();
    textfield.setText(fileName.getName());
         if (checkFileName()) {
         openButton.setEnabled(false);
         readButton.setEnabled(true);
         // Obtain selected file
    /* READ FILE */
    private void readFile() {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines();
         data = new String[numLines][];
         // Read file
         readTheFile();
         // Output to text area     
         textArea.setText(data[0][0] + "\n");
         for(int index=0;index < data.length;index++)
    for(int j=1;j<data[index].length;j++)
    textArea.append(data[index][j] + "\n");
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines() {
    int counter = 0;
         // Open the file
         openFile();
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile();
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* READ FILE */
    private void readTheFile() {
    // Open the file
    int row=0;
    int col=0;
         openFile();
    System.out.println("Read the file");     
         // Loop through file incrementing counter
         try {
    String line = fileInput.readLine();
         while (line != null)
    StringTokenizer st=new StringTokenizer(line);
    while(st.hasMoreTokens())
    data[row][col]=st.nextToken();
    System.out.println(data[row][col]);
    col++;
    row++;
    closeFile();
    catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName() {
         if (fileName.exists()) {
         if (fileName.canRead()) {
              if (fileName.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* FILE HANDLING UTILITIES */
    /* OPEN FILE */
    private void openFile() {
         try {
         // Open file
         FileReader file = new FileReader(fileName);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File opened");
    /* CLOSE FILE */
    private void closeFile() {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    /* MAIN METHOD */
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException {
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Java.lang.NullpointException
    at FileReductoin1.readTheFile <FileReduction1.java :172>
    at FileReductoin1.readFile <FileReduction1.java :110>
    at FileReductoin1.actionPerformed <FileReduction1.java :71>
    .

    1) Next time use the CODE tags. this is way too much unreadable crap.
    2) The problem is your String[][] data.... the only place I see you do anything approching initializing it is
    data = new String[numLines][];I think you want to do this..
    data = new String[numLines][3];anyway that's why it's blowing up on the line
    data[row][col]=st.nextToken();

  • How to create a procedure in oracle to write the data into file

    Hi All,
    I am just wondered on how to create a procedure which will do following tasks:
    1. Concat the field names
    2. Union all the particular fields
    3. Convert the date field into IST
    4. Prepare the statement
    5. write the data into a file
    Basically what I am trying to achieve is to convert one mysql proc to oracle. MySQL Proc is as follows:
    DELIMITER $$
    USE `jioworld`$$
    DROP PROCEDURE IF EXISTS `usersReport`$$
    CREATE DEFINER=`root`@`%` PROCEDURE `usersReport`(IN pathFile VARCHAR(255),IN startDate TIMESTAMP,IN endDate TIMESTAMP )
    BEGIN
    SET @a= CONCAT("(SELECT 'User ID','Account ID','Gender','Birthdate','Account Registered On') UNION ALL (SELECT IFNULL(a.riluid,''),IFNULL(a.rilaccountid,''),IFNULL(a.gender,''),IFNULL(a.birthdate,''),IFNULL(CONVERT_TZ(a.creationDate,'+0:00','+5:30'),'') INTO OUTFILE '",pathFile,"' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' FROM account_ a where a.creationDate>='",startDate,"' and a.creationdate <='",endDate,"')");
    PREPARE stmt FROM @a;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt ;
    END$$
    DELIMITER ;
    Regards,
    Vishal G

    1. Concat the field names
    Double Pipe (||) is the concatenation operator in Oracle. There is also a function CONCAT for this purpose
    2. Union all the particular fields
    Not sure what do you mean by UNION ALL particular fields? UNION ALL is a set operation applied on two different result sets that have the same projection.
    3. Convert the date field into IST
    SQL> select systimestamp "Default Time"
      2       , systimestamp at time zone 'Asia/Calcutta' "IST Time"
      3    from dual;
    Default Time                                       IST Time
    05-05-15 03:14:52.346099 AM -04:00                 05-05-15 12:44:52.346099 PM ASIA/CALCUTTA
    4. Prepare the statement
    What do you mean by prepare the statement?
    5. write the data into a file
    You can use the API UTL_FILE to write to a file.

  • Downloading the data into excel sheet , how can i maintain page numbers

    I need some information. In output screen pagenumber is displayed.
    when i am downloading the data from se38 into excel sheet.
    How can i write the code to display the page number in excel sheet . waiting for your response

    Hi
    Please see below code for ur requirement.
    DATA: BEGIN OF li_field OCCURS 0,
              field(16) TYPE c,
           END OF li_field.
      CLEAR li_field[].
      REFRESH li_field.
      li_field-field = text-t01.
      APPEND li_field.
      CLEAR  li_field.
      li_field-field = text-006.
      APPEND li_field.
      CLEAR  li_field.
      li_field-field = text-t04.
      APPEND li_field.
      CLEAR  li_field.
      li_field-field = text-t05.
      APPEND li_field.
      CLEAR  li_field.
      CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          file_name                 = file_path
        TABLES
          data_tab                  = data_table
          fieldnames                = li_field
        EXCEPTIONS
          file_not_exist            = 1
          filename_expected         = 2
          communication_error       = 3
          ole_object_method_error   = 4
          ole_object_property_error = 5
          invalid_pivot_fields      = 6
          download_problem          = 7
          OTHERS                    = 8.
    please reward points if helpful

  • Stage tab delimited CSV file and load the data into a different table

    Hi,
    I pretty new to writing PL/SQL packages.
    We are using Application express for our development. We get CSV files which is stored as a BLOB content in a table. I need to write a trigger that would get executed once the user the uploads the file and parse thru the Blob content and upload or stage the data in a different table.
    I would like to see if there is any tutorial or article that could explain the above process with the example or sample code to do the same. Any help in this regard will be highly appreciated.

    Hi,
    This is slightly unusual but at the same time easy to solve. You can read through a blob using the dbms_lob package, which is one of the Oracle supplied packages. This is presumably the bit you are missing, as once you know how you read a lob the rest is programming 101.
    Alternatively, you could write the lob out to a file on the server using another built in package called utl_file. This file can be parsed using an appropriately defined external table. External tables are the easiest way of reading data from flat files, including csv.
    I say unusual because why are you loading a csv file into a blob? A clob is almost understandable but if you can load into a column in a table why not skip this bit and just load the data as it comes in straight into the right table?
    All of what I have described is documented functionality, assuming you are on 9i or greater. But you didn't provide a version so I can't provide a link to the documentation ;)
    HTH
    Chris

  • Parsing an EDI file and populating the data into database table

    Hi ,
    Please help me in parsing an edi file and getting the required columns.
    we get an EDI file from a bank. I need to parse that file and populate the db table with the required columns.
    the file is '*' delimited and every line ends with '\'.
    The record starts with 'ST*' and ends with 'SE*'.
    sample edi file is
    ISA*00*          *00*          *ZZ*043000096820   *ZZ*2156833510     *131202*0710*U*00401*000001204*0*P*>\  ignore first 2 lines                                                                                                                                                                                              
    GS*RA*043000096820*2156833510*131202*0710*1204*X*003020\                                                                                                                                                                                                                                                  
    ST*820*000041031\                                                                                                                                                                                                                                                                                     
    BPR*X*270*C*ACH*PPD*01*101036669***9101036669**01*031000053*DA*00000008606086714*131202\                                                                                                                                                                                                                  
    TRN*1*101036661273032\                                                                                                                                                                                                                                                                                    
    DTM*007*131202\                                                                                                                                                                                                                                                                                           
    N1*1U*BPS\                                                                                                                                                                                                                                                                             
    N1*BE*MICHAEL    DRAYTON*34*159783633\                                                                                                                                                                                                                                                                    
    N1*PE*BPS*ZZ*183383689C2 ABC\                                                                                                                                                                                                                                                          
    N1*PR*ABC  TREAS 310\                                                                                                                                                                                                                                                                                     
    SE*9*000041031\ ST*820*000041032\                                                                                                                                                                                                                                                                                         
    BPR*X*686*C*ACH*PPD*01*101036669***9101036669**01*031000053*DA*00000008606086714*131202\                                                                                                                                                                                                                  
    TRN*1*101036661273034\                                                                                                                                                                                                                                                                                    
    DTM*007*131202\                                                                                                                                                                                                                                                                                           
    N1*1U*BPS\                                                                                                                                                                                                                                                                             
    N1*BE*SAMIA      GRAVES*34*892909238\                                                                                                                                                                                                                                                                     
    N1*PE*BPS*ZZ*184545710C5 ABC\                                                                                                                                                                                                                                                          
    N1*PR*ABC  TREAS 310\                                                                                                                                                                                                                                                                                     
    SE*9*000041032\
    Below is the procedure I am trying to use for parsing that file. but the logic is not working. can you please help me in doing this. its very urgent requirement.
    CREATE OR REPLACE package body p1 is
    Function parse_spec(p_str varchar2) return t_str_nt is
    begin
          return regexp_replace(p_str,'\\$',null);
    end;
    procedure edi( is
    l_out_file              utl_file.file_type;
    l_lin                 varchar2(200);
    field1            number(9);
    field2                varchar2(10 byte);
    field3           varchar2(15 byte);
    field4               varchar2(15 byte);
    field5              varchar2(20 byte);
    field6             varchar2(20 byte);
    field7              varchar2(20 byte);
    field8                  varchar2(9 byte);
    field9              varchar2(15 byte);
    field10             varchar2(5 byte);
    l_item_nt             t_str_nt:=t_str_nt();
    begin
       l_out_file  := utl_file.fopen (file_path, file_name, 'r');
       IF utl_file.is_open(l_out_file) THEN
        LOOP
          BEGIN
           l_item_nt:= utl_file.get_line(l_out_file, l_lin);
            IF l_item_nt IS NULL THEN
              raise no_data_found;
            Else
              for k in 1..l_item_nt.count loop
                  case
                   when l_item_nt(k) like 'ST*%' then
                           field1:= ltrim(regexp_substr(parse_spec(l_item_nt(k)),'[^*]+',1,3),0);
                   when l_item_nt(k) like 'BPR*X*%' then
                           field2 := regexp_substr(parse_spec(l_item_nt(k)),'[^*]+',1,3);
                    when l_item_nt(k) like 'TRN*1*%' then
                             field3:= regexp_substr(parse_spec(l_item_nt(k)),'[^*]+',1,3);
                    when l_item_nt(k) like 'DTM*007*%' then
                            field4:= regexp_substr(parse_spec(l_item_nt(k)),'[^*]+',1,3);
                    when l_item_nt(k) like '%*BE*%' then
                            field5 := regexp_substr(regexp_substr(parse_spec(l_item_nt(k)),'[^*]+',1,3),'[^ ]+', 1, 1);
                            field6 := regexp_substr(regexp_substr(parse_spec(l_item_nt(k)),'[^*]+',1,3),'[^ ]+', 1, 1);
                             field7  := regexp_substr(parse_spec(l_item_nt(k)),'[^*]+',1,5);
                    when l_item_nt(k) like '%*PE*%*ZZ*%' then
                            field8:= regexp_substr(regexp_substr(parse_spec(line),'[^*]+',1,5),'[^ ]+',1,1)
                            field9 := regexp_substr(regexp_substr(parse_spec(line),'[^*]+',1,5),'[^ ]+',1,2);
                     when l_item_nt(k) like 'SE*%' then
                                                         insert into t1(field1,field2,field3,field5,field6,field7,field8,field9)
                                --  values(field1,field2,field3,field5,field6,field7,field8,field9);
                     else
                            dbms_output.put_line ('end of line');
                         end case;
                end loop;
            end if;
    end loop;
                         utl_file.fclose(l_out_file);
    exception
       when no_data_found then
                   dbms_output.put_line('No data found');
       end;

    I would not use regular expressions for parsing as it is CPU intensive - and standard string processing suffices.
    I would break the EDI up into lines. I would tokenise each line. I then have 2d array that can be referenced to find a specific field. E.g. line x and token y is field abc.
    Basic approach:
    SQL> create or replace type TStrings as table of varchar2(4000);
      2  /
    Type created.
    SQL> -- create a parser that tokenises a string
    SQL> create or replace function Tokenise(
      2          csvLine varchar2,
      3          separator varchar2 default ',',
      4          enclosedBy varchar2 default null
      5  ) return TStrings is
      6          strList         TStrings;
      7          str             varchar2(32767);
      8          i               integer;
      9          l               integer;
    10          enclose1        integer;
    11          enclose2        integer;
    12          encloseStr      varchar2(4000);
    13          replaceStr      varchar2(4000);
    14
    15          procedure AddString( line varchar2 ) is
    16          begin
    17                  strList.Extend(1);
    18                  strList( strList.Count ) := Replace( line, CHR(0), separator );
    19          end;
    20
    21  begin
    22          strList := new TStrings();
    23
    24          str := csvLine;
    25          loop
    26                  if enclosedBy is not null then
    27                          -- find the ennclosed text, if any
    28                          enclose1 := InStr( str, enclosedBy, 1 );
    29                          enclose2 := InStr( str, enclosedBy, 2 );
    30
    31                          if (enclose1 > 0) and (enclose2 > 0) and (enclose2 > enclose1) then
    32                                  -- extract the enclosed string
    33                                  encloseStr := SubStr( str, enclose1, enclose2-enclose1+1 );
    34                                  -- replace the separator char's with zero char's
    35                                  replaceStr := Replace( encloseStr, separator, CHR(0) );
    36                                  -- and remove the enclosed quotes
    37                                  replaceStr := Replace( replaceStr, enclosedBy );
    38                                  -- change the enclosed string in the big string to the replacement string
    39                                  str := Replace( str, encloseStr, replaceStr );
    40                          end if;
    41                  end if;
    42
    43                  l := Length( str );
    44                  i := InStr( str, separator );
    45
    46                  if i = 0 then
    47                          AddString( str );
    48                  else
    49                          AddString( SubStr( str, 1, i-1 ) );
    50                          str := SubStr( str, i+1 );
    51                  end if;
    52
    53                  -- if the separator was on the last char of the line, there is
    54                  -- a trailing null column which we need to add manually
    55                  if i = l then
    56                          AddString( null );
    57                  end if;
    58
    59                  exit when str is NULL;
    60                  exit when i = 0;
    61          end loop;
    62
    63          return( strList );
    64  end;
    65  /
    Function created.
    SQL>
    SQL>
    SQL> declare
      2          ediDoc  varchar2(32767) :=
      3  'ISA*00*          *00*          *ZZ*043000096820   *ZZ*2156833510     *131202*0710*U*00401*000001204*0*P*>\GS*RA*043000096820*2156833510*131202*0710*1204*X*003020\ST*820*000041031\BPR*X*270*C*ACH*PPD*01*101036669***9101036669**01*031000053*DA*00000008606086714*131202\TRN*1*101036661273032\DTM*007*131202\N1*1U*BPS\N1*BE*MICHAEL      DRAYTON*34*159783633\N1*PE*BPS*ZZ*183383689C2 ABC\N1*PR*ABC  TREAS 310\SE*9*000041031\ST*820*000041032\BPR*X*686*C*ACH*PPD*01*101036669***9101036669**01*031000053*DA*00000008606086714*131202\TRN*1*101036661273034\DTM*007*131202\N1*1U*BPS\N1*BE*SAMIA        GRAVES*34*892909238\N1*PE*BPS*ZZ*184545710C5 ABC\N1*PR*ABC  TREAS 310\SE*9*000041032\';
      4
      5          lines   TStrings;
      6          tokens  TStrings;
      7  begin
      8          -- split EDI string into lines
      9          lines := Tokenise( ediDoc, '\' );
    10
    11          -- process line and extract fields
    12          for i in 3..lines.Count loop
    13                  dbms_output.put_line( '***********************' ) ;
    14                  dbms_output.put_line( 'line=['||lines(i)||']' );
    15                  tokens := Tokenise( lines(i), '*' );
    16
    17                  for j in 1..tokens.Count loop
    18                          dbms_output.put_line( to_char(j,'00')||'='||tokens(j) );
    19                  end loop;
    20          end loop;
    21  end;
    22  /
    line=[ST*820*000041031]
    01=ST
    02=820
    03=000041031
    line=[BPR*X*270*C*ACH*PPD*01*101036669***9101036669**01*031000053*DA*00000008606086714*131202]
    01=BPR
    02=X
    03=270
    04=C
    05=ACH
    06=PPD
    07=01
    08=101036669
    09=
    10=
    11=9101036669
    12=
    13=01
    14=031000053
    15=DA
    16=00000008606086714
    17=131202
    line=[TRN*1*101036661273032]
    01=TRN
    02=1
    03=101036661273032
    <snipped>

  • Want to Read the a txt file and put the data into the table colums.

    I have a text file in which data is piped separated and I want to put the data in the table column.
    Eg.
    Text File Column
    First_name|Last_name|address|phone_number
    Database table:
    first_name ,last_name,address,phone_number
    It's very urgent.
    Thanks For your help in advance.
    Himanshu

    Use sqlldr or external file.
    See http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/part_ldr.htm#i436326 for SQL Loader.
    See http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/tables013.htm#ADMIN11705 for External table.

  • How to read a table and transfer the data into an internal table?

    Hello,
    I try to read all the data from a table (all attribute values from a node) and to write these data into an internal table. Any idea how to do this?
    Thanks for any help.

    Hi,
    Check this code.
    Here i creates context one node i.e  flights and attributes are from SFLIGHT table.
    DATA: lo_nd_flights TYPE REF TO if_wd_context_node,
            lo_el_flights TYPE REF TO if_wd_context_element,
            ls_flights TYPE if_main=>element_flights,
            it_flights type if_main=>elements_flights.
    navigate from <CONTEXT> to <FLIGHTS> via lead selection
      lo_nd_flights = wd_context->get_child_node( 'FLIGHTS' ).
    CALL METHOD LO_ND_FLIGHTS->GET_STATIC_ATTRIBUTES_TABLE
      IMPORTING
        TABLE  = it_flights.
    now the table data will be in internal table it_flights.

Maybe you are looking for