Restricting loop iterations in smartforms

hi,
    i am encountering a problem at loops in samrtforms.i am looping an vbak table and under that loop using an table i am displaying items each row in vbak each page and corresponding items.the problem is in vbak table thare are 12 rows but the sf iterating fo 13 times and in last page it is not displaying any values.i,e it it is iterating one more time than actual iterations.how to restrict it so that it will iterate for 12 times only.plz send some answers for me.thank u in advance.

Hi
I guess it is not a smartform iteration problem
What might have happened is,
When ever the contents to be displayed on a page exceeds the page limit the smartforms directly takes you to the next page and the remaining contents will get displayed in the next page
So just make sure that the contents of a each vbak entry does not exceed the page limit.
Regards,
Sagar

Similar Messages

  • The speed of the "for loop iteration"

    Hi all:
    I have written a short mini program just to test out the speed of a "for loop iteration"
    package generator;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2004</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
      private static long tmp = 0;
      public static int count=0;
      public synchronized long getValue(){
          long value = 0;
        value = 10 * System.currentTimeMillis();
        if(value == tmp){
          value++;
          count++;
        tmp = value;
        return value;
      public static void main(String[] args) {
       for (int i=0;i<1000;i++){
          getValue();
        System.out.println("count is " + count);
    }And i find that on average, count will be a value between 498-500, which probably means that on average the speed of a for loop is around 0.5 ms. But I guess the speed of the "for loop " iteration is also very much CPU dependent, could somebody possibly give me some education on this issue :) ?
    Also, anybody know exactly how System.currentTimeMillis works? For example, how does it get the current time from the OS, etc. let me know.
    Again, Many many thanks...

    Hi all:
    I have written a short mini program just to test out the speed of a "for loop iteration"You will find the overhead of the getValue() call, the increments and most importantly the System.currentTimeMillis() is what you are timing.
        public static void main(String args[])  {
            int ITER = 1000000000;
            long start = System.currentTimeMillis();
            for(int i=0;i<ITER;i++);
            long end = System.currentTimeMillis();
            System.out.println("Iterations per sec="+ITER*1000L/(end - start));
        }Prints the following Iterations per sec=576368876Running on a 1.8 GHz Intel/Windows2000

  • Use of loop node  in smartforms

    Hi ,
    Can anyone explain me in detail what is the  use of the loop node in smartforms.
    I want to repeat the two successor nodes alone until the loop ends .after the loop ends then only the third successor node should be executed.can we do this by using loop node. If yes please explain me how we can do this.
    Thanks,
    Rose.

    Hi,
        Yes, this is possible. Include the two nodes in the loop of the internal table. The third node should be outside the loop
    Regards.

  • Cause loop iteration to reRender

    First off sorry if this has been asked ... did a quick search and didn't see anything.
    Anyway here's my problem:
    We iterate over a list in JSF to output some controls (which are dynamic determined in Java). This works fine.
    Then it was decided that the controls which this list outputs need to validate 'on-the-fly' as users move through them. Again no problems; used a4j:support.
    The only issue is that the a4j:support we cannot give it a reRender target as all the controls are generated by the loop. We could reRender the entire form or else we can put self-rendered a4j:outputPanels around each parameter ... this works except that in both cases it causes all controls to be reRendered (as expected) and not just the control which sent the ajax update. This makes the behavior of the page controls feel very twitch, especially if the user is moving through them quickly.
    Is there anyway of causes ONLY the particular loop iteration to be reRendered? I've tried messing around with a4j:region for this but have not had any success. Would be really appreciative if anyone has a solution for this.
    Here's the basics of our page code; I've omitted all control types besides h:inputText.
    <ui:repeat value="#{seam-outjected-list}" var="item">
       <a4j:outputPanel ajaxRendered="true">
          <h:inputText value="#{item.value}">
             <a4j:support event="onblur" ajaxSingle="true" />
          </h:inputText>
       <a4j:outputPanel />
    </ui:repeat>

    Shameless bump for new work day ... :[
    Also I've tried giving the output panel an ID and calling rerender on that even though its generated in the loop. I can see the loop index in the series of component IDs so I was hopeful but alas the same issues :(

  • Simulate Signal Express VI is sending two periods of the wave per loop iteration - how can I reduce this to one period?

    Hello,
    I've been trying to use the Signal Generator Express VI and DAQ Assistant in order to generate an output waveform, as seen in this NI tutorial video:
    http://www.ni.com/academic/students/learn-daq/generate/ (timestamp is at 2:07 for what I'm trying to do)
    For background, I'm trying to move a piston device using Labview. The sine waveform is intended to move the piston at a smooth speed. For every loop iteration, the Simulate Signal VI running into my DAQ Assistant moves the piston to its maximum displacement and back twice. I cannot determine why this is occuring.
    The settings in my "Configure Simulate Signal" tab are as follows:
    Frequency: 1Hz
    Phase: 90 deg
    Amplitude: 2
    Offset: -2
    I would like my piston to only reach its maximum displacement and return for every iteration of the loop. I've tried adjusting all of the settings within "Configure Simluate Signal" but I can only work in even numbers - sending the piston back and fourth two, four, or eight times, ect.

    The Simulate Signal VI is set for integer number of cycles and the default frequency set in the Cycles per Second control is 3.75 Hz. That results in the signal containing three complete cycles and the data array contains 8000 elements, not the nominla 10000 specified in the Express VI dialog.
    If you only want one cycle, you need to specify the signal so that you only get one. Either reduce the frequency or reduce the number of samples.
    As you have noticed Express VIs do one thing exceedingly well: They obscure what is going on inside.  I pulled your signal generation code out into a separate VI and then created a generator which will generate the same signal but allow you to select the number of cycles. It uses the Sine Waveform.vi from the Signal Processing  >> Waveform Generation palette.
    I also recommend that you change the structure of your program. The use of sequence structures is discouraged in LabVIEW  because they defeat dataflow are very inflexible when changes need to be made. A Producer/Consumer Design Pattern plus a state machine would probably be a good choice. This will allow separation of the daq acquisition from the saving to file so that the timing of one does not constrain the timing of the other.
    Setting the Analog Input Read to read multiple samples simultaneously and using the hardware timing of the data acquisiton device will get data faster and the timing will be precisely (compared to software timing) controlled by the hardware.
    Writing to the same file in parallel loops probably results in some strange behavior such as differing numbers of writes from acquired data compared to generated cycles. As the file grows, the writes may slow down due to the OS needing to fragment or reallocate space for the file.
    Lynn
    Attachments:
    Signal generator.vi ‏49 KB

  • My vi is writing just the same data into spreadsheet even after changing the loop iteration time. hw can I change this mode ?

    My VI is writing the same amount of data into spreadsheet file even after changing the for-loop iteration time

    You should post the VI (with appropriate values saved as default) to this thread.  (At least a JPEG or PNG screenshot).
    Inside the For Loop, right-click on the N terminal and create Indicator.  Run the VI and you will see how many times the Loop spins.
    Further guessing:  You may have a 2D array with two rows and many columns feeding the For Loop.

  • Foreach loop iteration question

    Here's what I want to do. I have a list of items that I need to insert a comma between. For the last item there should be no comma afterward, so I need to flag this loop iteration as special.
    <c:set var="numRsns" value="${fn.length(networksForm.regionalSportsNetworkStations)}"/>
    <c:forEach var="rsn" items="${networksForm.regionalSportsNetworkStations}" varStatus="rsncounter">
         <c:if test="??? < numRsns" >
                               <b><c:out value="${rsn.description}" escapeXml="false" /></b>
                     </c:if>
         <b><c:out value="${rsn.description}," escapeXml="false" /></b>
    </c:forEach>How can I find out what the current iteration of the loop is? I am fairly new to JSP and JSTL so all help is appreciated.
    Thanks!

    Another useful feature of the loop status variable - it has boolean properties "first" and "last" to indicate if it is the first or last row
    <b>
    <c:forEach var="rsn" items="${networksForm.regionalSportsNetworkStations}" varStatus="rsncounter">
      <c:out value="${rsn.description}" escapeXml="false" />
      <c:if test="${rsncounter.last}>,</c:if>
    </c:forEach>
    </b>{code}
    Also because everything in your loop is bolded, why not just put bold tags around the whole thing, rather than mark up each individual element?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Why is loop iterator signed and not unsigned?

    Why is the data type of loop iterator a signed integer rather than an unsigned integer?  

    I32 is much more universal, and is for example used for array indices, array sizes, etc. The iteration terminal is most often connected to one of those functions. Your diagram would have the measles, with coercion dots all over without I32 on the iterator.
    If you need to keep count with e.g. U32 or U64, you can make your own using a shift register and +1 function.
    (There are ideas to make the representation changeable according to your needs. See also my comment here)
    LabVIEW Champion . Do more with less code and in less time .

  • What happens to the while loop iteration counter if it runs unchecked?

    I want to use the iteration counter to initialise a value on the first loop of a while statement. ie i = 0, x = 100. Fine. The application I am building will be left to run for weeks or months on end without stopping (hopefully :¬)). What happens to the iteration counter in this situation? Does it reset to 0 or what? I don't want it reinitialising any values while the loop is running other than when it starts.
    I set up a while loop to try to figure out what happens and the iteration counter stops at 2147483648 which is 2^31 - 1.
    Any help would be appreciated,
    Thanks,
    Niel.

    It might be something you already looked at, but perhaps it's an option to perform the initialization outside (before) the while loop. That way it will be initialized correctly only once, no matter what the iteration counter does.
    Of course if you need the counter for other purposes than initialization you might have the same problem...
    Note that a lot of the timer functions also overflow after a certain time (I believe 24 or 48 days?) so be careful running very long loops (but you already knew that probably).

  • My loop statement in smartforms seems not to be working...

    Hello Experts,
    I am currently practicing smartforms and I am trying to display the records of my internal table.
    What I did was in my table under MAIN window I have put the statement:
    it_spfli into wa_spfli and also in my main area of my table I have a loop statement. Now, in one of my text
    i put wa_spfli-carrid, wa_spfli-countryfr, etc. But it still does not show any data.Help would be greatly appreciated.

    u will be getting a function module name for the smartform then
    goto se37-->enter the FM name -->search for the ITAB you r using then put a break point.
    come back to u r program the run.. controle will stops over there then check whether the data is populating or not.
    INPUT and OUTPUT patameters are for program line and INITIALIZATION tabs.. when you want to modify some data in these you need to give the veriable or ITABs u r using inside. so that system will determine the global declarations(veriable or ITAbs).
    for more info refer these links
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm

  • How to detect the final loop iteration of a step in a PostStep Engine Callback?

    I see the need to use a PostStep Engine Callback and look at the Step.Result container of the caller.
    My issue: If the caller is configured to loop, the PostStep Engine CB executes with each iteration and I do not see how to detect the final iteration (which is the only iteration I am interested in).
    Ideas are welcome. Thanks in advance,
    Guenter

    Guenter,
    well, the way i discripted IS the generic way. The reason for this is the following:
    You can compare TestStand very well with procedural programming languages. So you have variables with different lifetimes and scope. RunState is one variable, which is available in every scope, but it may have different content.
    So you leaving the execution of your clientsequence in order to call the callback, you leave the scope of the RunState from your clientsequence. But only there the information is stored on how many iterations are left. It does not make sense to pass this anywhere, since the execution of your clientsequence has to decide if to loop further or not.
    But, please note that there are different scopes for the "disable result recording" as well. You have found the most global one, the station option. But you can as well set this in the sequence settings (Edit >> Sequence Properties >> Disable Result Recording for All Steps) and at step-level (Run Options >> Record Result {uncheck it}).
    Looping on a single step using the step settings, you can additionally choose not to record results for each iteration. This will lead to only a single entry in the ResultList, the overall result of the looped step (if resultcollection is enabled of course!).
    hope this helps,
    Norbert 
    Message Edited by Norbert B on 08-22-2008 02:10 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Any way to sample segment length longer than loop iterations w/o shift registers?

    Hi all,
    My loop iterates approx every 0.06s and now i've been asked to add to the program a function which will sample the most recent 3s of data and return the max/min value for two of the signals.  I can think of a programmatically clumsy way to do this with shift registers- take the max/min for each iteration, save-repeat-compare until you have enough iterations to fill 3s of time.  But I can't help but think there has to be a cleaner(better?) way to do this. 
    Any help?
    Thanks
    Solved!
    Go to Solution.

    Hi there,
    Try looking into a circular buffer.  
    http://zone.ni.com/devzone/cda/tut/p/id/7188
    Once you've determined how often you're putting entries into the buffer, you'll know exactly how big of an array to grab and do the Min/Max on.  
    Another option is to use a circular array.  
    http://decibel.ni.com/content/docs/DOC-3414
    I would set this up to function a little like a Functional Global or an Action Engine.   The subVI would then be used in your DAQ loop to "stack" new data.   And then called in another loop or part of your code to be read every three seconds.  
    Patrick Allen

  • For-loop & iterator.remove()

    Is it possible to remove an item during iterating with for-loop?
    for (SelectionKey opKey : selector.selectedKeys())
         // I need to remove opKey from selectedKeys set.
    }Is it really necessary to remove handled key from selectedKeys set? What will happen if I run selector.select() while selectedKeys set contains some keys?

    Desiderata wrote:
    Is it possible to remove an item during iterating with enhanced-for-loop?No
    Is it really necessary to remove handled key from selectedKeys set? What will happen if I run selector.select() while selectedKeys set contains some keys?[Selector Selection|http://java.sun.com/j2se/1.5.0/docs/api/java/nio/channels/Selector.html#selop]

  • Address restriction for country in smartforms

    Hi,
    My requirement is like this,
    I m passing address number (adrnr) to address tag (Standard address node)
    in smartform and getting the address correctly including all the details.
    But i want to print the country only if it is not equal to 'GB'.
    As i m fetching it by passing adrnr how shud i restrict country not to be printed??
    Plz help.

    The country will print if the country is not equal to the Sending Country in the General Attributes tab of the Address Node.
    So you will need to create a Program Lines node in which you retrieved the country.
    Then you will need to create 2 Address Nodes. 
    The first Address Node should have a Condition that the country = 'GB'.
    Also in this first Address Node fill in the Sending Country as GB.
    The second Address Node should have nothing filled in to the Sending Country and have a Condition that the country <> 'GB'.

  • ForEach Loop Iteration Order

    Hi,
    I have a SSIS package that uses a Foreach Loop Container to iterate through a series of flat files. The order in which the files are iterated through is based on the name of the file. Is it possible to change the iteration order? More specifically, can the
    iteration order be changed to the date when the file was placed in the iteration folder? i.e files that have been sitting in a folder for a longer amount of time get processed first?

    you can change order but for that you need to use a control table based approach. Using file enumerator  will always take order based on filename.
    The approach would be like this. Have a for each loop based on file enumerator first. Take the filename and arrival date (this you can get inside a script task see
    http://jamelcato.com/111/how-to-check-last-modified-date-using-ssis/) and populate the table with the information.
    Have a object variable and set query as 
    SELECT fileName
    FROM table
    ORDER BY DateField
    Then have a for each loop to iterate through object variable use ADO enumerator
    http://www.select-sql.com/mssql/loop-through-ado-recordset-in-ssis.html
    This would make sure it iterates based on file date value. Then have a variable inside to retrieve filename each time and use it for whatever processing you want.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for