How to avoid last line(ie repeating last line)

I wrote a procedure for writing DB table to flat file.
but the last line is repeating ie printing twice.
     OPEN curr_v FOR str_all_cols_sel;          
LOOP FETCH curr_v INTO l_columnValue;
          utl_file.put_line(l_output,l_columnValue);
EXIT WHEN curr_v%NOTFOUND;
END LOOP; -- curr_v
Any help?

If you reached the last record, it gets printed. Then it fetches once more, but no data is found. However you first print and then exit. That's why the last line gets printed twice.
The code should be:
OPEN curr_v FOR str_all_cols_sel;
LOOP
FETCH curr_v INTO l_columnValue;
EXIT WHEN curr_v%NOTFOUND;
utl_file.put_line(l_output,l_columnValue);
END LOOP; -- curr_v
Regards,
Rob.

Similar Messages

  • How To avoid column heading for only total line in ALV list Display

    Hi,
    How To avoid column heading for only total line in ALV list Display.

    Hi,
    to change colunm header field catlog is built
    look at the example below
    Changing column text headers
    use this to change, hide, or alter the ALV columns
    CLEAR: gt_fcat.
    READ TABLE gt_fcat WITH KEY fieldname = 'TEXT1' " ***
    *TEXT1 is your field name
       ASSIGNING <gtfcat>.
    IF sy-subrc = 0.
       <gtfcat>-coltext   = 'Date Type'.
       <gtfcat>-no_out    = ' '.
       <gtfcat>-tooltip   = 'Date Type Text from IT0019'.
       <gtfcat>-seltext   = 'IT0019'.
    keep seltext to '' if u want to hide
    ENDIF.
    regards
    austin

  • How to avoide entry of same material in  line item in same sales order?

    Dear SD Experts,
      In my project client has requirement related to Material in sales order. Client wants " while creating sales order (VA01) that time particular Material  should use one time in the sales order". If  same material used more than one time in item line in the existing sales order  that time system must  give the Error  Massage.
    Kindly suggest me how can I fulfill above requirement. 
    Regards,
    Manzoor Ahmad

    Hi Manzoor Ahmad,
    This is an interesting requirement  and this cannot be achieved through Standard SAP functionality. We can achive this through custom development in Userexit MV45AFZZ with the help of Developer . The logic has to be while creating sales order , you have created line no 10 with "matl no 1234 " and again trying to use the same material  in line no 30 , then the system has to check all the line items that are created before the line no 30 . This same logic need to be applied for Tcode VA02  also.
    Please post the  the solution once implemented.
    Thanks and regards
    Veera

  • Cheque printing. How to avoid last page in case of check printing in F110?

    F-68 prints only one page whereas F110 prints 2 pages.
    How to avoid last page in case of check printing using F110? Is there any other option than changing the Script.

    Hi,
    Im also facing the same issue. Generates 1 page with F-58 but 2 pages with f110. Kindly let me know how to resolve.

  • How to delete the line between the last point and first point?

    How to delete the line between the last point and first point? 
    I want to draw a curve many times, from first point to the end point. and redraw from first point to the end point.But I hope update point by point. but between the end point and the first point,  there is a line. How to delete the line?
    the code is:
    CNiReal64Vector plotData(50);
    m_graph.ChartLength = 50;
    //m_graph.ClearData();
    for (int j = 0; j < 2; j++)
           for (int i=0; i<50; i++)
                   plotData[i] = ((double)rand()/(double)RAND_MAX)*6 + 4;
                   m_graph.GetPlots().Item("Plot-1").ChartXY(i, plotData[i]);
                   Sleep(100);
    Attachments:
    20150605142608.png ‏31 KB

    Hi Kumar,
    I think you can just delete it in the sales order directly, if you are using make-to-order scenario, then there will be special stock left for the sales order as the production has been goods receipt, you need to use MM transaction move the stock to unrestricted use stock. If you are using make-to-stock scenario, there should be no further problem. If you are using assembly order, please try to reject the sales order item to see if it could fullfill your requirement.
    Regards,
    Rachel

  • How to view the first and the last frame of a clip or a selected range in the time line?

    How to view the first and the last frame of a clip directly or in a selected range in the time line ? Up arrow and down arrow keys changes only between the first frame of the consecutive clips. Even ; and ' does the same. I mean what is the shortcut keys for first to last and last to first frame of a clip? Help please.

    SELECT PurOrderNum,
    OrderDate
    FROM
    SELECT PurOrderNum,
    OrderDate,
    MAX(OrderDate) OVER (PARTITION BY DATEDIFF(mm,0,OrderDate)) AS MaxDate,
    MIN(OrderDate) OVER (PARTITION BY DATEDIFF(mm,0,OrderDate)) AS MinDate
    FROM Purchasing.PurOrder
    WHERE OrderDate >= '2013-02-28'
    AND OrderDate <= '2014-12-29'
    )t
    WHERE OrderDate = MaxDate
    OR OrderDate = MinDate
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to find out Last Changed Fields for a line item of a PO

    Dear All,
    Pls let me know is there any FM or procedure to find the last changed fields for each line item of a PO. I should be able to get the details on the basis of Last changed Date. Can u pls guide me in this?

    Hello,
    Check the table CDHDR,CDPOS for PO items,
    Check this code:
    REPORT ZV_GET_LATEST_SO .
    DATA: BEGIN OF ITAB OCCURS 0,
            OBJECTCLAS TYPE CDHDR-OBJECTCLAS,
            OBJECTID TYPE CDHDR-OBJECTID,
            CHANGENR TYPE CDHDR-CHANGENR,
            USERNAME TYPE CDHDR-USERNAME,
            UDATE TYPE CDHDR-UDATE,
            UTIME TYPE CDHDR-UTIME,
            TCODE TYPE CDHDR-TCODE,
            TABNAME TYPE CDPOS-TABNAME,
            TABKEY TYPE CDPOS-TABKEY,
            FNAME TYPE CDPOS-FNAME,
            CHNGIND TYPE CDPOS-CHNGIND,
          END OF ITAB.
    TABLES: CDHDR,CDPOS.
    DATA: LT_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE,
    LT_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
    *REFRESH AUSG.
    CLEAR CDHDR.
    CLEAR CDPOS.
    CDHDR-OBJECTCLAS = 'EINKBELEG'.
    CDHDR-OBJECTID   = '0000001784'.  " Purchase order number
    **SELECT A~OBJECTCLASS A~OBJECTID A~CHANGENR A~USERNAME A~UDATE A~UNAME
    **B~TCODE
    **B~TABNAME B~TABKEY B~FNAME B~CHNGIND INTO TABLE ITAB FROM CDHDR AS A
    **INNER JOIN CDPOS AS B ON A~OBJECTCLASS = B~OBJECTCLASS
    **                         A~OBJECTID    = B~OBJECTID
    **                         A~CHANGENR    = B~CHANGENR
    **                    WHERE OBJECTCLAS = 'VERKBELEG'
    **                      AND OBJECTID = '0000001784'.
    *SELECT * FROM CDPOS INTO TABLE LT_CDPOS WHERE OBJECTCLAS = 'VERKBELEG'
    *                                    AND OBJECTID = '0000001784'.
    *IF NOT LT_CDPOS[] IS INITIAL.
    *  SELECT *
    *  INTO   TABLE LT_CDHDR
    *  FROM   CDHDR
    *  FOR    ALL ENTRIES IN LT_CDPOS
    *  WHERE  OBJECTCLAS = LT_CDPOS-OBJECTCLAS
    *  AND    OBJECTID = LT_CDPOS-OBJECTID
    *  AND    CHANGENR = LT_CDPOS-CHANGENR.
    *ENDIF.
    **  SORT ITAB BY OBJECTCLAS ODJECTID DESCENDING.
    *LOOP AT ITAB.
    *  WRITE: ITAB-UDATE."ITAB-UNAME.
    *ENDLOOP.
    *--- Interne Tabellen -------------------------------------------------
    DATA: BEGIN OF ICDSHW OCCURS 50.       "Ausgabeaufbereitung
            INCLUDE STRUCTURE CDSHW.       "Zwischendatei
    DATA: END OF ICDSHW.
    CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
         EXPORTING
              DATE_OF_CHANGE    = CDHDR-UDATE
              OBJECTCLASS       = CDHDR-OBJECTCLAS
              OBJECTID          = CDHDR-OBJECTID
              TIME_OF_CHANGE    = CDHDR-UTIME
              USERNAME          = CDHDR-USERNAME
         TABLES
              I_CDHDR           = LT_CDHDR
         EXCEPTIONS
              NO_POSITION_FOUND = 1
              OTHERS            = 2.
    LOOP AT LT_CDHDR.
      CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
        EXPORTING
    *   ARCHIVE_HANDLE                = 0
          CHANGENUMBER                  = LT_CDHDR-CHANGENR
    *   TABLEKEY                      = '00000000 '
    *   TABLENAME                     = ' '
    * IMPORTING
    *   HEADER                        =
       TABLES
         EDITPOS                       = ICDSHW
    *   EDITPOS_WITH_HEADER           =
    * EXCEPTIONS
    *   NO_POSITION_FOUND             = 1
    *   WRONG_ACCESS_TO_ARCHIVE       = 2
    *   OTHERS                        = 3
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT ICDSHW.
        IF ICDSHW-TABKEY+3(10) = '0000001784'
           AND ICDSHW-TABKEY+13(6) = '000001'.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    Vasanth

  • How to print header in first and last  page only in SAPSCRIPT

    Hi!
    How to print header in first and last  page only in SAPSCRIPT,
    in between pages,  I need to print all line items in MAIN window only .
    Thanks in anticipation!
    Aki.

    Hi All,
    Thanks for your early update...but my requirement here is
    I have two pages (FIRST , NEXT ) First is having Header, Main and Footer
    NEXT is having Main and Footer ..I am printing PO here..let us think that my PO is having 20lines items , let us assume that it takes five pages...
    Now how application is printing is ..first set of data is printing in FIRST page and remainiang data distributed to 4 pages printing in NEXT page ..but what my requirement is , I need fifth page print on FIRST page, instead of NEXT page... Ultimately I need last set of data always print in FIRST ie out of 5 pages 1st print on FIRST 2nd 3rd 4th print on NEXT and 5th print again on FIRST .
    hope you this will clear you.
    Thanks!

  • How to remove item header on the last page

    Hi,
    We have an adobe form where, on the last page a BIG footer gets displayed.
    Now if the number of line items are not enough, they wont go till the last page, but the last would still be printed with no line items, just to accomodate the huge footer that we want to be displayed only on the last page.
    Now in doing this, we want that if there are no line items on the last page, the item header should not be displayed. We are not sure how do we do this.
    The same is accomplished in SAP Script, and there they are using WRITE_FORM with type DELETE. So anything that prints after that even on a new page, the item header wont get printed.
    Please suggest how do we do this in Adobe Forms.
    Thanks,
    Tirth

    Hi Mate,
    there is a contradiction then.
    in table header rows definition, we specify show header in subsequent pages, then the header appears only if there are items displayed on that page. in your case the table header shouldn't be displayed then please check why its comming out there...?
    well in any case if you want the script it would be like below on layout ready event of the header row.
    // run the below script in last page
    if(xfa.layout.page(this) == xfa.layout.pageCount()){
    var pageSFList = xfa.layout.pageContent(xfa.layout.page(this) - 1, "subform", false);
    var pageTotal = 0;
    // for each subform named <Item>, which is the data row of the table
    for (var i = 0; i < pageSFList.length; i++)
         var sf = pageSFList.item(i);
            if(sf.name == "headerrow"){ // if header row is found then chec is data row is visible and set its presence accordingly
               if(sf.parent.item.presence == "hidden"){
                   sf.presence = "hidden";
         if (sf.name == "Item") // if data row itself is found set its presence accordingly
           sf.parent.headerrow.presence = "visible";
    you might need to tweak the code according to your element names.
    hope this helps,
    Cheers,
    Sai

  • Emacs is displaying the first column of the line on the last column of the previous line

    The first column of my lines are being displayed on the last column of the previous line. This a very irritating glitch that I have no clue how to fix or even troubleshoot. (red bars were added using preview to hide personal info)
    I've downloaded MacPorts and reinstalled emacs:
    GNU Emacs 24.4.1
    Copyright (C) 2014 Free Software Foundation, Inc.
    GNU Emacs comes with ABSOLUTELY NO WARRANTY.
    You may redistribute copies of Emacs
    under the terms of the GNU General Public License.
    For more information about these matters, see the file named COPYING.
    I'm open to any suggestions on how to fix this graphical glitch.
    Much thanks
    Message was edited by: Conner_36

    Given that the Emacs for OS X works ok and the Emacs shipped with OS X works it would seem to be some issue with MacPorts and their version.
    Totally unfamiliar with MacPorts so have no idea how the program gets compiled,what libraries it is using and what if any config settings are needs or set so I'm afraid I won;t be much help there.  That you are on a MBP with a retina display may be part of the problem.
    So with the setup you have now, hardware and software including OS,  it was working and then just like that it stopped? Something much have changed around the time it stop working if you can think back to then it might help you resolve the problem.
    As you are doing programming can i assume you have Xcode and the command line tools installed? If not how do you compile your code? The reason I ask is compiling Emacs from there GNU source is not all that difficult. It might be worth trying that.
    One last thing given that the two other versions of Emacs displayed the file OK this strongly suggests the problem is not in your .emacs file or your environment however as I wrote I am not familiar with MacPorts so it is possible there is another config file messing you up. As a test for this create a new user or log in as the Guest user (this is best as you;re guaranteed the environment is clean) and look at the file in question in MacPorts Emacs. If it displays OK then there is something in your environment causing this, If it messes up  even in the new user then I'd say ditch MacPorts..
    regards
    <edit>
    Just to rule out init files  if you start emacs with the -q(minus que) flag the .emacs file is not read in, if you use  --no-site-file it will not load the site file if it exists.
    I'd try running the MacPorts emacs with those two flags to see f anything changes.

  • HT4623 How can update my iPhone to the last ios5. I dont want ios 6 as I want to keep google maps

    How can update my iPhone to the last ios5. I dont want ios 6 as I want to keep google maps?

    I disagree, Mr. WJ:
    If Matt had updated his iPhone via the Cloud and not by USB cable to his computer, the old IOS would still be on the computer and he would be able to "restore" to it. It would depend on what his backup settings were configured.
    For instance, I always backup to my computer at home. But, in the last few days I was notified that IOS 6.1 came out. So, if I wanted, I could install the update via WIFI from where I am at work. But, my old IOS would still be safe on my home computer that I can restore from if need be.
    And then you basically repeated what I stated about Google Maps being a app you can download now.
    Who loves ya, baby?

  • How to write a subform @ bottom of last page without reserving space for it

    Hello gurus,
    I have a small challenge for you guys :-):
    Iu2019m developing an adobe print form for an invoice and have to write a subform at the bottom of the page but only if it is the last page. Said like this the requirement doesnu2019t seem so special at all which I agree with you but, if add to the problem that I must not reserve a place (on master page) to it so I can minimize the paper loss and use the maximum space of the page for the invoice items/taxes etc (for the container) and only write the subform at bottom if it is available space left it turns the problem a little bit more complex, isnu2019t? If case there isnu2019t available space in the u201Ccurrentu201D last page to write it I should provoke a page-break to write it at bottom of the u201Crealu201D last page.
    Iu2019ve tried to put the subform on the master pages (FIRST and NEXT) overlapping the end of the correspondent containers and hide it for all the pages that werenu2019t the last one but in some cases the subform content is overlapping the invoice items.
    Do you have any suggestions how to achieve this?
    Thanks in advance.
    Regards,
    Alexandre

    I don´t have a working demo of that two master pages approach. Was just an idea and I wanted to know if it works.
    But I have one more, less experimental idea, which I have implemented some time back and am sure, it works.
    Follow me:
    - fill the data into the table (done automatically, of course, but a must for the event to work = pick event after you got the data into the table...) (not a real work)
    - count the number of lines (easy, piece of cake)
    - get the height of one row (easy, piece of cake)
    - compute how many pages are occupied by the table lines
    - compute how many lines are present on the last page
    - compute how many lines are needed to make the last page "full"
    - use the last number to compute a height of a blank subform (no content but has size), set the height, which will make the "footer" (the one we are talking about here) go to the bottom of the page
    Every needed reference is here:
    http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf
    http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf
    Especially the last chapter of the JS reference.
    Regards Otto

  • How to print the text in only last but one page in sapscripts

    hiiiiiiiiiii,
             explian how to print the text in only last but one page in sapscripts? wher to write the code? plz if possible explain in detail with an example?

    Hello,
    The total no pages is given by &SAPSCRIPT-FORMPAGES& command.
    So u can handle the situation in ur form like this
    /: if &PAGE&  = &SAPSCRIPT-FORMPAGES&
    p1 TEXT
    /: endif
    Try in this way it may help u.
    Regards

  • How do i get rid of the last import album on my iPhone?

    How do i get rid of the last import album on my iPhone its taking up almost half my storage of my whole phone?!!

    This is the iPhoto for Mac forum - you need the iPhone forum for iPhone questions - I will request tha tit be moved
    LN

  • How do I connect my new (purchased last week) macbook air to my samsung smart tv? I purchased the adapter at the apple store and connected to the TV via HDMI cable.  The TV says "no signal.  I do not see TV as an option in the display tab of system prefer

    how do I connect my new (purchased last week) macbook air to my samsung smart tv? I purchased the adapter at the apple store and connected to the TV via HDMI cable.  The TV says "no signal.  I do not see TV as an option in the display tab of system preferences.  what else do I need to do?

    First, make sure your TV is tuned to display the correct input signal. Most TVs have several inputs (multiple HDMIs, cable connections, RCA etc) so double-check that you're using the correct one - HDMI1, HDMI2 or whatever is written next to the port.
    I assume that you have a mini-Displayport to HDMI adaptor? If you open displays preferences, first tick the box that says "show display preferences in menu bar" then locate the menu and click Detect Displays. See if that helps.
    Matt

Maybe you are looking for

  • How to print the properties in an object

    I have the following method that is meant to print all the details in a hashmap (allStudents). this hashmap contains references to objects of different students. what i need is to be able to print each object stored in allStudents, and each of those

  • Opening Word docs in InDesign CS4 (Mac)

    Hello everyone. This is my first time asking for help from this forum. I have just upgraded to CS4 from CS2 (Mac) and I have been having numerous issues with Word and InDesign. When I try downloading a fairly complicated Word file into InDesign CS4 i

  • Printing Thai characters on Windows 7

    Dear Experts, We are developing our system on Windows 7 and we are testing on the printer with Thai characters from SAP(GUI710 Patch 17).  On "Print Preview" everything looks fine but after printed there are some Thai characters (vowels) do not align

  • How do I set my tabs to open with my home page?

    When I open a tab, how can I get it to open to my Home Page - the page I have set to open when opening Firefox?

  • How do i calculate 10%(handling charge) and  5%(vat )

    Please i need help on how to calculate 10%(handling charge) and  5%(vat ) of a sub-total on my form. A step-by-step will help a lot. I have attached the form also.