Loop performance

Hello all 
I have a loop which is coded as below ..
LOOP AT ij_cawn
        WHERE atinn = j_3apghd-j_3abzd1.
   EXIT.
ENDLOOP.
When analysis was done using ST12, this was shown to take huge time. I would like to modify this code as
Read tavel ij_cawn with key atinn = j_3apghd-j_3abzd1. 
Binary search is not possible as the table is not sorted . Also I cannot sort it due to some other logic.
Could you please give me your valuable sggestions in thsi ..
Regards
Sudha

Hi,
make a copy of this internal table in other internal table.
sort that internal table. use Binary Search.
It can help you,
Sandeep Kaushik

Similar Messages

  • LOOP inside loop -performance  issue.

    hi ppl,
    I want to put the select query mentioned below outside the loop to resolve performance issue. The 'for all entries' does not support aggregate functions like 'sum' and 'group by'. plz have a look at my approach and suggest some changes.
    the code:
    LOOP AT T_UNITS.
    V_TABIX = SY-TABIX.
    CONCATENATE TEXT-S01 T_UNITS-UNIT INTO VL_TEXT SEPARATED BY ' '.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    PERCENTAGE = 0
    TEXT = VL_TEXT.
    get GLPCA postings
    SELECT AWTYP AWORG RACCT REFDOCNR SUM( HSL ) FROM GLPCA "1062
    INTO TABLE T_GLPCA
    WHERE RPRCTR = T_UNITS-UNIT
    AND RACCT IN S_HKONT
    AND KOKRS = V_KOKRS
    AND RYEAR = P_GJAHR
    AND POPER <= P_MONAT
    GROUP BY AWTYP AWORG RACCT REFDOCNR.
    lopp at t_glpca.
    endloop.
    endloop.
    my approach:
    all this put outside the loop 'loop at t_units'.
    SELECT rprctr AWTYP AWORG RACCT REFDOCNR HSL FROM GLPCA  "1062
      INTO TABLE T_GLPCA
      For all entries in t_units            
       WHERE RPRCTR = T_UNITS-UNIT
       AND   RACCT  IN S_HKONT
       AND   KOKRS = V_KOKRS
       AND   RYEAR = P_GJAHR
       AND   POPER  <= P_MONAT.
    loop at t_glpca.
        v_tabix = sy-tabix.
        select sum( hsl ) from glpca into t_glpca-hsl.
        modify t_glpca index v_tabix.
      endloop.
    The select query 'select sum( hsl ) from glpca into t_glpca-hsl' is consuming lot of time.
    thanks in advance
    Archana

    hi ,
        u can use sum function while displaying also .
    u have selected some values into itab na .aftyer that use the below code.
    loop at itab.
    at end of <fielname>.
    sum.
    write:/ itab-<fieldname>.
    endat.
    like this also u can some .so u can use for all entries in select statement .
    hopw it's usefull for u .
    or use
    on change of <fielname>
    endon.
    instead of at endof.
    EXAMPLE CODE
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab.
    LOOP AT sflight_tab INTO sflight_wa.
      AT NEW connid.
        WRITE: / sflight_wa-carrid,
                 sflight_wa-connid.
        ULINE.
      ENDAT.
      WRITE: / sflight_wa-fldate,
               sflight_wa-seatsocc.
      AT END OF connid.
        SUM.
        ULINE.
        WRITE: / 'Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        SKIP.
      ENDAT.

  • Performance issues using control references in Analog control loop?

    My main vi of a tensile tester control application calls a number of sub-vi's, including a analog control loop which controls the test. The control loop must update some boolean and digital indicators and respond to user input on the front panel of the main vi during a test.
    To simplify my main vi, I moved the control loop code into a sub-vi, and used control references to access the controls and indicators on the front panel. However, this has dramatically affected my loop performance, and the loop can no longer keep up with the acquisition speed.
    Do control references always cause such a slowdown? Is there anything that I can do besides moving the code back into the main vi?
    Thank You,
    David Creech

    I have had the same problem. I have discovered other funny things about references also; some kind of memory management (or mismamagement?) is taking place behind the scenes.
    Regardless, you can often do away with the references by passing the initial state of a control or indicator into the subvi, changing it inside, and passing the altered state back to the caller. Once back in the caller you update the front panel control or indicator by using a local variable.
    One thing to watch out for if using this scenario is the dreaded race condition; this can be avoided using a state machine. Check out
    http://www.advmeas.com/goodies/statemachine.html
    for a good example. It is a shame that references behave in this way; it limits thier usefulness.
    Perhaps someo
    ne else will point out a way to utilize them more sucessfully?

  • Performance tuning the loop statement

    Hi,
    I have the following requirement.
    I have an internal table IT_TEST1 which has values
    Column1
    A
    B
    C
    D
    consider a second internal table IT_TEST2. It'll have values like as follows:..I need to know which are the entries in column1 that have more than one entry in column 2 without looping through this internal table..Kindly suggest..
    Column1 column2
    A            VAL1
    B            VAL1
    B            VAL2
    C            VAL1
    C            VAL2
    D            VAL1
    D            VAL2
    D            VAL3
    This has caused very big performance issue for it is

    Hi,
    I have faced a similar problem and the following strategy has saved a lot of processing time
    the following code may serve your pupose
    if you are using IT_TEST2 for further processing please use IT_TEST3
    otherwise use IT_TEST2 instead of IT_TEST3 in the code below......'
    *************************CODE SAMPLE************************************
    data : IT_TEST3 like IT_TEST2.  "declare internal table same as IT_TEST2
      IT_TEST3[] = IT_TEST2[]. 
        "Pass contents if IT_TEST2 is used for further processing
    Sort IT_TEST1 by column1 .  "Sort
    Sort IT_TEST3 by column1 .  "Sort
       loop at IT_TEST1.
               read table IT_TEST3
                    with key column1 = IT_TEST1-column1.
                     if sy-subrc = 0.
                          describle table IT_TEST3 lines n.
                              if lines > 1.
                                 "Multiple entries
                               else.
                                 "Single entry
                              endif.
                     endif.
      "Perform all operations on IT_TEST3
        DELETE IT_TEST3 WHERE  column1 = IT_TEST1-column1.
    "Delete the entry in IT_TEST3 already processed with the key of IT_TEST1
    "Next time you do the read entries for the previous and all predecessor loops
    will not be there'
    "As you go down the loop performance increases
    endloop.
    Regards
    Byju

  • SE30, Performance, nested loop

    Hi,
    I looked at SE30 and found something verny usefull for my actual report.
    The nested reports and how to do it better.
    In the Documentation is written:
    The above parallel cursor algorithm assumes that ITAB2 contains only
    entries also contained in ITAB1.
    If this assumption does not hold, the parallel cursor algorithm
    gets slightly more complicated, but its performance characteristics
    remain the same.
    I would like to know the more complicated way, because I compare two tables which contain different entries.
    Would anybody be so nice and help me?

    Check:
    <a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops">Performance of Nested Loops</a>
    Rob

  • NESTED LOOP IN ABAP

    Hi experts
    Can we print BOM components in the following form .
          Level1 Component1    Level2 comp1  Level3 comp1 Level4 comp1
          Level1 Component1    Level2 comp1  Level3 comp2 Level4 comp1
          Level1 Component2    Level2 comp2  Level3 comp1
          Level1 Component3
          Level1 Component4
    and can anyone give me the logic for printing this form.
    Thanks in advance.
    Regards
    Rajaram

    Try something like:
    report zlocal_jc_bom_hierarchy
    line-size 132.
    data:
      begin of gs_hier,  "simulate a BOM hierarchy for demo
        level               like stpox-stufe, "level
        element             like stpox-idnrk, "BOM item
      end of gs_hier,
      gt_hier               like gs_hier occurs 0.
    start-of-selection.
      perform gt_hier_fill.  "pretend we read from BOM db
      perform hierarchy.   "print it
    *&      Form  hierarchy
    form hierarchy.
      data:
        l_prev_level        like gs_hier-level,
        ls_hier_set         like gs_hier,
        lt_hier_set         like ls_hier_set occurs 10,
        ls_hier             like gs_hier.
      format reset.
    *" print out hierarchy in rows
      loop at gt_hier into ls_hier.
        if ls_hier-level = 1. "new top element, start fresh
          if not lt_hier_set[] is initial. "not first loop
            perform print_set
              tables
                lt_hier_set.
          endif.
          clear: lt_hier_set, lt_hier_set[]." start afresh
          l_prev_level = 1.
        endif.
        if ls_hier-level < l_prev_level. "have stepped back up
          perform print_set
            tables
              lt_hier_set.
    *" remove existing rows at this level and below
          delete lt_hier_set where level ge ls_hier-level.
        endif.
        append ls_hier to lt_hier_set.
        l_prev_level = ls_hier-level."remember previous loop
      endloop.
    *" print last set
      if not lt_hier_set[] is initial. "not first loop
        perform print_set
          tables
            lt_hier_set.
      endif.
    endform.                    "hierarchy
    *&      Form  print_set
    form print_set
      tables
        it_hier_set         structure gs_hier.
    *" take a hierarchy subset and print it, or whatever...
      data:
        l_char130(130)      type c,
        ls_hier_set         like gs_hier,
        lt_hier_set         like ls_hier_set occurs 10.
      lt_hier_set[] = it_hier_set[].
      loop at lt_hier_set into ls_hier_set.
        concatenate l_char130 ls_hier_set-element
          into l_char130 separated by space.
      endloop.
      format reset.
      format color col_normal.
      write: /
        l_char130, at sy-linsz space.
      format reset.
    endform.                    "print_set
    *&      Form  gt_hier_fill
    form gt_hier_fill.
      data:
        ls_hier             like gs_hier.
      clear: gt_hier, gt_hier[].
    *" Simulate structure of for demo:
    *"   Level1 Component1 Level2 comp1 Level3 comp1 Level4 comp1
    *"   Level1 Component1 Level2 comp1 Level3 comp2 Level4 comp1
    *"   Level1 Component2 Level2 comp2 Level3 comp1
    *"   Level1 Component3
    *:   Level1 Component4
      ls_hier-level   = 1.
      ls_hier-element = 'Lvl 1 Comp 1'.
      append ls_hier to gt_hier.
      ls_hier-level   = 2.
      ls_hier-element = 'Lvl 2 Comp 1'.
      append ls_hier to gt_hier.
      ls_hier-level   = 3.
      ls_hier-element = 'Lvl 3 Comp 1'.
      append ls_hier to gt_hier.
      ls_hier-level   = 4.
      ls_hier-element = 'Lvl 4 Comp 1'.
      append ls_hier to gt_hier.
      ls_hier-level   = 3.
      ls_hier-element = 'Lvl 3 Comp 2'.
      append ls_hier to gt_hier.
      ls_hier-level   = 4.
      ls_hier-element = 'Lvl 4 Comp 2'.
      append ls_hier to gt_hier.
      ls_hier-level   = 1.
      ls_hier-element = 'Lvl 1 Comp 2'.
      append ls_hier to gt_hier.
      ls_hier-level   = 2.
      ls_hier-element = 'Lvl 2 Comp 2'.
      append ls_hier to gt_hier.
      ls_hier-level   = 3.
      ls_hier-element = 'Lvl 3 Comp 2'.
      append ls_hier to gt_hier.
      ls_hier-level   = 1.
      ls_hier-element = 'Lvl 1 Comp 3'.
      append ls_hier to gt_hier.
      ls_hier-level   = 1.
      ls_hier-element = 'Lvl 1 Comp 4'.
      append ls_hier to gt_hier.
    endform.                    "gt_hier_fill

  • REMOVE NESTED LOOP

    HI SAP GURUS
    I AM USING THE NESTED LOOP
      LOOP AT IBKPF into IBKPF_str.
        loop at IBSEG into IBSEG_Str.
          if IBSEG_Str-BUKRS = IBKPF_Str-BUKRS and IBSEG_Str-BELNR = IBKPF_Str-BELNR and IBSEG_Str-GJAHR = IBKPF_Str-GJAHR.
            Move-Corresponding ibkpf_Str to idata_Str.
            Move-corresponding ibseg_Str to idata_Str.
            Append idata_Str to IDATA.
            clear : IDATA_Str , IBSEG_Str.
          ENDIF.
          Clear : IBSEG_Str.
        ENDLOOP.
        Clear :IBKPF_Str , IBSEG_Str.
      ENDLOOP.
    NOW TO INCREACE THE PERFORMANCE
    I AM USING
    Loop at IBSEG into IBSEg_str.
    *Read table IBKPF with key BELNR = IBSEG_str-BELNR into IBKPF_str Binary Search.
        If sy-subrc = 0 and IBSEG_Str-BUKRS = IBKPF_Str-BUKRS and IBSEG_Str-GJAHR = IBKPF_Str-GJAHR.
           Move-Corresponding ibkpf_Str to idata_Str.
           Move-corresponding ibseg_Str to idata_Str.
           Append idata_Str to IDATA.
           clear : IDATA_Str , IBKPF_Str.
        Endif.
       clear : IBSEG_Str , IBKPF_Str.
    *ENDLOOP.
    BUT NOW IT IS NOT PICKING ALL THE RECORDS ( MULTIPLE COMANY CODES)
    CAN ANY ONE HELP

    Check this:
    <a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops">Performance of Nested Loops</a>
    Rob

  • Need to Improve Performance on a Spatial Boundary Crossing Calculator

    I am attempting to compare a series of geometries to calculate a number of statistics where they overlap. Essentially I have a table of 50,000 lines and another table of 1000 circles. I need to determine which lines overlap each circle, and for each intersection, I need to determine how much time and distance each line spends in each circle.
    I have a PL/SQL program that performs this operation now and it works. The problem is that it takes far too long.
    Here is a summary of how the job runs:
    1) For each LINE, determine which CIRCLES it overlaps with
    2) Each each LINE/CIRCLE pair, determine the intersection points
    3) Insert the intersection points in a temporary table
    4) Once you have all the points, pair them up as Entry/Exit points for each circle
    5) Calculate duration (time) and distance between entry and exit points
    6) Return to step 1 for next LINE
    There are multiple loops here:
    1-6 is the outer loop performed once for each of the 50,000 lines.
    2-3 is performed once for each line/circle pair (probable avg of 5 circles per line)
    4-5 is performed once again for each line/circle pair
    Even if the process only takes a couple of seconds per LINE, we are still taking more than 24 hours to process, which is not acceptable.
    This original process was written with 9i, and I am now running 10gR2, so I know there are new features that should help. For starters, I think I can use SDO_JOIN in place of the original outer loop to generate a complete list of geometry interactions in one query. Of course, I am still concerned about how long that might take.
    Even more troubling is, if that works, I still don't see how to improve the rest of the calculations. Any suggestions would be appreciated.

    No, I don't mind providing it.
    Here it is:
    -- cre_&stab._bndxing.sql
    --Procedure definition of bndxings
    def stab=&1
    CREATE OR REPLACE PROCEDURE Find_&stab._bndxings
    (theDate IN DATE, theStr IN VARCHAR2) IS
    --Select flights from table
    CURSOR FCursor IS
    SELECT new_Flight_Index,
    Acid,
    New_Act_Date,
    Dept_Aprt,
    Dep_Time,
    Arr_Aprt,
    Arr_Time,
    Acft_Type,
    Physical_Class,
    User_Class,
    Nrp,
         d_lat,
    d_lon,
    a_lat,
    a_lon,
         flight_track
    FROM jady.Flight
    WHERE new_act_date = theDate
    AND flight_track IS NOT NULL
    AND substr(acid,1,1) = theStr
    --AND acid in (select acid from name_temp)
    --AND acid = 'AAL1242'
    ORDER BY acid,new_flight_index;
    --Temp vars for storing flight info
    fi_var NUMBER;
    acid_var VARCHAR2(7);
    dep_time_var DATE;
    arr_time_var DATE;
    F_Rec FCursor%ROWTYPE;
    --Temp vars for flight
    tcnt INTEGER;
    cur_lat NUMBER;
    cur_lon NUMBER;
    last_lat NUMBER;
    last_lon NUMBER;
    --Temp vars for airspace and xing geometries
    aname VARCHAR2(20);
    bxings MDSYS.SDO_GEOMETRY;
    bxcnt INTEGER;
    --Select xings made from temp bndxing table
    CURSOR XCursor IS
    SELECT Act_Date,
    Name,
    Lon,
    Lat,
    Alt,
    Time,
    OPS
    FROM bndxing_tmp
    WHERE Flight_Index = fi_var
    AND Acid = acid_var
    ORDER BY Name,Time;
    --Temp vars for paired in/out xings
    ad date;
    ilon NUMBER;
    ilat NUMBER;
    ialt NUMBER;
    isec NUMBER;
    iops NUMBER;
    olon NUMBER;
    olat NUMBER;
    oalt NUMBER;
    osec NUMBER;
    oops NUMBER;
    gcr NUMBER;
    dist NUMBER;
    dura NUMBER;
    ops VARCHAR2(1);
    i INTEGER;
    i_aname VARCHAR2(20);
    o_aname VARCHAR2(20);
    names_match BOOLEAN;
    theSeq NUMBER;
    same_airport_no_tzdata BOOLEAN;
    -- Cursor and variables for bndxing sequencing
    CURSOR BCursor IS
    SELECT * FROM bndxing
    WHERE act_date = theDate
         AND Acid = acid_var
         AND Flight_Index = fi_var
    ORDER BY in_time
    FOR UPDATE;
    BRec BCursor%ROWTYPE;
    --Error logging variable
    strErrorMessage VARCHAR2(255);
    BEGIN --Start of Main Loop
    --Loop for each flight in table
    OPEN FCursor;
    FETCH FCursor INTO F_Rec;
    -- FOR f IN FCursor LOOP
    WHILE FCursor%FOUND LOOP
    fi_var:= F_Rec.new_Flight_Index;
    acid_var := F_Rec.acid;
    arr_time_var := F_Rec.arr_time;
    dep_time_var := F_Rec.dep_time;
    last_lat := -10000; --initializtion
    last_lon := -10000; --initializtion
    -- DEBUG STATEMENT
    /* Insert into bnd_error values (err_seq.NEXTVAL,
    sysdate,
    F_Rec.Acid,
    F_Rec.new_Flight_Index,
    'Checkpoint 1');
    --Add departing xing to temp table if in US airspace
    DECLARE
    CURSOR DepCur IS
    SELECT Name
    FROM &stab.
    WHERE SDO_RELATE(Airspace,
         MDSYS.SDO_GEOMETRY(2001,8307,
    MDSYS.SDO_POINT_TYPE(F_Rec.d_lon,F_Rec.d_lat,null),
         null, null),
    'mask=CONTAINS querytype=WINDOW') = 'TRUE';
    BEGIN -- Start of Departing Airspace Loop
    FOR c in DepCur LOOP
    INSERT INTO Bndxing_Tmp VALUES (F_Rec.new_Flight_Index,
    F_Rec.acid,
    F_Rec.New_Act_Date,
    c.name,
    2,
    F_Rec.d_lon,
    F_Rec.d_lat,
    0,
    (F_Rec.Dep_Time-F_Rec.New_Act_Date)*86400);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN NULL;
    WHEN OTHERS THEN
    strErrorMessage := SQLERRM;
    INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
    sysdate,
                             F_Rec.Acid,
                             F_Rec.new_Flight_Index,
                             'Exception from Departing Airspace loop: ' || strErrorMessage);
    COMMIT;
    END; -- End of Departing Airspace Loop
    --Add arrival xing to temp table if in US airspace
    DECLARE
    CURSOR ArrCur IS
    SELECT name
    FROM &stab.
    WHERE SDO_RELATE(Airspace,
         MDSYS.SDO_GEOMETRY(2001,8307,
    MDSYS.SDO_POINT_TYPE(F_Rec.a_lon, F_Rec.a_lat, null),
    null, null),
    'mask=CONTAINS querytype=WINDOW') = 'TRUE';
    BEGIN -- Start of Arrival Airspace Loop
    FOR c IN ArrCur LOOP
    INSERT INTO Bndxing_Tmp VALUES (F_Rec.new_Flight_Index,
    F_Rec.acid,
    F_Rec.New_Act_Date,
    c.name,
    1,
    F_Rec.a_lon,
    F_Rec.a_lat,
    0,
    (F_Rec.Arr_Time - F_Rec.New_Act_Date)*86400);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN NULL;
    WHEN OTHERS THEN
    strErrorMessage := SQLERRM;
    INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
    sysdate,
                             F_Rec.Acid,
                             F_Rec.new_Flight_Index,
                             'Exception from Arrival Airspace loop: ' || strErrorMessage);
    COMMIT;
    END; -- End of Arrival Airspace Loop
    --DEBUG STATEMENT
    /* Insert into bnd_error values (err_seq.NEXTVAL,
    sysdate,
    F_Rec.Acid,
    F_Rec.new_Flight_Index,
    'Checkpoint 4');
    --Find all intersections between the flight track and airspace boundaries and insert into temp table
    DECLARE
    --Find airspace boundaries that interact with the flight track
    CURSOR CCursor IS
    SELECT Name, Boundary
    FROM &stab.
    WHERE SDO_RELATE(boundary,F_Rec.flight_track,'mask=OVERLAPBDYDISJOINT querytype=WINDOW')='TRUE';
    BEGIN
    FOR c IN CCursor LOOP
    bxings := SDO_GEOM.SDO_INTERSECTION(c.boundary,F_Rec.flight_track,10);
    bxcnt:=bxings.sdo_ordinates.count;
    LOOP
    INSERT INTO bndxing_tmp VALUES (F_Rec.new_Flight_Index,
    F_Rec.acid,
    F_Rec.New_Act_Date,
    c.name,
    0,
    bxings.sdo_ordinates(bxcnt-3),
    bxings.sdo_ordinates(bxcnt-2),
    bxings.sdo_ordinates(bxcnt-1),
    SDO_LRS.FIND_MEASURE(F_Rec.flight_track,
    MDSYS.SDO_GEOMETRY(2001,8307,NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1),
    MDSYS.SDO_ORDINATE_ARRAY(bxings.sdo_ordinates(bxcnt-3),
    bxings.sdo_ordinates(bxcnt-2)))));
    bxcnt := bxcnt - 4;
    EXIT WHEN (bxcnt < 1);
    END LOOP;
    END LOOP; -- end CCursor LOOP
    EXCEPTION
    WHEN OTHERS THEN
    strErrorMessage := SQLERRM;
    INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
    sysdate,
                             F_Rec.Acid,
                             F_Rec.new_Flight_Index,
                             'Exception from bndxing loop: ' || strErrorMessage);
    COMMIT;
    END;
    --DEBUG STATEMENT
    /* Insert into bnd_error values (err_seq.NEXTVAL,
    sysdate,
    F_Rec.Acid,
    F_Rec.new_Flight_Index,
    'Checkpoint 6');
    --After all xings for a flight have been collected sort Xings by name and time and grab pairwise
    theSeq :=0;
    OPEN XCursor;
    BEGIN -- Start of Stats Loop
    LOOP
         FETCH XCursor INTO ad, i_aname, ilon, ilat, ialt, isec, iops; --CHANGED CODE
    EXIT WHEN XCursor%NOTFOUND ;
    FETCH XCursor INTO ad, o_aname, olon, olat, oalt, osec, oops; --CHANGED CODE
    EXIT WHEN XCursor%NOTFOUND ;
    names_match := (i_aname = o_aname); --NEW CODE
    WHILE not names_match LOOP --NEW CODE
    i_aname := o_aname; --NEW CODE
         ilon := olon; --NEW CODE
         ilat := olat; --NEW CODE
         ialt := oalt; --NEW CODE
         isec := osec; --NEW CODE
         iops := oops; --NEW CODE
    FETCH XCursor INTO ad, o_aname, olon, olat, oalt, osec, oops; --NEW CODE
    EXIT WHEN XCursor%NOTFOUND; --NEW CODE
    names_match := (i_aname = o_aname); --NEW CODE
    END LOOP; --NEW CODE
         --Calculate stats
         BEGIN -- Start of In Values Loop
         i:=4;
         IF (iops<>2) THEN
         -- Did not depart from this airspace, calculate entry altitude into airspace.
         LOOP
         i:=i+4;
         EXIT WHEN F_Rec.flight_track.sdo_ordinates(i)>isec;
         END LOOP;
    IF ( F_Rec.flight_track.sdo_ordinates(i-1) = F_Rec.flight_track.sdo_ordinates(i-5) ) THEN
    ialt := F_Rec.flight_track.sdo_ordinates(i-1);
    ELSE
    ialt:=SDO_LRS.FIND_MEASURE(
         MDSYS.SDO_GEOMETRY(3302,8307,NULL,
         MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),
    MDSYS.SDO_ORDINATE_ARRAY(F_Rec.flight_track.sdo_ordinates(i-7),
    F_Rec.flight_track.sdo_ordinates(i-6),
    F_Rec.flight_tracK.sdo_ordinates(i-5),
    F_Rec.flight_track.sdo_ordinates(i-3),
    F_Rec.flight_track.sdo_ordinates(i-2),
    F_Rec.flight_track.sdo_ordinates(i-1))),
         MDSYS.SDO_GEOMETRY(2001,8307,NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1),
    MDSYS.SDO_ORDINATE_ARRAY(ilon,ilat)));
    END IF;
         END IF;
         EXCEPTION
         WHEN OTHERS THEN
         strErrorMessage := SQLERRM;
         INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
         sysdate,
                                  F_Rec.Acid,
                                  F_Rec.new_Flight_Index,
                                  'Exception from In Values section: ' || strErrorMessage);
         COMMIT;
         END; -- End of In Values Loop
    BEGIN -- Start of Out Values Loop
         i:=4;
         IF (oops<>1) THEN
    -- Did not arrive in this airspace, calculate departure altitude from airspace.
    LOOP
    i:=i+4;
    EXIT WHEN F_Rec.flight_track.sdo_ordinates(i)>osec;
    END LOOP;
         --Find alt at this time
    IF ( F_Rec.flight_track.sdo_ordinates(i-1) = F_Rec.flight_track.sdo_ordinates(i-5) ) THEN
    oalt := F_Rec.flight_track.sdo_ordinates(i-1);
    ELSE
         oalt:=SDO_LRS.FIND_MEASURE(
         MDSYS.SDO_GEOMETRY(3302, 8307, NULL,
         MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),
    MDSYS.SDO_ORDINATE_ARRAY(F_Rec.flight_track.sdo_ordinates(i-7),
    F_Rec.flight_track.sdo_ordinates(i-6),
    F_Rec.flight_track.sdo_ordinates(i-5),
    F_Rec.flight_track.sdo_ordinates(i-3),
    F_Rec.flight_track.sdo_ordinates(i-2),
    F_Rec.flight_track.sdo_ordinates(i-1))),
         MDSYS.SDO_GEOMETRY(2001,8307,NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1),
    MDSYS.SDO_ORDINATE_ARRAY(olon,olat)));
    END IF;
    END IF;
         EXCEPTION
    WHEN OTHERS THEN
    strErrorMessage := SQLERRM;
    INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
         sysdate,
                                  F_Rec.Acid,
                                  F_Rec.new_Flight_Index,
                                  'Exception from Out Values loop: ' || strErrorMessage);
    COMMIT;
    END; -- End of Out Values Loop
    BEGIN -- Start of Finish Loop
    --Find GCR, actual distance and duration in airspace
    gcr := SDO_GEOM.SDO_DISTANCE(MDSYS.SDO_GEOMETRY(2001,8307,
    MDSYS.SDO_POINT_TYPE(ilon,ilat,NULL),NULL,NULL),
    MDSYS.SDO_GEOMETRY(2001,8307,
    MDSYS.SDO_POINT_TYPE(olon,olat,NULL),NULL,NULL),
    10,'unit=naut_mile');
    --DEBUG STATEMENT
    /* Insert into bnd_error values (err_seq.NEXTVAL,
    sysdate,
    F_Rec.Acid,
    F_Rec.new_Flight_Index,
    'In Finish Loop: isec: ' ||isec||' osec: '||osec
                        ||' airspace: '||i_aname);
    dist := SDO_GEOM.SDO_LENGTH(SDO_LRS.CLIP_GEOM_SEGMENT(F_Rec.flight_track,isec,osec),10,'unit=naut_mile');
         dura := (osec - isec);
    --Set OPS Flag
    iops := iops + oops;
    IF (iops=3) THEN
    ops := 'B';
    ELSIF (iops=2) THEN
    ops := 'D';
    ELSIF (iops=1) THEN
    ops := 'A';
    ELSE
    ops := 'O';
    END IF;
         theSeq := theSeq + 1;
    --Insert into Bndxing table
    INSERT INTO Bndxing VALUES (F_Rec.Acid,
    F_Rec.new_Flight_Index,
    F_Rec.New_Act_Date,
         theSeq,
         F_Rec.Dept_Aprt,
         F_Rec.Arr_Aprt,
    i_aname,
    round(ilon,3),
    round(ilat,3),
    ialt,
    isec/86400 + ad,
    NULL, -- IN_SPEED (TBD)
    round(olon,3),
    round(olat,3),
    oalt,
    osec/86400 + ad,
    NULL, -- OUT_SPEED (TBD)
    gcr,
    dist,
    dura,
    ops, -- CHANGED CODE
    nvl(F_Rec.Acft_Type,'----'),
    NULL, -- IF_FLAG (NULL)
    nvl(F_Rec.Physical_Class,'-'),
    nvl(F_Rec.User_Class,'-'),
    F_Rec.Nrp,
    NULL, -- FFS_FLAG (NULL)
    NULL, -- ER_SG (NULL)
    NULL, -- ER_TI (NULL)
    NULL, -- ER_ZT (NULL)
    NULL, -- ER_DU (NULL)
    NULL, -- ER_SP (NULL)
    NULL -- ER_BD (NULL)
    DELETE FROM bndxing_tmp
         WHERE acid=F_Rec.Acid and flight_index=F_Rec.new_Flight_Index;
         COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    strErrorMessage := SQLERRM;
    INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
         sysdate,
         F_Rec.Acid,
         F_Rec.new_Flight_Index,
         'Exception from Finish loop: ' || strErrorMessage);
    COMMIT;
    END; -- End of Finish Loop
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    strErrorMessage := SQLERRM;
    INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
    sysdate,
    F_Rec.Acid,
    F_Rec.new_Flight_Index,
    'Exception from Stats loop: ' || strErrorMessage);
    COMMIT;
    END; -- End of Stats Loop
    --Reset cursor and track geometry
    CLOSE XCursor;
    F_Rec.flight_track.sdo_ordinates.delete;
    -- delete from hist_bndxing_tmp
    -- where acid=acid_var and new_flight_index=fi_var;
    FETCH FCursor INTO F_Rec;
    END LOOP;
    --DEBUG STATEMENT
    /* INSERT INTO bnd_error VALUES (err_seq.NEXTVAL,
    sysdate,
    acid_var,
    fi_var,
    'Checkpoint 7');
    CLOSE FCursor;
    theSeq := 1;
    OPEN BCursor;
    LOOP
    FETCH BCursor INTO BRec;
    IF BCursor%NOTFOUND THEN
    EXIT;
    END IF;
    UPDATE bndxing
    SET segment = theSeq
    WHERE CURRENT OF BCursor;
    theSeq := theSeq + 1;
    END LOOP;
    CLOSE BCursor;
    EXCEPTION
    WHEN OTHERS THEN
    strErrorMessage := SQLERRM;
    Insert into bnd_error values (err_seq.NEXTVAL,
    sysdate,
                             acid_var,
                             fi_var,
                             'Exception from main: ' || strErrorMessage);
    COMMIT;
    CLOSE FCursor;
    END; -- End of Main Loop
    SHOW ERRORS;
    --exit;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

  • While/time loop from pc clock

    Hi Guys
    I have some code that (currently) uses a while loop to periodically open a file and read from it (in its simplest form....and...the details are not germaine to this post)
    The requirements have now tightened and the loop (While or Timed??) must read the file once every two minutes based on the computer clock (accuracy is not too important, certainly not milliseconds)
    e.g. time is 11:35.... read file
          time is 11:36.. ..do nothing
          time is 11:37.....read file
          time is 11:38.....do nothing
         etc.   etc.
    In simpler terms (if thats possible)....have the loop perform the code inside it every two minutes with the time sequence coming from the pc clock.
    I've looked at timed loops (but never used them) and they seem a possibility
    So, could somebody show me an example of the best way to do this.
    Thanks for your assistance and best regards
    Ray
    Solved!
    Go to Solution.

    Hello Ravens Fan
    I have had an attempt (unsuccessfully) at your suggestion, but not much luck I'm afraid.
    I'm kicking myself because I should know how to do this.
    I have attached my attempt. Would you please take a look at it and see where I'm missing the next ingredient.
    Kind regards
    Ray
    Attachments:
    timed while loop.vi ‏8 KB

  • Actual time recording (computer performance problem?)

    I'm a beginner.
    I'm recording the output file in every second, but the time of output file is different from the actual time.
    I'm wondering if this is due to the computer performance (450MHz, 128MB) or if vi program can be implemented. I attached the file I use. The problem comes up when I use a vi with 50 channel outputs, but doesn't come up if I reduce the channels to around 20.
    Thank you.
    Attachments:
    LODS_MFC2.vi ‏460 KB

    It sounds like you are certainly running into timing issues. I see that in your VI, you use AI Sample Channel to acquire data from a single channel everytime the loop iterates. This is not the best means to go about doing such. The reason being that each time the VI is called, it has to setup the operation, then perform the read, and then clear the operation. What you should be doing is setting up the operationg outside the loop, perform only reads in the while loop, and then clear the task after you are complete. LabVIEW gets shipped with several examples that behave just this way, you should look in the example finder for these.
    Additionallly, if you read the help on AI Sample Channel.vi, it states it does a single, untimed measurement of a channel. Since
    you posted with the title "actual time recording", I feel that timing might be of importance to you.
    You never did mention what version of LabVIEW you have, or the hardware and drivers you are using, so I am leaving this post rather general. If you have some more questions after reading through this post and looking through some of the examples, post back to this discussion with more information, and I will try and help you out further.
    Sincerely,
    Jared A.

  • Optimizing for performance

    A few days ago, we did a live web presentation and Q&A session about optimizing for performance for Adobe Premiere Pro and After Effects. Here is a blog post that gives a link to the recording and links to supporting materials:
    "optimizing for performance: Adobe Premiere Pro and After Effects"
    Thanks to Harm (and others) for some great forum threads that I could refer people to for good advice.

    hi ,
    1.) try to avoid ' into correspondig field of ' option in select query
    use ' into table tanle_name'.
    2.) fro all the select queries containing addition
    ' FOR ALL ENTRIES IN TABLE_NAME'  check the condition
    IF TABLE_NAME[] IS NOT INITIAL.
    ENDIF
    before the select query.
    3.)  before the read statement sort the table by any key field and
    use the addition BINARY SEARCH with READ statement.
    4.) For modifying the internal table always use index.
    5.) <b>never use select statement inside loop.</b>
    for ur case u can use internal table for selecting 'NAME1' from 'KNA1'.
    Inside the loop perform the read operation for this internal table.
    in the same way avoid the other select statement which u have used in the loop.

  • SRW2024 Stuck in Loop after Firmware upgrade.

    When connected to the serial port the following continues to loop:
    ------ Performing the Power-On Self Test (POST) ------                                           
    UART Channel Loopback Test........................PASS
    Testing the System SDRAM..........................PASS 
    Boot1 Checksum Test...............................PASS
    Boot2 Checksum Test...............................PASS
    Flash Image Validation Test.......................PASS
    BOOT Software Version 1.0.0.03 Built  08-Jun-2004  09:48:10
     CPU - FireFox 88E6218 ARM946E-S processor                  
     64 MByte SDRAM. I-Cache 8 KB. D-Cache 8 KB. Cache Enabled.
    Autoboot in 2 seconds - press RETURN or Esc. to abort and enter prom.
    Preparing to decompress...
    Decompressing SW from flash
    HOSTG_rscode_file_load: could not load file
     Perform WARM BOOT ...
    When I attempt to do download the new software with XModem the firmware (fw) completes successfully (ls20xx_Salsa-12222.ros) but the boot image fw fails (runtop_boot-101.rfb) and I receive this message:
        Startup Menu
    [1]  Download Software
    [2]  Erase Flash File
    [3]  Password Recovery Procedure
    [4]  Set Terminal Baud-Rate
    [5]  Back
     Enter your choice or press 'ESC' to exit:
    Downloading code using XMODEM.
     -- Download complete --
    Wrong file format. Writing aborted.
    Is there a different version of the firmware perhaps an older version available for download somewhere? Or is there something I am doing wrong?
    Any help would be greatly appreciated.
    We have 2 - srw2024's and 2- srw2016's. Issue only on the one with the fw upgrade.
    Thanks.

    Here is what I've found to be useful and so far seems like a fix for myself.
    I downloaded an older firmware version 1.0086 from here
    http://ip.gliebetronics.com:800/firmware/Linksys%20SRW2024/Firmware/
    runtop-10086.ros
    The other 2 versions may help some other people on this forum.
    Uploaded it through the serial port with Xmodem.
    So far I've been able to boot and now access through web interface. I will post later on how it is doing later in the day.

  • Internal table in bdc

    I am new to the bdc .
    i have gone to SHDB and created a new recording  for the some T-code .
    After that i have created a prog (transfer from recording ) .
    i got some values in the file in my presenation server.
    i got default code generated .
    I have to declare the internal table of some time .
    may i know of which type should i declare my internal table ??
    My code ****************************************************************
    report ZRAJESH_BDC
           no standard page heading line-size 255.
    include bdcrecx1.
    start-of-selection.
    perform open_group.
    *******loop
    perform bdc_dynpro      using 'SAPMF02K' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-D0110'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  '12345'.
    perform bdc_field       using 'RF02K-D0110'
                                  'X'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-TELF2'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPDA'.
    perform bdc_field       using 'LFA1-ANRED'
                                  'Mr.'.
    perform bdc_field       using 'LFA1-NAME1'
                                  'RAJESH'.
    perform bdc_field       using 'LFA1-SORTL'
                                  'Q'.
    perform bdc_field       using 'LFA1-LAND1'
                                  'US'.
    perform bdc_field       using 'LFA1-SPRAS'
                                  'EN'.
    perform bdc_field       using 'LFA1-TELF2'
                                  '9033558227'.
    perform bdc_transaction using 'XK02'.
    perform close_group.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.

    Hi,
    I have one simple  BDC Program  .
    Just you have to do recording by using SHDB Transaction Code.
    and Copy that program and do some modification by following my Program and upload data to that perticular transaction.
    before that u have to prepare data in Text file by using TAB Space .
    Below is the Code(I have used MM01 transaction)
    ******************************************************************************************8
    report ZBDCTEST no standard page heading line-size 255.
    ***DECLARING TABLES.
    TABLES : MARA.
    **DECLARING INTERNAL TABLE.
    DATA : BEGIN OF ITAB OCCURS 0,
           MATNR LIKE MARA-MATNR,
           MEINS LIKE MARA-MEINS,
           MATKL LIKE MARA-MATKL,
           Maktx like makt-maktx,
           SPART LIKE MARA-SPART,
           END OF ITAB.
    DATA BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       CODEPAGE                      = 'IBM'
       FILENAME                      = 'C:\TEST.TXT'
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = ITAB
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      FILE_OPEN_ERROR               = 2
      FILE_READ_ERROR               = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      OTHERS                        = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *include bdcrecx1.
    *start-of-selection.
    *perform open_group.
    LOOP AT ITAB.
      REFRESH BDCDATA.
      perform bdc_dynpro      using 'SAPLMGMM' '0060'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RMMG1_REF-MATNR'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=AUSW'.
      perform bdc_field       using 'RMMG1-MATNR'
                                    ITAB-MATNR.
      perform bdc_field       using 'RMMG1-MBRSH'
                                    'M'.
      perform bdc_field       using 'RMMG1-MTART'
                                    'FOOD'.
      perform bdc_dynpro      using 'SAPLMGMM' '0070'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MSICHTAUSW-DYTXT(02)'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=ENTR'.
      perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                    'X'.
      perform bdc_field       using 'MSICHTAUSW-KZSEL(02)'
                                    'X'.
      perform bdc_dynpro      using 'SAPLMGMM' '4000'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=SP02'.
      perform bdc_field       using 'MAKT-MAKTX'
                                    'T1003'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MARA-MATKL'.
      perform bdc_field       using 'MARA-MEINS'
                                    'BOX'.
      perform bdc_field       using 'MARA-MATKL'
                                     ITAB-MATKL.
      perform bdc_field       using 'MARA-SPART'
                                    ITAB-SPART.
      perform bdc_field       using 'MARA-MTPOS_MARA'
                                    'NORM'.
      perform bdc_dynpro      using 'SAPLMGMM' '4004'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BU'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MAKT-MAKTX'.
      perform bdc_field       using 'MAKT-MAKTX'
                                    'T1003'.
    *perform bdc_transaction using 'MM01'.
    *perform close_group.
      CALL TRANSACTION 'MM01' USING BDCDATA MODE 'A'. "A= all screens ,N= no screens
    ENDLOOP.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> SPACE.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.
    if you want further help let me know
    Regards,
    Jak

  • Timing for Data Acquisition Using Notifiers

    I'm trying to use notifiers to transfer data from an acquisition (master) loop to the slave loop. I want data to be transferred for analysis only when the VI is in a certain state - not in all states. That's why I'm preferring to use notifiers instead of queues (I want all data collected during the other states to be disregarded). I have attached a simplified version of what I'm trying.
    The master loop generates a data point every second. The slave loop is in a "delay" state for 5 seconds and then in "acquire" state for 3 seconds. Given this architecture I would expect no data for 5 seconds and then 3 data points to be plotted during "acquire" state because only one data point is generated per second. But for some reason I get 5 or 6 data points during every acquire cycle. I haven't figured out why I get 5-6 data points instead of 3. It probably has to do with the timing functions I'm using.  
    Thanks!
    -Arnie 
    Attachments:
    Notifier Data Transfer Template.vi ‏62 KB

    Here is an example of a race condition without the use of local or global variables.  What is happening is that the notifier is already queued up with a value even before the Elapsed Timer has even started.  So one extra value will be in the output array.  Also, depending on how the parallel loops perform (which goes first), there may be an extra value queued up before the Time Elapsed event could fire.  Typically, when I ran it, I got an array size of 6 at first, and then it went down to 5.  Clearly the architecture is not right for what you want to do.  Instead of depending on timers and parallel loop timing, you could receive all the values queued and just discard the ones you don't want.
    - tbob
    Inventor of the WORM Global

  • "Storage is not configured" during failover - COH-1467 still not fixed?

    I am runing a test program using two cache nodes and one "client JVM", all on the same machine (the first cache node is used as WKA). When I kill one of the cache nodes and the restart it again I get the following exceptions:
    In the surviving cache node:
    2009-01-22 08:01:14.753/112.718 Oracle Coherence GE 3.4.1/407 <Error> (thread=DistributedCache, member=1): An exception (java.lang.ClassCastException) occurred reading Message AggregateFilterRequest Type=31 for Service=DistributedCache{Name=DistributedCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    2009-01-22 08:01:14.753/112.718 Oracle Coherence GE 3.4.1/407 <Error> (thread=DistributedCache, member=1): Terminating DistributedCache due to unhandled exception: java.lang.ClassCastException
    2009-01-22 08:01:14.753/112.718 Oracle Coherence GE 3.4.1/407 <Error> (thread=DistributedCache, member=1):
    java.lang.ClassCastException: java.lang.Long
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$AggregateFilterRequest.read(DistributedCache.CDB:8)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:117)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
         at java.lang.Thread.run(Thread.java:619)
    On the restarted cache node:
    2009-01-22 08:01:15.722/2.220 Oracle Coherence GE 3.4.1/407 <Info> (thread=Main Thread, member=n/a): Loaded cache configuration from resource "file:/C:/Javaproj/Query/lib/master-coherence-cache-config.xml"
    2009-01-22 08:01:16.565/3.063 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=n/a): Service Cluster joined the cluster with senior service member n/a
    2009-01-22 08:01:16.628/3.126 Oracle Coherence GE 3.4.1/407 <Info> (thread=Cluster, member=n/a): Failed to satisfy the variance: allowed=16, actual=31
    2009-01-22 08:01:16.628/3.126 Oracle Coherence GE 3.4.1/407 <Info> (thread=Cluster, member=n/a): Increasing allowable variance to 17
    2009-01-22 08:01:17.003/3.501 Oracle Coherence GE 3.4.1/407 <Info> (thread=Cluster, member=n/a): This Member(Id=5, Timestamp=2009-01-22 08:01:16.768, Address=138.106.109.121:54101, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22728, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=1) joined cluster with senior Member(Id=1, Timestamp=2009-01-22 07:59:24.098, Address=138.106.109.121:54100, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22948, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=1)
    2009-01-22 08:01:17.065/3.563 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=n/a): Member(Id=4, Timestamp=2009-01-22 08:00:35.566, Address=138.106.109.121:8088, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:11544) joined Cluster with senior member 1
    2009-01-22 08:01:17.081/3.579 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
    2009-01-22 08:01:17.081/3.579 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=n/a): Member 1 joined Service InvocationService with senior member 1
    2009-01-22 08:01:17.081/3.579 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=n/a): Member 1 joined Service DistributedCacheNoBackup with senior member 1
    2009-01-22 08:01:17.097/3.595 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=n/a): Member 4 joined Service InvocationService with senior member 1
    2009-01-22 08:01:17.097/3.595 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=n/a): Member 4 joined Service DistributedCache with senior member 4
    2009-01-22 08:01:17.222/3.720 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): TcpRing: connecting to member 4 using TcpSocket{State=STATE_OPEN, Socket=Socket[addr=/138.106.109.121,port=8088,localport=3609]}
    2009-01-22 08:01:17.253/3.751 Oracle Coherence GE 3.4.1/407 <D5> (thread=Invocation:Management, member=5): Service Management joined the cluster with senior service member 1
    2009-01-22 08:01:17.393/3.891 Oracle Coherence GE 3.4.1/407 <D5> (thread=Invocation:InvocationService, member=5): Service InvocationService joined the cluster with senior service member 1
    2009-01-22 08:01:18.643/5.141 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 joined Service DistributedCache with senior member 4
    2009-01-22 08:01:19.050/5.548 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 left service DistributedCache with senior member 4
    2009-01-22 08:01:23.659/10.157 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 joined Service DistributedCache with senior member 4
    2009-01-22 08:01:24.284/10.782 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 left service DistributedCache with senior member 4
    2009-01-22 08:01:28.674/15.172 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 joined Service DistributedCache with senior member 4
    2009-01-22 08:01:29.503/16.001 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 left service DistributedCache with senior member 4
    2009-01-22 08:01:33.674/20.172 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 joined Service DistributedCache with senior member 4
    2009-01-22 08:01:33.721/20.219 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 left service DistributedCache with senior member 4
    2009-01-22 08:01:38.674/25.172 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 joined Service DistributedCache with senior member 4
    2009-01-22 08:01:38.956/25.454 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 left service DistributedCache with senior member 4
    2009-01-22 08:01:43.690/30.188 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 joined Service DistributedCache with senior member 4
    2009-01-22 08:01:44.174/30.672 Oracle Coherence GE 3.4.1/407 <D5> (thread=Cluster, member=5): Member 1 left service DistributedCache with senior member 4
    2009-01-22 08:01:47.659/34.157 Oracle Coherence GE 3.4.1/407 <Error> (thread=Main Thread, member=5): Error while starting service "InvocationService": com.tangosol.net.RequestTimeoutException: Timeout during service start: ServiceInfo(Id=2, Name=InvocationService, Type=Invocation
    MemberSet=ServiceMemberSet(
    OldestMember=Member(Id=1, Timestamp=2009-01-22 07:59:24.098, Address=138.106.109.121:54100, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22948)
    ActualMemberSet=MemberSet(Size=3, BitSetCount=2
    Member(Id=1, Timestamp=2009-01-22 07:59:24.098, Address=138.106.109.121:54100, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22948)
    Member(Id=4, Timestamp=2009-01-22 08:00:35.566, Address=138.106.109.121:8088, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:11544)
    Member(Id=5, Timestamp=2009-01-22 08:01:16.768, Address=138.106.109.121:54101, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22728)
    MemberId/ServiceVersion/ServiceJoined/ServiceLeaving
    1/3.1/Thu Jan 22 07:59:27 CET 2009/false,
    4/3.1/Thu Jan 22 08:00:36 CET 2009/false,
    5/3.1/Thu Jan 22 08:01:17 CET 2009/false
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onStartupTimeout(Grid.CDB:6)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:27)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:38)
         at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:28)
         at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
         at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
         at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:841)
         at com.tangosol.net.DefaultCacheServer.start(DefaultCacheServer.java:140)
         at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:61)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
    Exception in thread "Main Thread" com.tangosol.net.RequestTimeoutException: Timeout during service start: ServiceInfo(Id=2, Name=InvocationService, Type=Invocation
    MemberSet=ServiceMemberSet(
    OldestMember=Member(Id=1, Timestamp=2009-01-22 07:59:24.098, Address=138.106.109.121:54100, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22948)
    ActualMemberSet=MemberSet(Size=3, BitSetCount=2
    Member(Id=1, Timestamp=2009-01-22 07:59:24.098, Address=138.106.109.121:54100, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22948)
    Member(Id=4, Timestamp=2009-01-22 08:00:35.566, Address=138.106.109.121:8088, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:11544)
    Member(Id=5, Timestamp=2009-01-22 08:01:16.768, Address=138.106.109.121:54101, MachineId=36217, Location=site:global.scd.scania.com,machine:N27858,process:22728)
    MemberId/ServiceVersion/ServiceJoined/ServiceLeaving
    1/3.1/Thu Jan 22 07:59:27 CET 2009/false,
    4/3.1/Thu Jan 22 08:00:36 CET 2009/false,
    5/3.1/Thu Jan 22 08:01:17 CET 2009/false
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onStartupTimeout(Grid.CDB:6)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:27)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:38)
         at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:28)
         at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
         at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
         at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:841)
         at com.tangosol.net.DefaultCacheServer.start(DefaultCacheServer.java:140)
         at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:61)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
    2009-01-22 08:01:47.659/34.157 Oracle Coherence GE 3.4.1/407 <Error> (thread=Invocation:InvocationService, member=5): validatePolls: This service timed-out due to unanswered handshake request. Manual intervention is required to stop the members that have not responded to this Poll
    PollId=1, active
    InitTimeMillis=1232607677393
    Service=InvocationService (2)
    RespondedMemberSet=[1]
    LeftMemberSet=[]
    RemainingMemberSet=[4]
    2009-01-22 08:01:47.659/34.157 Oracle Coherence GE 3.4.1/407 <D5> (thread=Invocation:InvocationService, member=5): Service InvocationService left the cluster
    2009-01-22 08:01:47.659/34.157 Oracle Coherence GE 3.4.1/407 <D4> (thread=ShutdownHook, member=5): ShutdownHook: stopping cluster node
    Process finished with exit code 1
    On the client JVM:
    2009-01-22 08:01:14.815/41.265 Oracle Coherence GE 3.4.1/407 <D5> (thread=Invocation:InvocationService, member=4): Repeating AggregateFilterRequest due to the re-distribution of PartitionSet[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]
    java.lang.RuntimeException: Storage is not configured
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.onMissingStorage(DistributedCache.CDB:9)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.ensureRequestTarget(DistributedCache.CDB:33)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.sendPartitionedRequest(DistributedCache.CDB:31)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.aggregate(DistributedCache.CDB:11)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ViewMap.aggregate(DistributedCache.CDB:52)
         at com.tangosol.coherence.component.util.SafeNamedCache.aggregate(SafeNamedCache.CDB:1)
         at com.tangosol.net.cache.NearCache.aggregate(NearCache.java:453)
         at com.scania.oas.coherence.invocables.ValueQueryInvocable.typeSearch(ValueQueryInvocable.java:260)
         at com.scania.oas.coherence.invocables.ValueQueryInvocable.queryStringFirstSearch(ValueQueryInvocable.java:300)
         at com.scania.oas.coherence.invocables.ValueQueryInvocable.run(ValueQueryInvocable.java:135)
         at com.scania.oas.coherence.invocables.InvocableWrapper.run(InvocableWrapper.java:54)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService.onInvocationRequest(InvocationService.CDB:10)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService$InvocationRequest.onReceived(InvocationService.CDB:40)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:130)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
         at java.lang.Thread.run(Thread.java:619)
    java.lang.RuntimeException: Storage is not configured
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.onMissingStorage(DistributedCache.CDB:9)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.ensureRequestTarget(DistributedCache.CDB:33)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.sendPartitionedRequest(DistributedCache.CDB:31)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.aggregate(DistributedCache.CDB:11)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ViewMap.aggregate(DistributedCache.CDB:52)
         at com.tangosol.coherence.component.util.SafeNamedCache.aggregate(SafeNamedCache.CDB:1)
         at com.tangosol.net.cache.NearCache.aggregate(NearCache.java:453)
         at com.scania.oas.coherence.invocables.ValueQueryInvocable.queryStringSearch(ValueQueryInvocable.java:268)
         at com.scania.oas.coherence.invocables.ValueQueryInvocable.queryStringFirstSearch(ValueQueryInvocable.java:297)
         at com.scania.oas.coherence.invocables.ValueQueryInvocable.run(ValueQueryInvocable.java:135)
         at com.scania.oas.coherence.invocables.InvocableWrapper.run(InvocableWrapper.java:54)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService.onInvocationRequest(InvocationService.CDB:10)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService$InvocationRequest.onReceived(InvocationService.CDB:40)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:130)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
         at java.lang.Thread.run(Thread.java:619)
    I even tried to re-write the "run method" in tthe invocable in a way that caused it to, in a loop, perform a delay and then re-try its calculations when it received a runtime exception with the text "Storage is not configured" causing the retreival a new named cache each time but this did not help - it never seemed to recover...
    Since I dont see any of my application classes in the "class cast" trace-back I assume it is an Coherence internal problem or can you thiink about some user programming error that could cause it? I am by the way not using any long or "Long in my application...
    Best Regards
    Magnus

    Hi Magnus,
    The log you provided seems to indicate that the problem was caused by the de-serialization of the “AggregateFilterRequest” message. The only explanation we have is that you are using a custom Filter that has asymmetrical serialization/deserialization routines, causing this failure. Could you please send us the corresponding client code?
    Meanwhile, we will open a JIRA issue, to make sure that Coherence handles this kind of error more gracefully.
    -David

Maybe you are looking for