Problem in reading no. of files and writing into a single file

Hi,
Iam with Problem in reading no. of files and writing into a single file....
Iam reading no. of files stored in local directory.......
Iam able to read and print the data in files successfully....but while writing..only first file is being written...and the next files are not written in my output file...
plz tell me my mistake....I hope Iam doing some mistake while writing into file...PLz help.....
Basically my code structure is like this....
import java.io.*;
import java.util.regex.*;
import java.util.*;
import java.text.*;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFCell;
class Writing {
public static void main(String args[]) throws Exception {
          FileOutputStream fileOut = new FileOutputStream("ServerResult.xls"); //my output file
          int counter = 1;
          File dir = new File("C:/Perform/ServerLogs");
          String[] children = dir.list();
          if( children == null)
               System.out.println("The Directory mentioned does not exist");
          else {
               for (int fileNo = 0; fileNo < children.length; fileNo++ ) {        //Files iteration starts
                    String filename = children[fileNo];
          File logFile = new File(filename);
FileReader logFileReader = new FileReader(logFile);
BufferedReader logReader = new BufferedReader(logFileReader);
StringBuffer sBuf = new StringBuffer(5000);
          HSSFWorkbook wb = new HSSFWorkbook();          
          HSSFSheet sheet = wb.createSheet();
          HSSFRow rowTitle;
          HSSFRow rowReq;
          HSSFRow rowRes;
String aLine = null;
boolean skip = false;
boolean readed = false;
boolean initReq = false;
          boolean flag = false;
long requestTime = 0;
long responseTime = 0;
long recdTime = 0;
long sentTime = 0;
          long hasTime = 0;
          long presentTime = 0;
          int hasCalls = 0;
Pattern startMessage = Pattern.compile("^<MESSAGE.*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
Pattern requestMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"RequestMsg.\".*ID=\".*_"+args[0]+"\".*<ActName>(.*)</ActName>.*", Pattern.DOTALL);
Pattern requestMessage1 = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"RequestMsg.\".*ID=\".*_"+args[0]+"\".*<Svc id=\"(.*)\">.*", Pattern.DOTALL);
Pattern responseMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
Pattern initMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"HostConnInit\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
Pattern initResMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\"null\".*", Pattern.DOTALL);
Pattern initResIDMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\"null\".*<IATA>"+args[0]+"</IATA>.*", Pattern.DOTALL);
          Pattern sentMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"DCMsgSentInfo\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
          Pattern rcvdMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"DCMsgRcvdInfo\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
DecimalFormat dcf = new DecimalFormat("########.##");
String actName = "";
          if (fileNo ==0)
          rowTitle = sheet.createRow((short)0);
          rowTitle.createCell((short)0).setCellType(HSSFCell.CELL_TYPE_STRING);
          rowTitle.createCell((short)0).setCellValue("Req/Res");
          rowTitle.createCell((short)1).setCellType(HSSFCell.CELL_TYPE_STRING);
          rowTitle.createCell((short)1).setCellValue("Action");
          rowTitle.createCell((short)2).setCellType(HSSFCell.CELL_TYPE_STRING);
          rowTitle.createCell((short)2).setCellValue("Server Time(in ms)");
          rowTitle.createCell((short)3).setCellType(HSSFCell.CELL_TYPE_STRING);
          rowTitle.createCell((short)3).setCellValue("Request Vs Response Time in Server(in ms)");
          rowTitle.createCell((short)4).setCellType(HSSFCell.CELL_TYPE_STRING);
          rowTitle.createCell((short)4).setCellValue("Time Taken By HAS/HOST(in ms)");
          rowTitle.createCell((short)5).setCellType(HSSFCell.CELL_TYPE_STRING);
          rowTitle.createCell((short)5).setCellValue("No. of HAS calls");
          rowTitle.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_STRING);
          rowTitle.createCell((short)6).setCellValue("Data Size");
          //wb.write(fileOut);
