Add ; at end of last line.

hi,
i am spooling one large query to one .sql file.
after this opearion i have to execute this file using command @x.sql
for this purpose i have to add ";" at end of query in file;
any idea how to achieve it using sql opeartion ?
file is having only query.

Why does it have to be via SQL?
prompt ;;If it has to be part of the SQL you could try analyic functions:
SQL> select ename
  2       , case row_number() over (order by ename desc) when 1 then ';' end as terminator
  3  from   emp
  4  order by ename;
ENAME      T
ADAMS
ALLEN
BLAKE
CLARK
FORD
JAMES
JONES
KING
MARTIN
MILLER
SCOTT
SMITH
TURNER
WARD       ;The ordering key you use would have to be unique. If there isn't a unique key to order by, you could construct one using a nested rownum expression etc.

Similar Messages

  • Please add exit to the last line of the sql script

    Hi,
    I am executing a sql script from UNIX shell. When I execute it at the command prompt the script executes successfully, but when I schedule the script on cron, the script is throwing an error with the above message
    "Please add exit to the last line of the sql script"
    Any idea what is happening? Thanks in advance for any help
    thedba

    It works check this out..
    << script a.sh >>
    logfile=/home/oracle/sri/x.log
    sqlplus -s /nolog <<DOC >> ${logfile}
    whenever sqlerror exit sql.sqlcode
    connect scott/tiger
    @a.sql a.log
    DOC
    <<  script a.sql >>
    set feedback off
    set echo off
    spool &1
    select * from tab where tname like 'A%';
    spool off
    exit;
    << a.log >>
    TNAME                          TABTYPE  CLUSTERID                              
    AQ$DEF$_AQCALL                 VIEW                                            
    AQ$DEF$_AQERROR                VIEW                                            
    AQ$_DEF$_AQCALL_F              VIEW                                            
    AQ$_DEF$_AQERROR_F             VIEW                                            
    AQ$_INTERNET_AGENTS            TABLE                                           
    AQ$_INTERNET_AGENT_PRIVS       TABLE                                           
    AQ$_QUEUES                     TABLE                                           
    AQ$_QUEUE_TABLES               TABLE                                           
    AQ$_SCHEDULES                  TABLE                                           
    << x.log >>
    TNAME                          TABTYPE  CLUSTERID
    AQ$DEF$_AQCALL                 VIEW
    AQ$DEF$_AQERROR                VIEW
    AQ$_DEF$_AQCALL_F              VIEW
    AQ$_DEF$_AQERROR_F             VIEW
    AQ$_INTERNET_AGENTS            TABLE
    AQ$_INTERNET_AGENT_PRIVS       TABLE
    AQ$_QUEUES                     TABLE
    AQ$_QUEUE_TABLES               TABLE
    AQ$_SCHEDULES                  TABLE-Sri

  • Want ot insert  a word bfeore last line

    hi all,
    i have finished reading strings from input files and displayed in outout file
    but i want to add a word before last line in output file can u please help.....
    regards,

    Mostly your question from String and File concepts only...
    i thought you are trying to do something in files
    http://forum.java.sun.com/thread.jspa?messageID=9922403
    http://forum.java.sun.com/thread.jspa?threadID=5226433
    i modified your program and post in this thread (threadID=5226433) what you asked,
    please go with the same code what you really added,
    dont post new thread and asking in different way the same one....
    avoid this...

  • Is it possible to add a word at the end of a line?

    Hi, i'm searching a way to automatically add a word at the end of a certain paragraph styles?
    is it something possible doing by using a script?
    i don't script myself but if someone could find me a way to do this it would be really appreciated.
    Here's an example to what i need to do:
    i have paragraph style X in a current  book document, and i need to edit the book and add the copyright source at the end of every line that has the style X to it
    so i would need something that asks me
    the targeted paragraph style
    which word i want to append to it, and then apply it torough the document.
    Thanks in advance

    Yes, the screen shot shows where you got it wrong:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    Find: (.)$
    and set your paragraph style in the find format area
    Change: $1XYZ
    where XYZ is the text you want to insert.
    .. you forgot the '1' right after the '$'. It's an important omission: "$1" is a GREP code, meaning "insert the found text, parenthesized group #1" -- and there is also a "$2", "$3", etc. up to "$9". It's great if you have to switch two, or even more, items around! But without the digit, the dollar sign indicates ... just a dollar sign.
    Change the Change to text to
    $1~S(CEMEQ)
    and you'll be fine.

  • Final total cannot appear when the last line item reached the page end

    Hi All,
    My report included 2 pages. Problem is the final total cannot appear when the last line item reached the page end. (page 2)
    final total will appear on the middle of last page (page 3) when i comment (type    = 'BOTTOM').
    Below is the program.
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          device   = 'PRINTER'
          dialog   = 'X'
          form     = 'ZBOTM_VOUCHER'
          language = sy-langu.
      sort itab by vblnr.
      LOOP AT itab INTO wa_itab.
        move wa_itab-vblnr to reguh-vblnr.
        move wa_itab-lifnr to reguh-lifnr.
        move wa_itab-rbetr to reguh-rbetr.
        reguh-rbetr = reguh-rbetr * -1.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            window  = 'MAIN'
            element = 'DETAIL'.
        t_rbetr = reguh-rbetr + t_rbetr.
        AT LAST.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              window = 'LINE'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TOTAL'.
              type    = 'BOTTOM'
              WINDOW  = 'MAIN'.
        ENDAT.
    Thanks.

    Hi,
    Where should I include the code for bottom?
    How to open text editor?
    Thanks.
    Edited by: Alice8 on Feb 7, 2011 9:09 AM

  • Add a different character to the last line of a loop

    Hi,
    I'm attempting to use some pl/sql to generate an RMAN copy script. After each line there needs to be comma, but the last line of the loop should have a semi-colon to terminate the statement. How can I do that?
    In the example below, the copy for controlfile 3 needs to be a semi-colon, not a comma:
    run
    SHUTDOWN IMMEDIATE
    STARTUP MOUNT
    COPY
    DATAFILE 1 TO '/u20/oraflash/ORCL1/dbcopy/system01.dbf',
    DATAFILE 2 TO '/u20/oraflash/ORCL1/dbcopy/undotbs01.dbf',
    DATAFILE 3 TO '/u20/oraflash/ORCL1/dbcopy/drsys01.dbf',
    DATAFILE 4 TO '/u20/oraflash/ORCL1/dbcopy/example01.dbf',
    DATAFILE 5 TO '/u20/oraflash/ORCL1/dbcopy/indx01.dbf',
    DATAFILE 6 TO '/u20/oraflash/ORCL1/dbcopy/tools01.dbf',
    DATAFILE 7 TO '/u20/oraflash/ORCL1/dbcopy/users01.dbf',
    DATAFILE 8 TO '/u20/oraflash/ORCL1/dbcopy/xdb01.dbf',
    CURRENT CONTROLFILE TO '/u20/oraflash/ORCL1/dbcopy/control01.ctl',
    CURRENT CONTROLFILE TO '/u20/oraflash/ORCL1/dbcopy/control02.ctl',
    CURRENT CONTROLFILE TO '/u20/oraflash/ORCL1/dbcopy/control03.ctl',
    ALTER DATABASE OPEN
    My script is:
    set serveroutput on format wrapped
    set feedback off
    spool db_copy.rcv
    declare
    cursor df is
    select
    file#,
    substr(name,29,50) name
    from
    v$datafile;
    cursor cf is
    select
    substr(name,27,50) name
    from
    v$controlfile;
    BEGIN
    DBMS_OUTPUT.ENABLE(2000);
    DBMS_OUTPUT.PUT_LINE('run');
    DBMS_OUTPUT.PUT_LINE('{');
    DBMS_OUTPUT.PUT_LINE('SHUTDOWN IMMEDIATE');
    DBMS_OUTPUT.PUT_LINE('STARTUP MOUNT');
    DBMS_OUTPUT.PUT_LINE('COPY');
    for dfbkup in df loop
    dbms_output.put_line(' DATAFILE '||dfbkup.file#||
    ' TO ''' || '/u20/oraflash/ORCL1/dbcopy/' || dfbkup.name ||''',');
    end loop;
    for cfbkup in cf loop
    dbms_output.put_line(' CURRENT CONTROLFILE' ||
    ' TO ''' || '/u20/oraflash/ORCL1/dbcopy/' || cfbkup.name ||''',');
    end loop;
    DBMS_OUTPUT.PUT_LINE(' ;');
    DBMS_OUTPUT.PUT_LINE('ALTER DATABASE OPEN');
    DBMS_OUTPUT.PUT_LINE('}');
    end;
    spool off

    Hi
    Try this then and remove any returns that I've put in as appropriate
    DECLARE
    l_string VARCHAR2(32767);
    l_num NUMBER := 1;
    CURSOR df IS
    SELECT  file#, SUBSTR (name, 29, 50) name
    FROM v$datafile;
    CURSOR cf IS
    SELECT   SUBSTR (name, 27, 50) name
    FROM v$controlfile;
    BEGIN
       l_string := ('run
       l_string := l_string||('{
       l_string := l_string||('SHUTDOWN IMMEDIATE
       l_string := l_string||('STARTUP MOUNT
       l_string := l_string||('COPY
       FOR dfbkup IN df
       LOOP
          l_string := l_string||(   ' DATAFILE '
                               || dfbkup.file#
                               || ' TO '''
                               || '/u20/oraflash/ORCL1/dbcopy/'
                               || dfbkup.name
                               || ''',
       END LOOP;
       FOR cfbkup IN cf
       LOOP
          l_string := l_string||(   ' CURRENT CONTROLFILE'
                               || ' TO '''
                               || '/u20/oraflash/ORCL1/dbcopy/'
                               || cfbkup.name
                               || ''',
       END LOOP;
       l_string := RTRIM(l_string,'
       l_string := l_string||(' ;
       l_string := l_string||('ALTER DATABASE OPEN
       l_string := l_string||('}');
    WHILE l_num <= LENGTH(l_string) LOOP
    DBMS_OUTPUT.PUT_LINE(SUBSTR(l_string, l_num, 200));
    l_num := l_num + 200;
    END LOOP;
    END;Cheers
    Ben

  • Utl_file.utl_raw adds a line feed at the end of the line. How to avoid it.

    utl_file.utl_raw adds a line feed at the end of the line. I have to send some binary files to my vendor and they do not want a line feed at the end of the line.
    When I execute the sample program below, it creates a file with a line feed(chr(10)) at the end of the line. When I do dump in hexa, it shows a character x0A
    How to avoid the line feed at end of line?
    We are using Oracle 9i on unix platform.
    declare
    l_output           utl_file.file_type;
    v_raw      raw(32767);
    v_trlr_rec_code      VARCHAR2(2);
    v_trlr_evnt_title      VARCHAR2(6);
    begin
    l_output := utl_file.fopen( 'RM_MHE_IN_DIR', 'abc.dat', 'w', 14 );
    v_trlr_rec_code      := '99';
    v_trlr_evnt_title      := 'STARTD';
    v_raw := HEXTORAW(v_trlr_rec_code) || utl_raw.cast_to_raw(v_trlr_evnt_title);
    utl_file.put_raw( l_output, v_raw );
    utl_file.fflush( l_output );
    utl_file.fclose( l_output );
    dbms_output.put_line( utl_raw.cast_to_varchar2( v_raw ) );
    EXCEPTION
    WHEN OTHERS THEN
         dbms_output.put_line( sqlerrm );
    end;
    /

    oops, sorry i overlooked the fact that the db is 9i; thanks for pointing it out Solomon.
    Not sure about this, but a workaround could be to remove the "\n" characters at the end of each line using one of the many Unix utilities after the file has been created.
    isotope

  • Add "End"  Or Last.. to the Threads..

    I would like to make a Suggestion and that is to Add  a  End Tab or a Last Tab  to the thread numbers so a Member can go to the end of the Discussion or go to the Very Last post, I've encounter a Few Post that I have had page through 3 to 4 or 5 times to get to end of the thread.. Using this Option it could take a member Directly to the end of the Thread in Seconds,  Just like having the feature to go to the Start of the thread..
    Thanks b33..

    Sure you'll get it  and I'll eventually see or find everything that I did or did not see as on here a well b

  • Why are spaces missing at end of wrapped lines in bulleted lists

    Hi -
    Acrobat 11.0.10, Word 2013, Windows 7 ... Sometimes tagged PDFs don't have spaces at the end of wrapping lines in bulleted lists, throughout the document. In text edit mode the cursor movement indicates no space exists. Selecting with text touch-up shows no space. In accessible text the last word on line runs into first word on next line.  JAWS mis-pronounces those words as if they are one word.  PAC preview also shows the words running together. 
    Adding a space in text edit mode works for a few minutes, but when file is saved & reopened spaces are gone, even if, immediately after adding the spaces, I select the block of LBody text with text touch-up and re-tag it and initially spaces appear to have been added.
    Is starting to happen on a routine basis, different source files, different people/computers generating the PDFs, multiple computer reboots, Acrobat repair run, MS Office repair run. But not consistent ... e.g., if someone generated PDF with no spaces at end, someone else can generate from same source and spaces are present.
    Any ideas?
    Thanks

    Thanks 'C' student, nice to know it's not just us - "misery loves company" and all that.
    So far besides your reply there's deafening silence.
    Come on, folks, don't any of you experts have a solution for this? Or at least an inkling of an idea what may be causing this? It's starting to happen all the time now, becoming a major problem.  We may have to start by getting Acrobat to self-tag rather than starting with the tags generated from the source programs, but that adds time and effort because Acrobat's tags for our often complex documents are laughable and have, ironically, such poor syntax.
    Is there a way to get a discussion seen by more people?

  • Delete last line of a textfile without putting the whole file in memory

    Hello!
    I want to delete the last line of a text file without loading the whole text file into thememory. My problem is as follows:
    A algorithm generates output that has to be written into a text file. This happens periodically - the output goes straight into a xml file. The xml file looks like this:
    <test>
    <step>
    <time>2006-06-19 10:55:20</time>
    <result>12321</result>
    </step>
    <step>
    <time>2006-06-19 10:58:20</time>
    <result>41515</result>
    </step>
    </test>
    The XML file must be valid, so I have to delete the last line ("</test>") before I add a new <step>-section.
    Many thanks in advance
    Kind regards,
    buliwyf

    For processing in a separate tool which understands XML, then using a DTD to declare an external entity is often better - you wrap the entity in the document root element, so you can just append to the end of the file the entity references and not bother about inserting before the closing tag.
    File other app loads:
    <?xml version="1.0"?>
    <!DOCTYPE test [ <!ENTITY content SYSTEM "content.xmlfragment"> ]>
    <test>&content;</test>File content.xmlfragment which can be simple appended to:
    <step time="2006-06-19 10:55:20">12321</step>
    <step time="2007-04-09 10:55:20">12321</step>
    <step time="2008-09-26 00:03:20">12321</step>If you can't use XML to solve the problem, then you can scan backwards in the file (using random access file or file buffer) until you find a '<' character which is followed by an '/' character. You can't have CDATA after the closing tag of the document element, and comments and processing instructions have different characters following the '<'.

  • JSP for Vcard cannot strip carriage return in the last line of the file.

    I am using JSP to output a Vcard (http://en.wikipedia.org/wiki/VCard)
    The following code works great in Windows but fails on the mac:
    <%@ page contentType="text/x-vcard" %><%--
    --%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--
    --%><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %><%--
    --%>BEGIN:VCARD
    VERSION:2.1
    <c:choose><%--
    --%><c:when test="${not ((empty param.lan) and (empty param.fin)) }"><%--
    --%>N:${param.lan};${param.fin}
    FN:${param.fin} ${param.lan}
    </c:when><%--
    --%><c:otherwise><%--
    --%>FN:${param.org}
    </c:otherwise><%--
    --%></c:choose><%--
    --%>ORG:${param.org}
    TITLE:${param.title}
    TEL;WORK;VOICE:${param.phwork}
    ADR;WORK:;;${param.st};${param.city};${param.state};${param.zip};
    EMAIL;PREF;INTERNET:${param.email}
    REV:20080424T195243Z
    <c:out value="${fn:replace('END:VCARD','\\\r','')}" escapeXml="false"/>After some tests, I discovered that Mac (I used Tiger, latest update, not Leopard) needs extra white space and carriage returns stripped off. Once this is achieved, the vcard will automatically import into Address Book. I have followed other forums which advice on using JSP comments as in the code above. But for some strange reason the last line of the JSP outputs an extra carraige return. How do I get rid of the carriage return at the end of the file? the replace function from JSTL is not working.
    Edited by: shogo2040 on Dec 18, 2008 7:11 PM : I added more detail to the Subject

    I originally had that END:VCARD without any carriage return.
    But I still get an extra carriage return at the end when the JSP renders to VCF
    I'm using Tomcat running on Linux.
    I found this, article which implies (but does not explicitly say) JSP in general adds a newline to the last line:
    http://www.caucho.com/resin-3.0/jsp/faq.xtp (But its not tomcat either, so maybe this info is irrelevant).
    Edited by: shogo2040 on Dec 22, 2008 3:31 PM - changed rendered to VCF from rendered to JSP

  • How can I get the size of all lines or the last line number in a DB?

    I want to display a certain number of lines from a DB.
    But before I fetch them out, I must know how many lines of this DB has.
    I donnot know if there is some methods have this function. I know the last() method can move the cursor to the last line, but some DB cannot support this function.
    Could someone know the answer or some examples about displaying data in a jsp?
    Thanks a lot.

    To get the number of rows in a ResultSet, loop over the result set with while(res.next()). Read each row into an object. Add each object into a, say, LinkedList. At the end, you will have the rows nicely converted to objects (which you probably should do anyway), and list.size() will give the number of objects.
    There are other ways to get the number of objects, but list.size() is the easy and reliable way. If you don't need the rows converted to objects ...why did you select them in the first place?
    Tricks with last() and whatnot sort of work. They read the entire result set into memory. But you'll need to write the while(res.next()) loop anyway. No point in having the computer do the same thing twice.

  • Copy one text file to another text file and delete last line

    Hi all wonder if someone can help, i want to be able to copy one text file to another text file and remove the last line of the first text file. So currently i have this method:
    Writer output = null;
             File file = new File("playerData.xml");
             try {
                   output = new BufferedWriter(new FileWriter(file, true));
                   output.write("\t" + "<player>" + "\n");
                   output.write("\t" + "\t" + "<playerName>" + playerName + "</playerName>" + "\n");
                   output.write("\t" + "\t" + "<playerScore>" + pointCount + "</playerScore>" + "\n");
                   output.write("\t" + "\t" + "<playerTime>" + minutes + " minutes " + seconds + " seconds" + "</playerTime>" + "\n");
                   output.write("\t" + "</player>" + "\n");
                   output.write("</indianaTuxPlayer>" + "\n");
                  output.close();
                  System.out.println("Player data saved!");
             catch (IOException e) {
                   e.printStackTrace();
              }However each time the method is run i get the "</indianaTuxPlayer>" line repeated, now when i come to read this in as a java file i get errors becuase its not well formed. So my idea is to copy the original file, remove the last line of that file, so the </indianaTuxPlayer> line and then add this to a new file with the next data saved in it. So i would end up with something like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <indianaTuxPlayers>
         <player>
              <playerName>Default Player</playerName>
              <playerScore>0</playerScore>
              <playerTime>null minutes null seconds</playerTime>
         </player>
         <player>
              <playerName>Default Player</playerName>
              <playerScore>0</playerScore>
              <playerTime>null minutes null seconds</playerTime>
         </player>
         <player>
              <playerName>Default Player</playerName>
              <playerScore>0</playerScore>
              <playerTime>null minutes null seconds</playerTime>
         </player>
    </indianaTuxPlayers>
    However after all day searching the internet and trying ways, i have been unable to get anything working, could anyone give me a hand please?

    I would go the XML route too, but for fun, open a file as a BufferedWriter and do this:
    void copyAllButLastLine(File src, BufferedWriter tgt) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader(src));
        try {
            String previous= in.readLine();
            for (String current = null; (current = in.readLine()) != null; previous=current) {
                tgt.write(previous);
                tgt.newLine();
        } finally {
            in.close();
    }

  • Method GUI_DOWNLOAD not creating CRLF at end-of-each-line of output

    Hello SDN Community,  has anyone experienced CL_GUI_FRONTEND_SERVICES=> GUI_DOWNLOAD not putting the CRLF at end of exported lines?  This can be seen when you view the output file in notepad (the file contents wrap) or an editor with hex view enabled  (0A0D).
    I have tried running an ABAP that runs this method and on some people's laptop's the file wraps and on others the file is formatted (as would be expected) as per the CRLF's. 
    My understanding is that the GUI_DOWNLOAD method should provide the CRLF's.   And on my laptop (running Vista and SAP ECC 6.0 back-end) it wraps the output because there are no CRLF's in the file.
    Your experiences would be appreciated.
    Thank you,
    Dean Atteberry.

    Thank you, Alejandro, for your comments.  I am using two systems - on one it works and on the other it does not.
    The one that works is an SAP ECC 6.0 where the CL_GUI_FRONTEND_SERVICES class has a Last Change date of 03.07.2006.
    The one do not work is SAP ECC 6.0 where the CL_GUI_FRONTEND_SERVICES class has a Last Change date of 07/08/2009.
    If I look at the code in GET_PLATFORM, it is verry different between the two systems.
    On the one that works, it executes following code and platformID has value of '5'.  This later used to assign the correct value for CRLF variable which is used to concatenate to end of records  (value is '0A0D').
    ELSE.
    *     SAP GUI for Windows
          IF ACTIVEX IS NOT INITIAL.
    * returns Windows Platform
    * VER_PLATFORM_WIN32s             0
    * VER_PLATFORM_WIN32_WINDOWS      1       (Win95/98)
    * VER_PLATFORM_WIN32_NT           2
            CALL METHOD HANDLE->CALL_METHOD
              EXPORTING
                METHOD     = 'GetWindowsPlatform'
                P_COUNT    = 0
                QUEUE_ONLY = ' '
              IMPORTING
                RESULT     = platformID
              EXCEPTIONS
                OTHERS     = 1.
            IF SY-SUBRC <> 0.
              RAISE CNTL_ERROR.
            ENDIF.
    On the one that does not work, it executes following code.  In the debugger, when control comes back from CL_GUI_CFW=>FLUSH call, I can see the PLATFORMID variable change to '15'.  This is moved to M_PLATFORM and ultimately is used later in a case statement to assign the appropriate value to CRLF variable. 
    HOWEVER, THERE IS NO "WHEN 15" statement in the CASE statement - IT ONLY GOES UP TO '14'.   Because of this, no value is assigned to the CRLF variable and when subsequently this variable is concatenated to the output line, there is no CRLF (0A0D) at the end of the line.  Because the CRLF variable is blank.  [see coding snippets at end-of-note]
    Is there an better place than General ABAP forum to discuss this?  Possibly this item might benefit from the attention of SAP developers?
    Following are code snippets illustrating findings from debugging...
    This shows the FLUSH statement that causes '15' to appear in the PLATFORMID variable.
    IF bPLATFORMEX = ABAP_TRUE.
            CALL METHOD HANDLE->CALL_METHOD
              EXPORTING
                METHOD     = 'GetPlatformEx'
                P_COUNT    = 0
                QUEUE_ONLY = ' '
              IMPORTING
                RESULT     = PLATFORMID
              EXCEPTIONS
                OTHERS     = 1.
            CALL METHOD CL_GUI_CFW=>FLUSH
              EXCEPTIONS
                CNTL_SYSTEM_ERROR = 1
                CNTL_ERROR        = 2
                others            = 3.
            IF SY-SUBRC <> 0.
              RAISE CNTL_ERROR.
            ENDIF.
            MOVE PLATFORMID TO M_PLATFORM.
    This shows the method GET_LF_FOR_DESTINATION_GUI, where you can see that values only go up to 14.  [look in attributes for CL_GUI_FRONTEND_SERVICES to see attribute values]
    CASE PLATFORM_ID.
          WHEN CL_GUI_FRONTEND_SERVICES=>PLATFORM_WINDOWSXP.   <---- this is '14'
            MOVE CL_ABAP_CHAR_UTILITIES=>CR_LF TO GUI_CRLF.
          WHEN CL_GUI_FRONTEND_SERVICES=>PLATFORM_NT50.
            MOVE CL_ABAP_CHAR_UTILITIES=>CR_LF TO GUI_CRLF.
         <...lines snipped...>
          WHEN CL_GUI_FRONTEND_SERVICES=>PLATFORM_TRU64.
            MOVE CL_ABAP_CHAR_UTILITIES=>NEWLINE TO GUI_CRLF.
          WHEN CL_GUI_FRONTEND_SERVICES=>PLATFORM_OS2.
            MOVE CL_ABAP_CHAR_UTILITIES=>NEWLINE TO GUI_CRLF.
          WHEN CL_GUI_FRONTEND_SERVICES=>PLATFORM_UNKNOWN.
            RAISE CNTL_ERROR.
        ENDCASE.
      ENDIF.
      MOVE GUI_CRLF TO LINEFEED.
    This shows the FORM put_char_linebuffer you can see CRLF being concatenated to output line...
    prc_column_idx = prc_column_idx + 1.
        ENDWHILE.
        CONCATENATE prc_encoded_string prc_encoded_crlf
          INTO prc_encoded_string IN BYTE MODE.
      ENDIF.
    * Add data lines
      LOOP AT par_data_tab ASSIGNING <f_data_tab>.
        PERFORM put_char_linebuffer USING <f_data_tab>
                                          par_write_field_separator
                                          par_trunc_trailing_blanks
                                          par_col_select
                                          par_col_select_mask
                                          par_write_lf
                                          strDecimal
                                          strDatFormat
                                          par_dat_mode
                                          par_trunc_trailing_blanks_eol
                                    CHANGING converter
                                             prc_encoded_string.
        IF par_write_lf IS NOT INITIAL.
    *     Add CR to line.
          CONCATENATE prc_encoded_string  prc_encoded_crlf
              INTO prc_encoded_string IN BYTE MODE.
        ENDIF.
      ENDLOOP.
    * Write BOM if requested and Unicode encoding
      CLEAR prc_bom_string.

  • Cannot retrieve all vector objects - reading only last line .. Please help

    <pre>
    When I test the vector in the method that adds the elements, each line is returned. Testing the vector in the method getData(), all items are returned within the while loop, but the test returns only the last line of in the vector. Can anyone help me out and let me know what I'm doing wrong.
    Here's a summary of what I'm doing and the code follows.....
    My bean class:
    - creates a vector and adds several lines to the vector
    - using StringTokenizer and Enumeration, parses the data and checks to see if the line has the required amount of tokens (which is 4). If so, then the string is passed to my main class
    In the main class, the string is parsed into its appropriate attribute and then the required ones are displayed in the browser.
    //Vector class bean
    public SpecBean()
    public Vector addData()
    vecdata.addElement ("3|4||");
    vecdata.addElement ("2|3||1200");
    vecdata.addElement ("1|2|Q|");
    vecdata.addElement ("4|2|U|4356");
    return vecdata;
    public String getData()
    StringTokenizer st;
    String record = new String();
    Enumeration enumdata = vecdata.elements();
    while (enumdata.hasMoreElements())
    record = enumdata.nextElement().toString();
    System.out.println (record);
    st = new StringTokenizer( record, "|");
    int numberOfTokens = st.countTokens();
    if (numberOfTokens < 4)
    record = "Incomplete Data";
    return record;
    // end class...
    //begin main class -- this is a servlet which is why the
    //out.println statements are there
    try {
    SpecBean specs = new SpecBean();
    specs.getItemListing();
    token = new StringTokenizer ((String)specs.getData(), "|");
    out.println ("<table width=\"100%\" border=1>");
    out.println("<tr>");
    out.println ("<td width=\"40%\">");
    while (token.hasMoreTokens())
    String id = token.nextToken();
    String orderNum = token.nextToken();
    String name = token.nextToken();
    String confNum = token.nextToken();
    out.println (title + "</td>");
    out.println ("<td width=\"20%\" align=\"right\">" + "$" + price + "</td>");
    out.println ("<td width=\"40%\">" + notes);
    //end main class
    Thank you.

    <pre>
    My apologies. What I was looking to do was return EVERY line from the vector that had an equivalent of 4 tokens and no less. I just realized that the sample data I had entered into the vector only had one line w/ 4 tokens. When this is modified and there are 2+ lines that contain 4 tokens, the only line that is retrieved is the very last line. So if the data in the vector was:
    public Vector addData()
    vecdata.addElement ("3|4|rtd|222");
    vecdata.addElement ("2|3||1200");
    vecdata.addElement ("1|2|QsT|");
    vecdata.addElement ("4|2|U|4356");
    return vecdata;
    public String getData()
    StringTokenizer st;
    String record = new String();
    Enumeration enumdata = vecdata.elements();
    while (enumdata.hasMoreElements())
    record = enumdata.nextElement().toString();
    System.out.println (record);
    st = new StringTokenizer( record, "|");
    int numberOfTokens = st.countTokens();
    if (numberOfTokens < 4)
    record = "Incomplete Data";
    return record;
    The output to the browser is
    4 2 U 4356
    and not
    3 4 rtd 222
    4 2 U 4356
    I did some print statements throughout addData() and getData() to see if all of the objects in the vector were still there and everything checked out until I hit the end of the getData(). Before 'return record' the print statement returned '4 2 U 4356' only. I'm not sure what I have missed to have the getData() method return only one matching line and not all of them.
    Your help is appreciated. Thank you.

Maybe you are looking for

  • Mini DisplayPort to VGA Adaptor for my iMac app?

    I installed my Mini DisplayPort to VGA Adapter to my iMac and connected it to a ViewSonic Pro 8500 DCP projector and was unable to get the image on my iMac projected on to the screen.  Do I need an app for this and if so how do I obtain one?

  • Missing APPLICATIONS & FILE Icons and can't find my themes

    Please help.  I have a 3rd party application that I downloaded as required to my computer & now I need to transfer 5 files (JAR & TAR) files to my phone.  It says to follow the path: files/media card/ Blackberry/new_phones.In the instructions it says

  • Lock Object  Confusion

    Hello All ,               I have create one Module Pool program.it is having three t code for creation ,change and display. it is having two table Header and details table. I have decided to go for shared lock as per requirement. That's why created o

  • Vines and Instagram videos will not play or load on Mac

    See title. This problem is most prevalent on twitter and tumblr (where audio posts won't play or load, either). I cleared the cache and my cookies, but that didn't do anything. I found that I needed a Java update and installed that, and the problem w

  • Return from a method at the end of a thread

    Hi all, I've written a slideshow in a class implementing Runnable, overriding the run() method. I want that my a method "startSlideShow()" returns when the task of the thread ends (the thread mainly display images). I've tried the the join() method (