Append string to stringbuffer in same line

I have stringbuffer in which i append string thiesestring is of variable lengt
has different value .I want that when i append string to stringbuffer it append
to same line .I use append method of stringbuffer.But the whole value is not
in same line it breaks into many line all lines are not of same size.
Thanks

Try making the textarea larger and see if it still
shows on a new line...Textarea width is very large .There are many line break sometimes all lines
are of different length so there is no issue of word wrap .I check the output
sometimes it gives newline when it encounter space but not always .there are also spaces in single line .Sometimes it gives new line when it encounter >
and sometimes it continue in same line after enconter > .
Thanks

Similar Messages

  • How can I write left and right in the same line of a richtextbox?

    I want to write, in the same line, text with a right aligment and other with left aligment. How can I do it?
    thanks

    I want to write, in the same line, text with a right aligment and other with left aligment. How can I do it?
    thanks
    As
    Viorel_ says "Perhaps there are other much easier solutions. For example, create two
    RichTextBoxes with no borders (if you only need two columns of text)" but the real issue would be saving the info in the RichTextBox's (RTB's) RTF or Text to two different RTF or TextFiles. Although I suppose if it was just going to
    a TextFile then you could somehow use a delimited text file so each same line number of each RTB is appended to the same line and delimited. That way you could probably load a split array with each line from the text file splitting on the delimeter per line
    and providing RTB1 with index 0 of the split array and RTB2 with index 1 of the split array. I'm not going to try that.
    This is some leftover code from a long time ago. It has three RTB's. RTB1 is there I suppose because the thread asking for this code wanted it. RTB2 is borderless as well as RTB3. The Aqua control in the top image below is the Panel used to cover RTB2's
    scrollbar. So RTB3's scrollbar is used to scroll both controls.
    I forgot to test if I typed past the scroll position in RTB2 if both would scroll as maybe RTB3 would not since it would not have anything to scroll to I suppose.
    Maybe this code can help or maybe not. The bottom two images are the app running and displaying nothing scrolled in RTB2 and RTB3 then the scroll used in the bottom image.
    Disregard the commented out code in the code below. It was there so I left it there. I suppose you should delete it. Also I didn't set the RTB's so one was left aligned and the other right aligned. I believe the Panel becomes a control in RTB2's controls
    when it is moved to cover RTB2's vertical scrollbar but don't remember although that seems the case since both RTB2 and RTB3 are brought to front so if the Panel was not one of RTB2's controls I would think it would be behind RTB2 and RTB2's vertical scrollbar
    would display but don't remember now. In fact I don't really remember how that part works. :)
    Option Strict On
    Public Class Form1
    Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByRef lParam As Point) As Integer
    Const WM_USER As Integer = &H400
    Const EM_GETSCROLLPOS As Integer = WM_USER + 221
    Const EM_SETSCROLLPOS As Integer = WM_USER + 222
    Dim FixTheProblem As New List(Of String)
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.CenterToScreen()
    Panel1.BackColor = Color.White
    Panel1.BorderStyle = BorderStyle.Fixed3D
    RichTextBox2.BorderStyle = BorderStyle.None
    RichTextBox2.ScrollBars = RichTextBoxScrollBars.Vertical
    RichTextBox3.BorderStyle = BorderStyle.None
    RichTextBox3.ScrollBars = RichTextBoxScrollBars.Vertical
    RichTextBox3.Size = RichTextBox2.Size
    RichTextBox3.Top = RichTextBox2.Top
    RichTextBox3.Left = RichTextBox2.Right - 20
    Panel1.Size = New Size(RichTextBox2.Width * 2 - 16, RichTextBox2.Height + 4)
    Panel1.Left = RichTextBox2.Left - 2
    Panel1.Top = RichTextBox2.Top - 2
    RichTextBox2.BringToFront()
    RichTextBox3.BringToFront()
    FixTheProblem.Add("Curry: £6.50")
    FixTheProblem.Add("Mineral Water: £4.50")
    FixTheProblem.Add("Crisp Packet: £3.60")
    FixTheProblem.Add("Sweat Tea: £2.23")
    FixTheProblem.Add("Motor Oil: £12.50")
    FixTheProblem.Add("Coca Cola: £.75")
    FixTheProblem.Add("Petrol Liter: £3.75")
    FixTheProblem.Add("Shaved Ice: £.50")
    FixTheProblem.Add("Marlboro: £2.20")
    FixTheProblem.Add("Newspaper: £.25")
    FixTheProblem.Add("Spice Pack: £.75")
    FixTheProblem.Add("Salt: £.50")
    FixTheProblem.Add("Pepper: £.30")
    For Each Item In FixTheProblem
    RichTextBox1.AppendText(Item & vbCrLf)
    Next
    RichTextBox1.SelectionStart = 0
    RichTextBox1.ScrollToCaret()
    Dim Fix As String = ""
    For Each Item In FixTheProblem
    Fix += Item.Replace(":", "^:") & vbCrLf
    Next
    Fix = Fix.Replace(vbCrLf, "^>")
    Dim FixSplit() As String = Fix.Split("^"c)
    For i = 0 To FixSplit.Count - 1
    If CBool(i Mod 2 = 0) = True Then
    RichTextBox2.AppendText(FixSplit(i).Replace(">"c, "") & vbCrLf)
    ElseIf CBool(i Mod 2 = 0) = False Then
    RichTextBox3.AppendText(FixSplit(i) & vbCrLf)
    End If
    Next
    End Sub
    Dim RTB2ScrollPoint As Point
    Private Sub RichTextBox2_Vscroll(sender As Object, e As EventArgs) Handles RichTextBox2.VScroll
    Dim RTB2ScrollPoint As Point
    SendMessage(RichTextBox2.Handle, EM_GETSCROLLPOS, 0, RTB2ScrollPoint)
    SendMessage(RichTextBox3.Handle, EM_SETSCROLLPOS, 0, New Point(RTB2ScrollPoint.X, RTB2ScrollPoint.Y))
    'Me.Text = RTB2ScrollPoint.X.ToString & " .. " & RTB2ScrollPoint.Y.ToString
    End Sub
    Private Sub RichTextBox3_Vscroll(sender As Object, e As EventArgs) Handles RichTextBox3.VScroll
    Dim RTB3ScrollPoint As Point
    SendMessage(RichTextBox3.Handle, EM_GETSCROLLPOS, 0, RTB3ScrollPoint)
    SendMessage(RichTextBox2.Handle, EM_SETSCROLLPOS, 0, New Point(RTB3ScrollPoint.X, RTB3ScrollPoint.Y))
    'SendMessage(RichTextBox2.Handle, EM_SETSCROLLPOS, 0, New Point(0, 10))
    End Sub
    End Class
    La vida loca

  • How to write a string a stringbuffer to a text file or read a file?

    I need create a text file if the file is not exist, if exist, I have to append a string or stringbuffer to the file. Basically I am using java server page for our web application. I need send user input into a text file. I am uploading my JSP into a server, and run JSP from server. I wonder if I want to create a file, where this file goes, and how can I specify the path of the file?
    I used: BufferedReader br = new BufferedReader( new FileReader("report.txt"));
    The file report.txt could not be found.
    Please help me, thank you so much

    Try
    File file = new File("report.txt");
    out.println("File name: "+file.getAbsolutePath());in your jsp page, then you will see where it would be placed it you created it.
    You can specify the full path like this:
    File wFile = new File("c:\\temp\\report.txt"); // for windows
    File uFile = new File("/tmp/report.txt"); // for unix/linux
    // or
    File file = new File(myPath, "report.txt"); // where myPath is the path where you want to place report.txt.You can either use a File object or String object in the FileReader constructor..
    If you just want to know if the file exits, then use a file object and call exists() on it, returns true if the file already exist. If you want to create the file if it doesn't exit and append a string, then you don't need to check if it exist first. Just do it like this:
    PrintStream ps = new PrintStream(new FileOutputStream("report.txt", true), true);
    // again you could use a file object instead of a string with the file name
    ps.println("Add this line");
    ps.close();If the file doesn't exist, it will create it for you. The second argument in FileOutputStream means "append", and the second argument in PrintStream means "autoflush" every time you use the println methods (or add a newline '\n').

  • Please simplify - doubt in String and StringBuffer

    in output of StringTest1 StringBuffer take more time than String concatenation using + operator.
    and in output of StringTest2 String concatenation using + operator take more time than StringBuffer
    please simplify..
    public class StringTest1 {
    public static void main(String[] args){
               //Test the String Concatination
              long startTime = System.currentTimeMillis();
              for(int i=0;i<5000;i++){
              String result = "This is"+ "testing the"+ "difference"+ "between"+
                                    "String"+ "and"+ "StringBuffer";
              long endTime = System.currentTimeMillis();
              System.out.println("Time taken for string concatenation using + operator : "
                                              + (endTime - startTime)+ " milli seconds");
               //Test the StringBuffer Concatination
               long startTime1 = System.currentTimeMillis();
               for(int i=0;i<5000;i++){
              StringBuffer result = new StringBuffer();
                                 result.append("This is");
                                result.append("testing the");
                                result.append("difference");
                                result.append("between");
                               result.append("String");
                               result.append("and");
                               result.append("StringBuffer");
              long endTime1 = System.currentTimeMillis();
              System.out.println("Time taken for String concatenation using StringBuffer : "
                                                 + (endTime1 - startTime1)+ " milli seconds");
    }output:
    Time taken for String concatenation using + operator : 0 milli seconds
    Time taken for String concatenation using StringBuffer : 15 milli seconds
    public class StringTest2 {
    public static void main(String[] args){
              //Test the String Concatenation using + operator
              long startTime = System.currentTimeMillis();
              String result = "hello";
              for(int i=0;i<1500;i++){
              result += "hello";
              long endTime = System.currentTimeMillis();
              System.out.println("Time taken for string concatenation using + operator : "
                                              + (endTime - startTime)+ " milli seconds");
              //Test the String Concatenation using StringBuffer
              long startTime1 = System.currentTimeMillis();
              StringBuffer result1 = new StringBuffer("hello");
              for(int i=0;i<1500;i++){
              result1.append("hello");
              long endTime1 = System.currentTimeMillis();
              System.out.println("Time taken for string concatenation using StringBuffer :  "
                                              + (endTime1 - startTime1)+ " milli seconds");
    }output:
    Time taken for string concatenation using + operator : 63 milli seconds
    Time taken for String concatenation using StringBuffer : 0 milli seconds

    As jverd said - in the first class, your String concat is only done once. Add/replace this code to your original and see what you get"
    {code} String results = "This is"+ "testing the"+ "difference"+ "between"+
    "String"+ "and"+ "StringBuffer";
    Object o = results;
    for(int i=0;i<500000;i++){
    results = "This is"+ "testing the"+ "difference"+ "between"+
    "String"+ "and"+ "StringBuffer";
    if (i < 10 ) System.out.println("same result: "+(o == results));
    }{code}
    Now made just one change ( appending +i to that String each time ) as follows:
    {code} String results = "This is"+ "testing the"+ "difference"+ "between"+
    "String"+ "and"+ "StringBuffer";
    Object o = results;
    for(int i=0;i<500000;i++){
    results = "This is"+ "testing the"+ "difference"+ "between"+
    "String"+ "and"+ "StringBuffer"+i;
    if (i < 10 ) System.out.println("same result: "+(o == results));
    {code}
    Then, also in the first class, create your StringBuffer BEFORE the loop and "delete(0,result.length());" within the loop. This speeds it up and makes for a better comparison.
    Next, increase your loop size to something that will produce more consistent results (I used half a million).
    Lastly (or approximately so, at least) change the first part of your first class - using String - to the following:
    {code} results = "This is";
    results += "testing the";
    results += "difference";
    results += "between";
    results += "String";
    results += "and";
    results += "StringBuffer";
    results += i;
    {code}
    Now you have a more legitimate comparison and you will see a real difference.

  • APPEND STRING TO defaultDocumentStyle.

    Hi all,
    Anyone have an idea how to append or add String to the file,?
    For e.g i have some string "Author : Xttrax".
    <code>
    protected JTextPane editorZone;
    protected StyleContext m_context;
    protected DefaultStyledDocument docStyle;
    protected RTFEditorKit m_kit;
    editorZone = new JTextPane();
    m_kit = new RTFEditorKit();
    editorZone.setEditorKit(m_kit);
    m_context = new StyleContext();
    docStyle = new DefaultStyledDocument(m_context);
    editorZone.setDocument(docStyle);
    try {
    OutputStream out = new FileOutputStream(fileRead + ".mcf");
    m_kit.write(out, docStyle, 0, docStyle.getLength());
    out.close();
    catch (Exception ex)
    ex.printStackTrace();
    </code>
    while come to the part >
    <b> m_kit.write(out, docStyle,0,docStyle.getLength()</b>
    can i do something like
    docStyle = docStyle.getText + "String";
    i want to do this because i wish to append some "Tag" to the file whenever it is "saved"..
    thanks for considering my doubts

    Try making the textarea larger and see if it still
    shows on a new line...Textarea width is very large .There are many line break sometimes all lines
    are of different length so there is no issue of word wrap .I check the output
    sometimes it gives newline when it encounter space but not always .there are also spaces in single line .Sometimes it gives new line when it encounter >
    and sometimes it continue in same line after enconter > .
    Thanks

  • How to print a text of type text element and include text in same line

    hi,
    I am working on forms,
    i have to display like this in the form
    1.RFQ number, 2.Header text
    explanation for numbers
    1. The RFQ number is displayed using a variable so the text type is Text Element
    2. Header text, has to be got form the standard text , so the text type is include text.
    how can i print both in the same line.

    Hi ,
    You can use a charecter variable whos length >= length of RFQ no + Length of Header string .
    Concatenate both in this variable. And print the variable.
    Pls reward if useful.
    Laxman

  • How to assign to String[] from StringBuffer in a loop?

    Hi all,
    public class Test {
    public String[] getSJ() 
            String[]    jg;
            String[]    jig;
            String[]    tg;
            String[]    result;
            Date startTime;
            StringBuffer buf = new StringBuffer();
            int i;
            int j;
            int k = -1;
    jg = {"g1", "g2"};
    for( i=0; i < jg.length; i++ )
             jig = {"1", "2", "3"};
             for( j=0; i < jig.length; j++, k++ )
                   buf.append( jg[i] ).append( ":" );                                      
                   buf.append( jig[j] ).append( ":" );   
                   buf.append( Date() );    
                   result[k] = buf.toString();
                   buf = null;
    }I want to add to result string array by assigning from buf which is StringBuffer in a loop. But what happens after buf = null??
    Will the added String be gone?
    Or should I just do:
    buf = "";
    and continue with the loop and the string objects will be preserved? But isn't result just an array of references?
    Many thanks,

    I am not sure I understand correctly. Here is a test program (in real program I call APIs from a library which returns String[] for jg and for jig, i.e they are changing in the loop in runtime.
    I tried to put together test program:
    import java.util.*;
    public class Test {
         public void Test() {
    public String[] getSJ()
            String[] jg = {"g1", "g2"};
            String[] jig = {"1", "2", "3"};
            String[]    result = new String[50];
            StringBuffer buf = new StringBuffer();
            int i;
            int j;
            int k = 0;
    for( i=0; i < jg.length; i++ )
             for( j=0; i < jig.length; j++, k++ )
                   buf.append( jg[i] )
                      .append( ":" )
                      .append( jig[j] )
                      .append( ":" )
                      .append( new Date() );
                   result[k] = buf.toString();
                   buf = null;
       return result;
    public static void main( String[] args ) {
        Test   t = new Test();
        String[] res = t.getSJ();
        for( int i=0; i<res.length; i++ ) {
         System.out.println( res[i] );
    }but when I run it fails in this statement:
    buf.append( jg[i] )
                      .append( ":" )
                      .append( jig[j] )
                      .append( ":" )
                      .append( new Date() );Exception in thread main
    java.lang.NullPointerException
    java.lang.String[] Test.getSJ()
    Test.java:24
    void Test.main(java.lang.String[])
    Test.java:38
    Wierd!?
    And if I change to:
    buf.setLength(0);
    then it fails with this error:
    Exception in thread main
    java.lang.ArrayIndexOutOfBoundsException: 3
            java.lang.String[] Test.getSJ()
                    Test.java:24
            void Test.main(java.lang.String[])
                    Test.java:38Also, I would like not to have to allocate like in:
    String[] result = new String[50];
    because I do not know how many different Strings in array will be returned by API. Is it possible to dynamically adjust
    String[] result
    somehow?
    Many thanks,

  • How to write two item in the same line?

    In the smartforms,how to write two item in the same line?
    eg
    1   *************                                    2  *****************
    3  **************                                   4  ******************
    5  ***************
    Anyone got any idea to do this.
    Thanks in advance

    Hi,
    In the smartform the main windows is 20cm.I use the table output my data.Because the output is two item in same line,I define two rows in the table line type.
    Question:
    Should I define the table width 20cm?
    In the main area of table , should I define two folders and each of folder include a line? The second item I had already defined as Append Directly,but the item 1 and item 2 don't in the same line.
    Regards

  • Print different text elements on the same line

    Hi all,
    1.
    Is it possible to print different text elements on the same line ? with multiple write_form
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
             element       = 'TITLE1'
             WINDOW        = 'INFO'
         EXCEPTIONS
              ELEMENT       = 1.
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
             element       = 'TITLE2'
             function      = 'APPEND'
             WINDOW        = 'INFO'
         EXCEPTIONS
              ELEMENT       = 1.
    How to print TITLE1 and TITLE2 on the same line ?
    TITLE2 in bold.
    2. How to print 2 text elements on the same line with include statement ?
    /: include test1 ...
    /: include test2
    Thanks
    Edited by: Moo Yac on Sep 22, 2008 8:23 AM

    To be more specific :
    I want to print the following
    Text_symbol1:$Var1$      Text_symbol:$Var2$
    on the same line.
    where Text_symbol1 and Text Symbol2 are defined in SO10 for different languages.
    Thanks.

  • Help need to display record in same line

    Hi all,
    Correct output is not coming. 
    Movement type u2018261u2019 is material of type raw material.
    Movement type u2018101u2019 is material of type finished prodcut.
    I need to display finished product material details & beside that raw materials in the same line .
    Help me in this regard . I am watching this thread.
    DATA : BEGIN OF  i_final OCCURS 0,
              aufnr LIKE afko-aufnr,
              gstrp LIKE afko-gstrp,
              gltrp LIKE afko-gltrp,
              mblnr LIKE mseg-mblnr,        "mat doc.no
              bwart LIKE mseg-bwart,        "movement type
              matnr LIKE mseg-matnr,
              werks LIKE mseg-werks,
              lgort LIKE mseg-lgort,
              charg LIKE mseg-charg,
              menge LIKE mseg-menge,
              meins LIKE mseg-meins,
           END OF i_final.
    DATA : BEGIN OF i_final2 OCCURS 0,
              aufnr LIKE afko-aufnr,
              gstrp LIKE afko-gstrp,
              gltrp LIKE afko-gltrp,
              mblnr LIKE mseg-mblnr,        "mat doc.no
              bwart LIKE mseg-bwart,        "movement type
              matnr LIKE mseg-matnr,
              werks LIKE mseg-werks,
              lgort LIKE mseg-lgort,
              charg LIKE mseg-charg,
              menge LIKE mseg-menge,
              meins LIKE mseg-meins,
              mqty1 LIKE mseg-menge,        "MILD STEEL SCRAP
              mqty2 LIKE mseg-menge,        "PIG IRON
              mqty3 LIKE mseg-menge,        "FOUNDRY RETURN NORMAL
              mqty4 LIKE mseg-menge,        "CALCINED PETROLEUM COK
              mqty5 LIKE mseg-menge,        "FERRO SILICON
              mqty6 LIKE mseg-menge,        "FERRO MANGANESE
              mqty7 LIKE mseg-menge,        "COPPER SCRAP
              prueflos LIKE qals-prueflos,            "inspection lot number
              merknr LIKE qamr-merknr,                "inspection characteristic no
              kurztext LIKE qamv-kurztext,            "short text of characteristic
              qc_c  LIKE qamr-original_input,
              qc_mn LIKE qamr-original_input,
              qc_ni LIKE qamr-original_input,
           END OF i_final2.
    DATA : BEGIN OF i_final3 OCCURS 0,
               aufnr LIKE afko-aufnr,
               gstrp LIKE afko-gstrp,
               gltrp LIKE afko-gltrp,
               mblnr LIKE mseg-mblnr,        "mat doc.no
               bwart LIKE mseg-bwart,        "movement type
               matnr LIKE mseg-matnr,
               werks LIKE mseg-werks,
               lgort LIKE mseg-lgort,
               charg LIKE mseg-charg,
               menge LIKE mseg-menge,
               meins LIKE mseg-meins,
               mqty1 LIKE mseg-menge,        "MILD STEEL SCRAP
               mqty2 LIKE mseg-menge,        "PIG IRON
               mqty3 LIKE mseg-menge,        "FOUNDRY RETURN NORMAL
               mqty4 LIKE mseg-menge,        "CALCINED PETROLEUM COK
               mqty5 LIKE mseg-menge,        "FERRO SILICON
               mqty6 LIKE mseg-menge,        "FERRO MANGANESE
               mqty7 LIKE mseg-menge,        "COPPER SCRAP
               prueflos LIKE qals-prueflos,            "inspection lot number
               merknr LIKE qamr-merknr,                "inspection characteristic no
               kurztext LIKE qamv-kurztext,            "short text of characteristic
               qc_c  LIKE qamr-original_input,
               qc_mn LIKE qamr-original_input,
               qc_ni LIKE qamr-original_input,
            END OF i_final3.
    DATA : indx TYPE i,
           indx2 TYPE i.
    LOOP AT i_final.
        i_final2-aufnr = i_final-aufnr.
        i_final2-gstrp = i_final-gstrp.
        i_final2-gltrp = i_final-gltrp.
        i_final2-mblnr = i_final-mblnr.
        i_final2-bwart = i_final-bwart.
        i_final2-matnr = i_final-matnr.
        i_final2-werks = i_final-werks.
        i_final2-lgort = i_final-lgort.
        i_final2-charg = i_final-charg.
        i_final2-menge = i_final-menge.
        i_final2-meins = i_final-meins.
        APPEND i_final2.
        CLEAR i_final2.
      ENDLOOP.
      LOOP AT i_final2.
        indx = sy-tabix.
        IF i_final2-bwart = '261'.
          LOOP AT i_final WHERE aufnr = i_final2-aufnr.
         IF sy-subrc EQ 0.
            IF i_final2-matnr = 'MSCRAP'.
              i_final2-mqty1 = i_final-menge.
            ELSEIF i_final2-matnr = '100072'.    "PIG IRON
              i_final2-mqty2 = i_final-menge.
            ELSEIF i_final2-matnr = 'RETFDYNORM'.  "FOUNDRY RETURN NORMAL
              i_final2-mqty3 = i_final-menge.
            ELSEIF i_final2-matnr = '100062'.      "CALCINED PETROLEUM COK
              i_final2-mqty4 = i_final-menge.
            ELSEIF i_final2-matnr = '100063'.      "FERRO SILICON
              i_final2-mqty5 =   i_final-menge.
            ELSEIF i_final2-matnr = '100065'.      "FERRO MANGANESE
              i_final2-mqty6 =  i_final-menge.
            ELSEIF i_final2-matnr = '100070'.
              i_final2-mqty7 =  i_final-menge.
            ENDIF.
          ENDLOOP.
         ENDIF.
        ENDIF.
        READ TABLE i_qals WITH KEY aufnr = i_final2-aufnr.
        IF sy-subrc EQ 0.
          i_final2-prueflos = i_qals-prueflos.
        ENDIF.
        IF i_final2-bwart = '101'.
          LOOP AT i_results WHERE prueflos = i_final2-prueflos.
         IF sy-subrc EQ 0.
            i_final2-merknr = i_results-merknr.
            i_final2-kurztext = i_results-kurztext.
            IF i_final2-kurztext = 'C'.
              i_final2-qc_c = i_results-original_input.
            ELSEIF i_final2-kurztext = 'Mn'.
              i_final2-qc_mn = i_results-original_input.
            ELSEIF  i_final2-kurztext = 'Ni'.
              i_final2-qc_ni = i_results-original_input.
            ENDIF.
          ENDLOOP.
        ENDIF.
        MODIFY i_final2 INDEX indx.
       ENDIF.
    ENDIF.
      ENDLOOP..
      LOOP AT i_final2.
        i_final3-aufnr = i_final2-aufnr.
        i_final3-gstrp = i_final2-gstrp.
        i_final3-gltrp = i_final2-gltrp.
        i_final3-mblnr = i_final2-mblnr.
        i_final3-bwart = i_final2-bwart.
        i_final3-matnr = i_final2-matnr.
        i_final3-werks = i_final2-werks.
        i_final3-lgort = i_final2-lgort.
        i_final3-charg = i_final2-charg.
        i_final3-menge = i_final2-menge.
        i_final3-meins = i_final2-meins.
        i_final3-prueflos = i_final2-prueflos.       "inspection lot number
        i_final3-merknr = i_final2-merknr.                "inspection characteristic no
        i_final3-kurztext = i_final2-kurztext.            "short text of characteristic
        i_final3-qc_c = i_final2-qc_c.
        i_final3-qc_mn = i_final2-qc_mn.
        i_final3-qc_ni = i_final2-qc_ni.
        APPEND i_final3.
        CLEAR i_final3.
      ENDLOOP.
      LOOP AT i_final3 WHERE bwart = '101'..
        indx2 = sy-tabix.
        LOOP AT i_final2 WHERE aufnr = i_final3-aufnr AND
                               bwart = '261'.
          IF i_final3-bwart = '101'.
            i_final3-mqty1 = i_final2-mqty1.
            i_final3-mqty2 = i_final2-mqty2.
            i_final3-mqty3 = i_final2-mqty3.
            i_final3-mqty4 = i_final2-mqty4.
            i_final3-mqty5 = i_final2-mqty5.
            i_final3-mqty6 = i_final2-mqty6.
            i_final3-mqty7 = i_final2-mqty7.
          ENDIF.
        ENDLOOP.
        MODIFY i_final3 INDEX indx2.
      ENDLOOP.
    I am displaying i_final3 with alv
    Edited by: uday madhav chebrolu on May 20, 2008 3:22 PM

    863765 wrote:
    Is there any jsp code to display in same page rather than using ajaxJSPs are on the server, so any "JSP code" will be executed on the server.
    The client has HTML and javascript. The only way to not have the client move to a new page is to use something like Ajax.

  • Using same line in Console/Screen System.out.println()

    Ok next small prob, and then thats it lol,
    Let's say if I want to print something out to the screen...
    And after that print something again on the same line...
    So, sorta like refreshing the line.
    I can't figure it out because System.out.prinln() jumps to the next line.
    Thnkx in advance
    Robert

    public class Switch
        public static void main(String args[])
            try {
                for(;;){
                    System.out.print("Hello   ");
                    System.out.flush();
                    Thread.sleep(2000L);
                    System.out.print("\u0008\u0008\u0008\u0008\u0008\u0008\u0008\u0008");
                    System.out.print("Good Bye");
                    System.out.flush();
                    Thread.sleep(2000L);
                    System.out.print("\u0008\u0008\u0008\u0008\u0008\u0008\u0008\u0008");
            catch(Exception ex) {
                ex.printStackTrace();
    }

  • Sapscript Issue . Same line appears in all the line

    Hi All ,
    By using the logic below , i am able to find the 4 diffrenet line item in my window .
    Now i am getting the same line in all the lines in sapscript.
    Pls suggest , how to avoid this .
    In  my final table it_excdtl , all diffrent line item are shown ( shown while debugging )
    Thanks & Regards
    Kiro
    below is the code
    CLEAR WA_EXCDTL .
    Loop at it_excdtl INTO WA_EXCDTL.
    IF WA_excdtl-menge NE 0.
    wa_excdtl_amt_unit = ( WA_excdtl-exbed / WA_excdtl-menge ).
    WA_EXCDTL_ED_UNIT = ( WA_excdtl-ecs / WA_excdtl-menge ).
    WA_EXCDTL_CVD_UNIT = ( WA_excdtl-exaed / WA_excdtl-menge ).
    modify it_excdtl from wa_excdtl.
    ENDIF.
    PERFORM write_form2.
    FORM write_form2 .
    loop at it_excdtl.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    element = 'EMAIN2'
    function = 'APPEND'
    function = 'SET'
    type = 'BODY'
    window = 'MAIN2'
    IMPORTING
    PENDING_LINES =
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    OTHERS = 9
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    ENDFORM. " WRITE_FORM2

    ok guys i found the solution thanks to steve muench and his "upload text file and image example" on his weblog..
    thanks steve :)
    insted of:
    <adf:render model="bindings.Pic"/>
    it should be
    <adf:render model="Row.Pic"/>

  • Problem in reading XML - tags in same line

    Hi All,
    I am using DOM to read XML , my problem is that.I can only read xml entries like folllowing- i.e when tags are in same line only... Please help.
    <src from-page="jsp/Home.jsp"><navigation-case><action>loginaction</action><from-outcome>true</from-outcome><to-page>jsp/WelcomePage.jsp</to-page></navigation-case><navigation-case><action>loginaction</action><from-outcome>false</from-outcome><to-page>jsp/Error.jsp</to-page></navigation-case>
    </src>
    I am not able to read following XML file-
    <src from-page="*">
    <navigation-case>
    <action>logoutaction</action>
    <from-outcome>true</from-outcome>
    <to-page>jsp/Home.jsp</to-page>
    </navigation-case>
    <navigation-case>
    <action>logoutction</action>
    <from-outcome>false</from-outcome>
    <to-page>jsp/Error.jsp</to-page>
    </navigation-case>
    </src>
    Thanks

    Thanks for your response.You are right I am not handling spaces anywhere. How to do that?
    Can you please help in doing this?
    I am posting my code also-
    parser.parse("C:/portal-config.xml");
    org.w3c.dom.Document doc = parser.getDocument();
    org.w3c.dom.NodeList srcList = doc.getElementsByTagName("src");
    for (int i = 0; i < srcList.getLength(); i++) {
    org.w3c.dom.Node sourceNode = srcList.item(i);
    if (sourceNode.getAttributes().getNamedItem("from-page").getNodeValue().equalsIgnoreCase(from)) {
    org.w3c.dom.NodeList navigationCaseList = sourceNode.getChildNodes();
    for (int j = 1; j < navigationCaseList.getLength(); j++) {
    org.w3c.dom.Node navigationCase = navigationCaseList.item(j);
    org.w3c.dom.NodeList childList = navigationCase.getChildNodes();
    System.out.println("node : " + navigationCase.getNodeName());
    System.out.println("list : " + childList.getLength());
    Node action = childList.item(0);
    int type = action.getNodeType();
    // case Node.ELEMENT_NODE :
    System.out.println("node : " + action.getNodeName()+ " "+ action.getNodeValue());
    org.w3c.dom.Node fromOutcome = action.getNextSibling();
    org.w3c.dom.Node toPage = fromOutcome.getNextSibling();
    System.out.println("fromOutcome : " + fromOutcome.getNodeName());
    System.out.println("toPage : " + toPage.getNodeName() + " " + toPage.getNodeType());
    if(action.getNodeType()==1 & fromOutcome.getNodeType()==1 & toPage.getNodeType()==1){
    String actionValue = action.getTextContent();
    String outValue = fromOutcome.getTextContent();
    System.out.println("actionValue : " + actionValue);
    System.out.println("outValue : " + outValue);
    if (actionValue.equalsIgnoreCase(action1) & outValue.equalsIgnoreCase(outcome)) {
    return toPage.getTextContent();
    Seeking your support
    Thanks

  • Printing everything on same line

    Hi all,
    I want to write text on a text File in a formatted manner, such that there is line break after every line.The problem I am facing is that it print everything on same line. When we use "/n" it generates a dummy character. We are using FileWriter
    String s="Hello"+"\n"+"Everybody";
    FileWriter f=new FileWriter("abc.txt",true);
    f.write(s);
    f.close();
    I want every time this code is runs it should print sentences on different line.

    Then I would recommend that you wrap a PrintWriter around your FileWriter and use its methods named println(), then you won't have to worry about newlines yourself. Since a newline is different depending on what OS you run your program on, that is a safer approach than just typing "\n" (which only works as newlines on Unix type OS's btw, on Windows it comes out as garbage when viewd in for example Notepad since Windows uses "\r\n" for newline)
    Like this (reusing your code)
    FileWriter fw = new FileWriter("abc.txt",true);
    PrintWriter pw = new PrintWriter(fw);
    pw.println("Hello");
    pw.println("Everybody");
    pw.close();Another alternative is to use System.getProperty("line.separator") instead of "\n" to make it work on all platforms.
    HTH,
    Fredrik

  • Want null radio group item on same line with other horizontal radio sels

    I have a 4 selection radio group. They need to go horizontally. And I got that with 4 "columns". If a selection needed to be reversed to null there needs to be a selection for that function. The "display null value" works great for that. But there's just one thing,
    the null selection appears first on a line by itself. On the next line are the rest of the radio selections.
    what's the trick to getting the null selection on the same line as the rest of them? (Ideally at the end).
    I've been looking but I can't find the answer. (We need an faq for this kind of thing.)

    Hi,
    That depends on what you are using to generate the radio buttons.
    If you are using a static list, do something like:
    STATIC2:A;A,B;B,C;C,D;D,None;The "None;" at the end will generate a "None" radio button with a null return value
    If you are using SQL, do something like:
    SELECT ENAME d, EMPNO r
    FROM EMP
    UNION ALL
    SELECT 'None' d, NULL r
    FROM DUALThe second SELECT will append a "None" radio button with a null return value
    In either case, untick the "Display Null Values" option as it is no longer needed. Note that this option creates a separate TR row in the table that contains the radio buttons, so would always appear on a separate row from the other radio buttons.
    Andy

Maybe you are looking for

  • Drag and Drop can't really figure it out! :(

    hello there, i'm just trying to drop a .txt file from windows explorer to my JLabel enabled drop component.., and i'm having a hard time doing it, is it possible? how exactly is it done? also are there only really few components that are supported? i

  • Disable User on Active Directory in a Workflow

    I have to disable a user on AD. I must disable it in a Workflow calling the Disable User or Disable User Primitive. I have two questions: 1. Do I have to use Disable User or Disable User Primitive? 2. What do I have to pass in arguments?

  • Error in notification creation

    Hi                           My requirement is, create the Notification (IW21) by using the call transaction in synchronous mode after creates the notification I have to do some other updating. I complete the code and also it is working fine but some

  • Reg Meta Data Query

    Hi all!, i am using 11g database and i couldnt execute the following query which was pretty strainght forward: SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME = "EMP"; it says: ERROR at line 1: ORA-00904: "EMP": invalid identifier Regar

  • Validation expression, Checking the language

    Hello, Beside me following problem: Check first 5 symbols of the field on belong  to one language. Сan there is ideas beside who as this realize in MDM 5.5 sp3 Thanks in advance, Elena