while((aLine=logReader.readLine()) != null) {
if(aLine.startsWith("<MESSAGE TYPE=\"EVENT\"")) {
Matcher m = startMessage.matcher(aLine);
if(m.find()) {
sBuf.setLength(0);
sBuf.append(aLine);
skip = false;
initReq = false;
m = initMessage.matcher(aLine);
if(m.find()) {
initReq = true;
} else {
if(initReq) {
m = initResMessage.matcher(aLine);
if(m.find()) {
sBuf.setLength(0);
sBuf.append(aLine);
skip = false;
} else if(aLine.startsWith("</MESSAGE>")) {
if(!skip) {
sBuf.append(aLine);
readed = true;
} else if(!skip){
sBuf.append(aLine);
if(!skip && readed) {
String tempStr = sBuf.toString();
if(tempStr.length() > 0) {
boolean reqMatched = false;
Matcher m = null;
if(initReq) {
m = initMessage.matcher(tempStr);
actName = "Intialization";
} else {
m = requestMessage.matcher(tempStr);
String time = "";
if(m.find()) {
reqMatched = true;
for (int i=1; i<=m.groupCount(); i++) {
String groupStr = m.group(i);
if(i == 1) {
time = groupStr;
} else if(i == 2) {
actName = groupStr;
} else if(!initReq){
m = requestMessage1.matcher(tempStr);
if(m.find()) {
reqMatched = true;
for (int i=1; i<=m.groupCount(); i++) {
String groupStr = m.group(i);
if(i == 1) {
time = groupStr;
} else if(i == 2) {
actName = groupStr;
if(time.length() > 0 ) {
try{
requestTime = sdf.parse(time).getTime();
}catch(Exception ex){}
System.out.println("Request,"+actName+","+time+",,,,"+dcf.format(((double)time.length()/1024.0))+"K");
                              //bw.write("Request,"+actName+","+time+",,,,"+dcf.format(((double)time.length()/1024.0))+"K");
                              String reqDataSize = dcf.format(((double)time.length()/1024.0))+"K" ;
                              rowReq = sheet.createRow((short)counter);
                                   rowReq.createCell((short)0).setCellType(HSSFCell.CELL_TYPE_STRING);
                                   rowReq.createCell((short)0).setCellValue("Request");
                                   rowReq.createCell((short)1).setCellType(HSSFCell.CELL_TYPE_STRING);
                                   rowReq.createCell((short)1).setCellValue(actName);
                                   rowReq.createCell((short)2).setCellType(HSSFCell.CELL_TYPE_STRING);
                                   rowReq.createCell((short)2).setCellValue(time);
                                   rowReq.createCell((short)3).setCellType(HSSFCell.CELL_TYPE_STRING);
                                   rowReq.createCell((short)3).setCellValue("");
                                   rowReq.createCell((short)4).setCellType(HSSFCell.CELL_TYPE_STRING);
                                   rowReq.createCell((short)4).setCellValue("");
                                   rowReq.createCell((short)5).setCellType(HSSFCell.CELL_TYPE_STRING);
                                   rowReq.createCell((short)5).setCellValue("");
                                   rowReq.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_STRING);
                                   rowReq.createCell((short)6).setCellValue(reqDataSize);
                                   counter = counter +1;
                                   System.out.println("counter is "+counter);
                         Matcher l = sentMessage.matcher(tempStr);
                         Matcher k = rcvdMessage.matcher(tempStr);
               if(l.find()) {
                                        for (int i=1; i<=l.groupCount(); i++) {
     String groupStr2 = l.group(i);
try{
sentTime = sdf.parse(groupStr2).getTime();
}catch(Exception ex){}
                    if(k.find())
                                             for(int j=1;j<=k.groupCount(); j++) {
                                             String groupStr1 = k.group(j);
                                             try{
recdTime = sdf.parse(groupStr1).getTime();
}catch(Exception ex){}
                                             presentTime = (recdTime - sentTime);
                                             hasTime = hasTime + presentTime;
                                             hasCalls = hasCalls +1;
if(!reqMatched) {
if(initReq) {
m=initResIDMessage.matcher(tempStr);
} else {
m=responseMessage.matcher(tempStr);
if(m.find()) {
for (int i=1; i<=m.groupCount(); i++) {
String groupStr = m.group(i);
try{
responseTime = sdf.parse(groupStr).getTime();
}catch(Exception ex){}
                                             String resDataSize = dcf.format(((double)tempStr.length()/1024.0))+"K" ;
                                             rowRes = sheet.createRow((short)(counter));
                                             rowRes.createCell((short)0).setCellType(HSSFCell.CELL_TYPE_STRING);
                                             rowRes.createCell((short)0).setCellValue("Response");
                                             rowRes.createCell((short)1).setCellType(HSSFCell.CELL_TYPE_STRING);
                                             rowRes.createCell((short)1).setCellValue(actName);
                                             rowRes.createCell((short)2).setCellType(HSSFCell.CELL_TYPE_STRING);
                                             rowRes.createCell((short)2).setCellValue(groupStr);
                                             rowRes.createCell((short)3).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
                                             rowRes.createCell((short)3).setCellValue((responseTime - requestTime));
                                             rowRes.createCell((short)4).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
                                             rowRes.createCell((short)4).setCellValue(hasTime);
                                             rowRes.createCell((short)5).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
                                             rowRes.createCell((short)5).setCellValue(hasCalls);
                                             rowRes.createCell((short)6).setCellType(HSSFCell.CELL_TYPE_STRING);
                                             rowRes.createCell((short)6).setCellValue(resDataSize);
                                             hasTime = 0;
                                             hasCalls = 0;
                                             counter = counter + 1 ;
sBuf.setLength(0);
readed = false;
          wb.write(fileOut);
          } // End of for (int fileNo = 0; fileNo < children.length; fileNo++ )
}     //End of else
          fileOut.close();
} //End of public static void main
} // End of Class

First of all, use [code]-tags to make your code readable, please.
I didn't do a complete inspection of your code (because it's too much and unreadable as it is) and I don't know POI, but creating a new HSSFWorkbook for each input file sounds fishy to me ... try re-using the workbook and just creating a new sheet in each iteration.

Similar Messages

  • Reading a 2GB file and writing to two differnt files based on a delimiter

    Good Morning!
    I have to to read the content of 2 gb file(main.txt) and copy its content into two other files based on a delimiter.The delimiter is '/'. Initially i have to start writing the contents of main.txt to copy1.txt as soon as i encounter a delimiter i have to write the contents to copy2.txt again if i encounter next delimiter i have to write the contents copy1.txt and so on
    This is my piece of code but it takes 20-25 minutes.How can i optimise this operation.efficiency is my problem
    try{
         FileInputStream fis = new FileInputStream ("main.txt");
         FileOutputStream foscopy1 = new FileOutputStream ("copy1.txt") ;
         FileOutputStream foscopy2 = new FileOutputStream ("copy2.txt") ;
         int iFlag=1;
         int s;
         while((s=fis.read())!=-1)
              System.out.println(iFlag);
              if (s=='/')
                   iFlag=-iFlag ;
              else{
         if (iFlag==1)
                        foscopy1.write(s);
    else
    foscopy2.write(s);
    if u canprovide code that would do a lot of good

    Perhaps you could use a StreamTokenizer on top of a BufferedReader since you are using text files... The buffered reader will buffer your input so that it doesn't have to perform IO on every byte read. Subsequently the output may also be buffered to enhance performance...
    StreamTokenizer st = new StreamTokenizer(new BufferedReader(new FileReader("main.txt")));
    st.whitespaceChars('/', '/');
    BufferedWriter out = new BufferedWriter(new FileWriter("copy1.txt"));
    //same with copy 2
    while (st.nextToken() != st.TT_EOF) { // while not end
      String s = st.sval;
      // determiine copy to write to, then write.
    }

  • How to read the data file and write into the same file without a temp table

    Hi,
    I have a requirement as below:
    We are running lockbox process for several business, but for a few businesses we have requirement where in we receive a flat file in different format other than how the transmission format is defined.
    This is a 10.7 to 11.10 migration. In 10.7 the users are using a custom table into which they are first loading the raw data and writing a pl/sql validation on that and loading it into a new flat file and then running the lockbox process.
    But in 11.10 we want to restrict using temp table how can we achieve this.
    Can we read the file first and then do validations accordingly and then write to the same file and process the lockbox.
    Any inputs are highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hello Gurus,
    Let me tell you about my requirement clearly with an example.
    Problem:
    i am receiving a dat file from bank in below format
    105A371273020563007 07030415509174REF3178503 001367423860020015E129045
    in this detail 1 record starting from 38th character to next 15 characters is merchant reference number
    REF3178503 --- REF denotes it as Sales Order
    ACC denotes it as Customer No
    INV denotes it as Transaction Number
    based on this 15 characters......my validation comes.
    If i see REF i need to pick that complete record and then fill that record with the SO details as per my system and then submit the file for lockbox processing.
    In 10.7 they created a temporary table into which they are loading the data using a control file....once the data is loaded into the temporary table then they are doing a validation and updating the record exactly as required and then creating one another file and then submitting the file for lockbox processing.
    Where as in 11.10 they want to bypass these temporary tables and writing it into a different file.
    Can this be handled by writing a pl/sql procedure ??
    My findings:
    May be i am wrong.......but i think .......if we first get the data into ar_payments_interface_all table and then do the validations and then complete the lockbox process may help.
    Any suggestions from Oracle GURUS is highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

  • How to read XML file and write into another XML file

    Hi all, I am new to JAVAXML.
    My problem is I have to read one XML file and take some Nodes from that and write these nodes into another XML file...
    I solved, how to read XML file
    But I don't know how to Write nodes into another XML.
    Can anyone help in this???
    Thanks in advance..

    This was answered a bit ago. There was a thread called "XML Mergine" that started on Sept 14th. It has a lot of information about what it takes to copy nodes from one XML Document object into another.
    Dave Patterson

  • I created four (4) similar two (2) page file tables as an inventory of the contents of four (4) file crates full of LP vinyl record albums. How can these four (4) files be merged into a single file, then arranged in alphabetical order (by artist)?

    I am using "pages" version 5.5 (2109) as updated in its newest version after installing Yosemite OS X 10.10 on my 21.5 inch Mac desktop computer. When I printing the second file as a two sided document on a single sheet of paper, it only printed the first side. I looked at the copy of the file on my screen, and saw that the second page was also blank on my screen. I opened the original locked version of the 68 row, 4 column table, and found that both pages, 34 rows on each page, were intact, but when I saved it again, locked it, and reopened a duplicate copy, the second page again was not there. I ended up printing a copy of the original file, but I am nit able to save more than one page of the two page original. I would like to do this so I can edit the list without altering the original.                                                 I would eventually like to merge all four tables into one document, than arrange the entire merged file in alphabetical order. I would like to do this and have not been able to. This was the original question I had before I lost the second page of the second file table.

    In general theory, one now has the Edit button for their posts, until someone/anyone Replies to it. I've had Edit available for weeks, as opposed to the old forum's ~ 30 mins.
    That, however, is in theory. I've posted, and immediately seen something that needed editing, only to find NO Replies, yet the Edit button is no longer available, only seconds later. Still, in that same thread, I'd have the Edit button from older posts, to which there had also been no Replies even after several days/weeks. Found one that had to be over a month old, and Edit was still there.
    Do not know the why/how of this behavior. At first, I thought that maybe there WAS a Reply, that "ate" my Edit button, but had not Refreshed on my screen. Refresh still showed no Replies, just no Edit either. In those cases, I just Reply and mention the [Edit].
    Also, it seems that the buttons get very scrambled at times, and Refresh does not always clear that up. I end up clicking where I "think" the right button should be and hope for the best. Seems that when the buttons do bunch up they can appear at random around the page, often three atop one another, and maybe one way the heck out in left-field.
    While I'm on a role, it would be nice to be able to switch between Flattened and Threaded Views on the fly. Each has a use, and having to go to Options and then come back down to the thread is a very slow process. Jive is probably incapable of this, but I can dream.
    Hunt

  • Hi,my system is Mac OS X v 10.5 Leopard the problem is that when click on a file, immediately a box appears around the file and the title of the file is read !so how is it possible to escape from the voice?Thank you for your advice

    Hi,when click on a file, immediately a box appears around the file and the title of the file is read !so how is it possible to escape from the voice?Thank you for your advice

    Turn off Voiceover!
    System Preferences/Universal Access

  • Problem in writing into the excel file using java code

    Hai ,
    I will be getting the data as a string and i am writing into the excel file. the problem is .if it has numeric values even now i will writing as a string data ,at this time i am getting the message in the excel file as "Number in the cell is formatted as text".
    I need to remove this thru my code..but i can write only as a string .
    To write in a excel file ,i used HSSFWorkbook.

    just check out
    http://www.andykhan.com/

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • How to read from one file and write into another file?

    Hi,
    I am trying to read a File and write into another file.This is the code that i am using.But what happens is last line is only getting written..How to resolve this.the code is as follows,
    public String get() {
         FileReader fr;
         try {
              fr = new FileReader(f);
              String str;
              BufferedReader br = new BufferedReader(fr);
              try {
                   while((str= br.readLine())!=null){
                   generate=str;     
              } catch (IOException e1) {
                   e1.printStackTrace();
              } }catch (FileNotFoundException e) {
                   e.printStackTrace();
         return generate;
    where generate is a string declared globally.
    how to go about it?
    Thanks for your reply in advance

    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");
    }

  • BufferedReader/FileWriter - read in a line and store it in a file

    hi, I'm new in programming java, so I hope somebody can help me with the following question:
    I've got a file that contains parameters, which change every second (the file updates itself every second)
    Now I have to write a java Programm, that reads in a certain parameter of that file, and store it in another file, so that the file lists every read-in parameter (to show the changes of the parameter).
    the following source shows a programm, that reads in the content of a text file and stores it in another file - every second. Please, could anyone be so kind, and help me to change the programm?
    import java.io.*;
    import java.util.Date;
    public class readIn {
    public static void main(String[] args) throws IOException {
    for (int i = 1; i <= 5; ++i) {
    System.out.println("Sleep at: " + new Date());
    try
    // ask currently executing Thread to sleep for 1000ms
    Thread.sleep(1000);
    catch(InterruptedException e)
    System.out.println("Sleep interrupted:"+e);
    if (args.length != 2)
    System.err.println ("usage: pattern file");
    System.exit (1);
    String patt = args [0];
    String fileIn = args [1];
    try
    LineNumberReader reader = new LineNumberReader
    (new FileReader (fileIn));
    String str;
    while ((str = reader.readLine()) != null)
    if (str.indexOf (patt) != -1)
    int ln = reader.getLineNumber();
    File inputFile = new File("logfile.txt");
    File outputFile = new File("history.txt");
    FileReader in = new FileReader(inputFile);
    FileWriter out = new FileWriter(outputFile);
    int c;
    while ((c = in.read()) != -1)
    out.write(c);
    in.close();
    out.close();
    reader.close();
    catch (IOException e)
    System.err.println ("IO-Fehler beim Filtern");
    e.printStackTrace();
    System.out.println("Awoke at: " + new Date());
    the logfile.txt contains words which change every second. I want to permanently read in the third line.
    anatomy
    animation
    applet
    application
    argument
    bolts
    class
    communicate
    component
    container
    development
    environment
    exception
    graphics
    image
    input
    integrate
    interface
    Thank you very much for your immediate answer!!

    RandomAccessFile ??
    aha, I took a look at the API but I have no idea how to work with it. If its quite easy, could you please be so kind and tell me ?? thanks ;)

  • Problem with reading data from screen and inserting in table

    hi ther,
    im new to abap-webdyn pro. can anyone suggest how to read data from screen and insert into table when press 'ADD' button.
    i done screen gui , table creation but problems with action. what the content of acton add.
    is ther any link that helps me or tut??
    thankx in advance!
    regards

    Hi,
    Create a context node for the screen fields for which you want to enter the values with cardinality 1.1.....
    Now in the layout of your view bind the screen input fields to that context node(attributes) to the value property of the input fields...
    Now in the action of ADD button....
    --> go the wizard and select the read node button and select the node which you have created it generates the auto code for you.....
    for example if the node is contains aone attribute like MATNR
    reading the node from wizard will generate the code as....
    DATA lo_nd_matnr TYPE REF TO if_wd_context_node.
      DATA lo_el_matnr TYPE REF TO if_wd_context_element.
      DATA ls_matnr TYPE wd_this->element_matnr.
      DATA lv_matnr TYPE wd_this->element_matnr-matnr.
    * navigate from <CONTEXT> to <MATNR> via lead selection
      lo_nd_matnr = wd_context->get_child_node( name = wd_this->wdctx_matnr ).
    * @TODO handle non existant child
    * IF lo_nd_matnr IS INITIAL.
    * ENDIF.
    * get element via lead selection
      lo_el_matnr = lo_nd_matnr->get_element( ).
    * @TODO handle not set lead selection
      IF lo_el_matnr IS INITIAL.
      ENDIF.
    * get single attribute
      lo_el_matnr->get_attribute(
        EXPORTING
          name =  `MATNR`
        IMPORTING
          value = lv_matnr ).
    here the variable lv_matnr will contain the entered value......
    now you can use this value for further process.
    Thanks,
    Shailaja Ainala.

  • Can not open JPEG files and can not create JPEG files from other software

    Can not open JPEG files and can not create JPEG files from other software (For example from Solidworks).
    When I try to right click on a JPEG, a notice window appears written: "Windows Explorer has stopped working - Windows is
    checking for a solution to the problem" and then the notice box disapears, the desktop appears and I can continue working.
    From the other side - If I try to save as JPEG a screen of Solidworks (like a view of a part) the Solidworks falls but the JPEG
    is created (I can see its name in the directory I created it).
    I can open the JPEGS with the Paint software if I want but not with the Windows Photo Viewer.
    I have the feeling that the Windows Photo Viewer disapeared from my computer - just a feeling.
    I will appreciate your assistance.
    Avi T. 2014

    Hi,
    Did Windows Photo Viewer option appear when you right click the JPEG file and select open with?
    I would like suggest you use Clean Boot to troubleshoot if there is third-party software conflict:
    How to perform a clean boot in Windows
    http://support.microsoft.com/kb/929135
    Karen Hu
    TechNet Community Support

  • Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Acrobat Pro or Standard.

  • Remove / unload external swf file(s) from the main flash file and load a new swf file and garbage collection from memory.

    I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
    This is the error message(s) I am receiving: "TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/Down3()"
    import nl.demonsters.debugger.MonsterDebugger;
    var d:MonsterDebugger=new MonsterDebugger(this);
    stage.scaleMode=StageScaleMode.NO_SCALE;
    stage.align=StageAlign.TOP_LEFT;
    stage.addEventListener(Event.RESIZE, resizeHandler);
    // loader is the loader for portfolio page swf
    var loader:Loader;
    var loader2:Loader;
    var loader3:Loader;
    var loader1:Loader;
    //  resize content
    function resizeHandler(event:Event):void {
        // resizes portfolio page to center
    loader.x = (stage.stageWidth - loader.width) * .5;
    loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    /*loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;*/
    addEventListener(Event.ENTER_FRAME, onEnterFrame,false, 0, true);
    function onEnterFrame(ev:Event):void {
    var requesterb:URLRequest=new URLRequest("carouselLoader.swf");
    loader = null;
    loader = new Loader();
    loader.name ="carousel1"
    //adds gallery.swf to stage at begining of movie
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requesterb);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    // stop gallery.swf from duplication over and over again on enter frame
    removeEventListener(Event.ENTER_FRAME, onEnterFrame);
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent):void {
    // re adds listener for contact.swf and about.swf
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
    var requester:URLRequest=new URLRequest("carouselLoader.swf");
        loader = null;
    loader = new Loader();
    loader.name ="carousel"
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    removeChild( getChildByName("about") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of gallery.swf
    MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    function Down1(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    var requester:URLRequest=new URLRequest("contactLoader.swf");
    loader2 = null;
    loader2 = new Loader();
    loader2.name ="contact"
    loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader2.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader2);
    loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    function Down3(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    var requester:URLRequest=new URLRequest("aboutLoader.swf");
    loader3 = null;
    loader3 = new Loader();
    loader3.name ="about"
    loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader3.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader3);
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    removeChild( getChildByName("carousel") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
    stop();

    Andrei1,
    Thank you for the helpful advice. I made the changes as you suggested but I am receiving a #1009 error message even though my site is working the way I wan it to work. I would still like to fix the errors so that my site runs and error free. This is the error I am receiving:
    "TypeError: Error #1009: Cannot access a property or method of a null object reference."
    I'm sure this is not the best method to unload loaders and I am guessing this is why I am receiving the following error message.
         loader.unload();
         loader2.unload();
         loader3.unload();
    I also tried creating a function to unload the loader but received the same error message and my portfolio swf was not showing at all.
         function killLoad():void{
         try { loader.close(); loader2.close; loader3.close;} catch (e:*) {}
         loader.unload(); loader2.unload(); loader3.unload();
    I have a question regarding suggestion you made to set Mouse Event to "null". What does this do setting the MouseEvent do exactly?  Also, since I've set the MouseEvent to null do I also have to set the loader to null? e.g.
    ---- Here is my updated code ----
    // variable for external loaders
    var loader:Loader;
    var loader1:Loader;
    var loader2:Loader;
    var loader3:Loader;
    // makes borders resize with browser size
    function resizeHandler(event:Event):void {
    // resizes portfolio page to center
         loader.x = (stage.stageWidth - loader.width) * .5;
         loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
    //adds gallery.swf to stage at begining of moviie
         Down();
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent = null):void {
    // re adds listener for contact.swf and about.swf
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
         var requester:URLRequest=new URLRequest("carouselLoader.swf");
         loader = new Loader();
         loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader.load(requester);
         } catch (error:SecurityError) {
         trace(error);
         this.addChild(loader);
         loader.x = (stage.stageWidth - 739) * .5;
         loader.y = (stage.stageHeight - 500) * .5;
    // sure this is not the best way to do this - but it is unload external swfs
         loader.unload();
         loader2.unload();
         loader3.unload();
    // remove eventlistner and prevents duplication of gallery.swf
         MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         function Down1(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         var requester:URLRequest=new URLRequest("contactLoader.swf");
         loader2 = null;
         loader2 = new Loader();
         loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);    
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader2.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader2);
         loader2.x = (stage.stageWidth - 658.65) * .5;
         loader2.y = (stage.stageHeight - 551.45) * .5;
    loader.unload();
    loader2.unload();
    loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         function Down3(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         var requester:URLRequest=new URLRequest("aboutLoader.swf");
         loader3 = null;
         loader3 = new Loader();
         loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader3.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader3);
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
         loader.unload();
         loader2.unload();
         loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
         stop();

Maybe you are looking for

  • Wireless not working after suspend (madwifi)

    Hi there I successfully converted from Vista to Archlinux! Everything's working fine (yep, I'm a bit proud as this my second try at linux ) except that after I suspend with powersave my wlan is not working anymore. I've also tried to unload the ath_p

  • Relationship Display in PO13 for User is Incomplete

    -This is a peculair situation post upgrade to ECC 6.0 where a couple of the recruiters are unable to view the entire list of relationships attached to a position using PO13. If he/she hits the overview button it does NOT display ALL the relations. In

  • How could I display a dialog attached to a window?

    If there is a way to do this, how could I, in Xcode 5, cocoa applescript? Something like: Display dialog "Hello Red_Menace" attached to MyWindow I know sheets can do this, but this seems a lot more simple, because I wouldn't have to design a window a

  • Why does an Inbound IDoc no change and differs from an Outbound IDoc no?

    Hi Experts, This seems to be a basic question..! But can someone kindly clarify why an IDoc number gets changed when sent from one R/3 system to another R/3 system and how does this happen??? i.e., whenever an IDoc was triggered from R/3 system A to

  • Immediate answer

    SQL> ed Wrote file afiedt.buf 1 INSERT INTO IHS_PT_CASE@link_to_dmsr 2 SELECT 'IHS_OWNER', SUBSTR(TRIM(ADT_CASE.CASE_ACCOUNT_NO),1,12), 3 ADT_CASE.CASE_ADMIT_DT, ADT_CASE.CASE_DC_DT, SUBSTR(TRIM(ADT_CASE_LOCATION.LOCN_NSG_STATN_CD),1 4 SUBSTR(TRIM(AD