Loop not executed

Hello, I am converting an abap extract from a basic select to one using a cursor.  The problem is, I cannot get the extract file written.  The original code would perform a select * from vbkd into itab1.  Then, the form that writes the file looks like this:
form write_delimited_file
           tables   datatab
           using    file
                    append
                    delimit
                    dlength
                    dwnload
          changing rc.
  data: type1,
        appd(1),
        temp(32),
        time1(8),
        date1(10),
        output(8192),
        rcount type i,
        offset type i,
        tablen type i,
        maxlen type i value '8192'.
  data: begin of clientab occurs 0,
             output(8192),
          end of clientab.
  field-symbols: <f>.
  appd = append.
  describe table datatab lines tablen.
  loop at datatab.
    <processing>
  endloop.
It is this "loop at datatab." that is the issue.  In the non-cursor abap, this loop is entered.  However, in the cursor abap, it is not.
I have executed this in debugging mode, and datatab looks like this:
   1  MANDT VBELN      POSNR  KONDA KDGRP BZIRK  PLTYP INCO1 INCO2          
          |          |      |     |     |      |     |     |                
   1 100  |0000000551|000000|     |     |      |     |EXW  |Michigan        
   2 100  |0000000552|000000|     |     |      |     |EXW  |Michigan        
   3 100  |0000000553|000000|     |     |      |     |EXW  |Michigan        
   4 100  |0000000554|000000|     |     |      |     |EXW  |Michigan        
As soon as the loop is entered, the empty row is immediately removed, and processing starts occurring on the first row of data.
But, for the program that is using a cursor, the datatab looks like this:
1  MANDT VBELN      POSNR  KONDA KDGRP BZIRK  PLTYP INCO1 INCO2 
  100  |0000001543|001005|     |     |      |     |FCA  |Memphis
I have noticed that for the non-cursor abap, there is an empty line between the header and the first data row, and that is where a hat icon exists.  In the cursor abap, there is no empty line, instead the hat icon is on the first (and only) data line.  I can only assume this is the reason why the loop is entered for the multi-row datatab, and not for the single-row datatab.
Cheers,
David Hull

Okay, thanks.  I guess I'll have to play with it a bit, since I'm not an abapper and don't understand all of the syntax here, so I'm sortof mucking my way through this.  This was someone else's code, and originally generated code, to make it worse.    Here's the entire program, for reference:
REPORT ZAL_ABAP message-id 26 line-size 255
no standard page heading.
* zbvbkd0.
PARAMETER DOWNLOAD(1) DEFAULT 'N' lower case. "N-svr,Y-clnt
PARAMETER EXECMODE(1) DEFAULT 'B' lower case. "D-dlg,B-btch
PARAMETER OUT_DIR(60) DEFAULT          "output file dir
'/ACTA' lower case.
PARAMETER IN_DIR(60) DEFAULT           "input file dir
'/ACTA' lower case.
TABLES : VBKD, VBAK.               "DEVK984947
DATA: vbkd_cur TYPE cursor.        " rdh
DATA: headerflag(1) TYPE c.        " rdh
DATA: begin of ITAB1 occurs 0,
MANDT(3) TYPE C,
VBELN(10) TYPE C,
POSNR(6) TYPE C,
KONDA(2) TYPE C,
KDGRP(2) TYPE C,
BZIRK(6) TYPE C,
PLTYP(2) TYPE C,
INCO1(3) TYPE C,
INCO2(28) TYPE C,
KZAZU(1) TYPE C,
PERFK(2) TYPE C,
PERRL(2) TYPE C,
MRNKZ(1) TYPE C,
KURRF(5) TYPE P DECIMALS 5,
VALTG(2) TYPE C,
VALDT TYPE D,
ZTERM(4) TYPE C,
ZLSCH(1) TYPE C,
KTGRD(2) TYPE C,
KURSK(5) TYPE P DECIMALS 5,
PRSDT TYPE D,
FKDAT TYPE D,
FBUDA TYPE D,
GJAHR(4) TYPE C,
POPER(3) TYPE C,
STCUR(5) TYPE P DECIMALS 5,
MSCHL(1) TYPE C,
MANSP(1) TYPE C,
FPLNR(10) TYPE C,
WAKTION(10) TYPE C,
ABSSC(6) TYPE C,
LCNUM(10) TYPE C,
J_1AFITP(2) TYPE C,
J_1ARFZ(1) TYPE C,
J_1AREGIO(3) TYPE C,
J_1AGICD(2) TYPE C,
J_1ADTYP(2) TYPE C,
J_1ATXREL(10) TYPE C,
ABTNR(4) TYPE C,
EMPST(25) TYPE C,
BSTKD(35) TYPE C,
BSTDK TYPE D,
BSARK(4) TYPE C,
IHREZ(12) TYPE C,
BSTKD_E(35) TYPE C,
BSTDK_E TYPE D,
BSARK_E(4) TYPE C,
IHREZ_E(12) TYPE C,
POSEX_E(6) TYPE C,
KURSK_DAT TYPE D,
KURRF_DAT TYPE D,
KDKG1(2) TYPE C,
KDKG2(2) TYPE C,
KDKG3(2) TYPE C,
KDKG4(2) TYPE C,
KDKG5(2) TYPE C,
WKWAE(5) TYPE C,
WKKUR(5) TYPE P DECIMALS 5,
AKWAE(5) TYPE C,
AKKUR(5) TYPE P DECIMALS 5,
AKPRZ(3) TYPE P DECIMALS 2,
J_1AINDXP(5) TYPE C,
J_1AIDATEP TYPE D,
BSTKD_M(35) TYPE C,
DELCO(3) TYPE C,
FFPRF(8) TYPE C,
BEMOT(2) TYPE C,
FAKTF(2) TYPE C,
RRREL(1) TYPE C,
ACDATV(1) TYPE C,
VSART(2) TYPE C,
TRATY(4) TYPE C,
TRMTYP(18) TYPE C,
SDABW(4) TYPE C,
WMINR(10) TYPE C.
DATA: end of ITAB1.
data: append_flag(1) value ' ',
      cntbuf type i,
      delimleng type i.
***start of insert DEVK984947
data: outfile(128), ldfile(32).
data: begin of ht,
        x(1) type x value '09',
        end of ht.
data  dlmtlen type i value '1'.
data return_code type i.
***end of insert DEVK984947
start-of-selection.
  refresh itab1.                                            "DEVK984947
  free : itab1, vbak, vbkd.                                 "DEVK984947
  clear :  itab1, vbak, vbkd.                               "DEVK984947
  PERFORM FORM1.
end-of-selection.
*       FORM FORM1                                                    *
FORM FORM1.
OPEN CURSOR vbkd_cur FOR
  SELECT
    MANDT VBELN POSNR KONDA
    KDGRP BZIRK PLTYP INCO1 INCO2
    KZAZU PERFK PERRL MRNKZ KURRF
    VALTG valdt zterm ZLSCH KTGRD
    KURSK PRSDT
    FKDAT FBUDA GJAHR POPER
    STCUR MSCHL MANSP FPLNR WAKTION
    ABSSC LCNUM J_1AFITP J_1ARFZ
    J_1AREGIO J_1AGICD J_1ADTYP J_1ATXREL
    ABTNR EMPST BSTKD BSTDK BSARK
    IHREZ BSTKD_E BSTDK_E BSARK_E
    IHREZ_E POSEX_E KURSK_DAT KURRF_DAT
    KDKG1 KDKG2 KDKG3 KDKG4 KDKG5
    WKWAE WKKUR AKWAE AKKUR AKPRZ
    J_1AINDXP J_1AIDATEP BSTKD_M DELCO
    FFPRF BEMOT FAKTF RRREL ACDATV
    VSART TRATY TRMTYP SDABW WMINR
  FROM vbkd.
DO.
  FETCH NEXT CURSOR vbkd_cur into corresponding fields of itab1.
  IF sy-subrc <> 0.
    CLOSE CURSOR vbkd_cur.
    EXIT.
  ELSEIF headerflag NE 'Y'.   " whether we've created the file or not
    PERFORM FORM2.        " call form to write out file
    headerflag = 'Y'.     " set flag so that next time we append
  ELSE.
    PERFORM FORM12.       " call form to append to file
  ENDIF.
ENDDO.
ENDFORM.
*       FORM FORM2                                                    *
FORM FORM2.
  ldfile = 'ybvbkd0_test.txt'.
  concatenate out_dir ldfile into outfile
    separated by '/'.
  perform write_delimited_file
            tables   ITAB1
            using    outfile
                     append_flag
                     ht
                     dlmtlen
                     download
            changing return_code.
  case return_code.
    when 1.
      IF EXECMODE = 'D'.
        WRITE: /5 'No line selected'.
      ELSE.
        MESSAGE E098.
      ENDIF.
    when 2.
      IF EXECMODE = 'D'.
        WRITE: /5 'Open File Error -- ', 25 OUTFILE.
      ELSE.
        MESSAGE  E107 WITH OUTFILE.
      ENDIF.
    when 3.
      IF EXECMODE = 'D'.
        WRITE: /5 'Data exceed length limit (8192) '.
      ELSE.
        MESSAGE  E000 WITH
             'Data exceed length limit (8192) '.
      ENDIF.
    when 4.
      IF EXECMODE = 'D'.
        WRITE: /5 'Call function WS_DOWNLOAD error'.
      ELSE.
        MESSAGE  E000 WITH
             'Call function WS_DOWNLOAD error'.
      ENDIF.
  endcase.
ENDFORM.
*       FORM SUBSTRING                                                *
*  -->  SRC                                                           *
*  -->  BEG                                                           *
*  -->  LEN                                                           *
*  -->  RET                                                           *
FORM SUBSTRING USING SRC BEG LEN CHANGING RET.
  DATA: VA1 TYPE I.
  DATA: VA2 TYPE I.
  DATA: VA3 TYPE I.
  VA3 = STRLEN( SRC ).
  IF  BEG < 1.
    VA1 = 0.
  ELSE.
    VA1 = BEG - 1.
  ENDIF.
  IF  LEN < 0.
    VA2 = 0.
  ELSE.
    VA2 = VA3 - VA1.
  ENDIF.
  IF  VA2 > LEN.
    VA2 = LEN.
  ENDIF.
  IF  VA2 < 1.
    MOVE ''           TO RET.
  ELSE.
    MOVE SRC+VA1(VA2) TO RET.
  ENDIF.
ENDFORM.
*       FORM write_delimited_file                                     *
*  -->  datatab                                                       *
*  -->  file                                                          *
*  -->  append                                                        *
*  -->  delimit                                                       *
*  -->  dlength                                                       *
*  -->  dwnload                                                       *
*  -->  rc                                                            *
form write_delimited_file
           tables   datatab
           using    file
                    append
                    delimit
                    dlength
                    dwnload
          changing rc.
  data: type1,
        appd(1),
        temp(32),
        time1(8),
        date1(10),
        output(8192),
        rcount type i,
        offset type i,
        tablen type i,
        maxlen type i value '8192'.
  data: begin of clientab occurs 0,
             output(8192),
          end of clientab.
  field-symbols: <f>.
  appd = append.
  describe table datatab lines tablen.
  if dwnload = 'Y'.
    clear clientab. refresh clientab.
    rcount = 0.
  else.
    if appd = space.
      open dataset file for output in text mode.
    else.
      open dataset file for appending in text mode.
    endif.
    if sy-subrc <> 0.
      rc = 2. exit.
    endif.
  endif.
  loop at datatab into datatab.
    clear: tablen, offset, output.
    do.
      assign component sy-index of
         structure datatab to <f>.
      if sy-subrc <> 0. exit. endif.
      if sy-index > 1.
        write delimit to output+offset(dlength).
        add dlength to offset.
      endif.
      describe field <f> type type1.
      if type1 = 'I' or type1 = 'N'.
        type1 = 'P'.
      endif.
      case type1.
        when 'D'.
          if <f> = '00000000'.
            <f> = ' '.
          else.
            move <f> to time1.
            assign time1 to <f>.
          endif.
        when 'F'.
          if <f> = '0.0'.
            temp = '0.0'.
          else.
            write <f> to temp exponent 0.
          endif.
          condense temp no-gaps.
          translate temp using ',.'.
          assign temp to <f>.
        when 'P'.
          if <f> < 0.
            write '-' to output+offset(1).
            add 1 to offset.
            <f> = <f> * ( -1 ).
          endif.
          move <f> to temp.
          condense temp no-gaps.
          translate temp using ',.'.
          assign temp to <f>.
      endcase.
      sy-fdpos = strlen( <f> ).
      tablen = offset + sy-fdpos.
      if tablen > maxlen.
        rc = 3. exit.
      endif.
      write <f> to output+offset(sy-fdpos).
      add sy-fdpos to offset.
    enddo.
    if dwnload = 'Y'.
      clientab-output = output.
      append clientab.
      rcount = rcount + 1.
      if rcount >= 50.
        SY-BATCH = SPACE.
        CALL FUNCTION 'WS_DOWNLOAD'
             EXPORTING
                  FILENAME            = file
                  FILETYPE            = 'DAT'
                  MODE                = appd
             TABLES
                  DATA_TAB            = clientab
             EXCEPTIONS
                  file_open_error     = 1
                  file_write_error    = 2
                  invalid_filesize    = 3
                  invalid_table_width = 4
                  invalid_type        = 5
                  no_batch            = 6
                  unknown_error       = 7
                  others              = 8.
        if sy-subrc <> 0.
          rc = 4.
        endif.
        clear clientab. refresh clientab.
        rcount = 0. appd = 'A'.
      endif.
    else.
      transfer output to file.
    endif.
  endloop.
  if dwnload = 'Y'.
    SY-BATCH = SPACE.
    CALL FUNCTION 'WS_DOWNLOAD'
         EXPORTING
              FILENAME            = file
              FILETYPE            = 'DAT'
              MODE                = appd
         TABLES
              DATA_TAB            = clientab
         EXCEPTIONS
              file_open_error     = 1
              file_write_error    = 2
              invalid_filesize    = 3
              invalid_table_width = 4
              invalid_type        = 5
              no_batch            = 6
              unknown_error       = 7
              others              = 8.
    if sy-subrc <> 0.
      rc = 4.
    endif.
  else.
      close dataset file.
  endif.
endform.
*&      Form  FORM12
*       text
*  -->  p1        text
*  <--  p2        text
FORM FORM12.
  append_flag = 'X'.
  perform write_delimited_file
            tables   ITAB1
            using    outfile
                     append_flag
                     ht
                     dlmtlen
                     download
            changing return_code.
  case return_code.
    when 1.
      IF EXECMODE = 'D'.
        WRITE: /5 'No line selected'.
      ELSE.
        MESSAGE E098.
      ENDIF.
    when 2.
      IF EXECMODE = 'D'.
        WRITE: /5 'Open File Error -- ', 25 OUTFILE.
      ELSE.
        MESSAGE  E107 WITH OUTFILE.
      ENDIF.
    when 3.
      IF EXECMODE = 'D'.
        WRITE: /5 'Data exceed length limit (8192) '.
      ELSE.
        MESSAGE  E000 WITH
             'Data exceed length limit (8192) '.
      ENDIF.
    when 4.
      IF EXECMODE = 'D'.
        WRITE: /5 'Call function WS_DOWNLOAD error'.
      ELSE.
        MESSAGE  E000 WITH
             'Call function WS_DOWNLOAD error'.
      ENDIF.
  endcase.
ENDFORM.                    " FORM12

Similar Messages

  • For Loop Will Not Execute

    I have been a software engineer for a number of years now, and thus far I have never come across any coding issues that truly merit a post such as this. Someone has almost always run across the issue before, so there is no need to reinvent the wheel, or solution as it were.
    However, a number of times I have run across instances where the JRE simply... does not execute parts of my code, and throws no exceptions.
    The sample code is a simple logging application, watered down to the bare minimum for the purposes of this forum:
    public class Log {
    public static void main(String[] args)    {Log log = new Log();}
    public Log() {Logger.log("Hello World");}
    import java.util.*;*
    import java.io.*;
    import java.text.SimpleDateFormat;
    public abstract class Logger {
    private static final int SIZE = 2;
    private static final SimpleDateFormat DAY = new SimpleDateFormat("EEEE");
    private static final String
      DIR = "logs/",
      EXT = ".log",
      FILTER = ".*log\\z",
      DNE = "DNE";
    private static int i,oldest;
    private static long previous = 0;
    private static FileFilter filter = new LogFilter();
    private static FileWriter out;
    private static File file,directory;
    private static File[] list;
    public synchronized static void log(String param) {
      try {
       directory = new File(DIR);
       file = new File(DIR + getDay() + EXT);
       list = directory.listFiles(filter);
       if (file.createNewFile()) {
        readOnly();
        reconcile();
       write(param);
      catch (Exception exception) {}
    private static void write(String param) throws Exception {
      out = new FileWriter(file, true);
      out.write(param);
      out.close();
    private static void readOnly() throws Exception {
      for (i=0;i<list.length;i++) {list.setReadOnly();}
    private static void reconcile() {
    try {
    previous = list[SIZE].lastModified();
    oldest = SIZE;
    for (i=SIZE;i<=0;i--) {
    if (list[i].lastModified() <= previous) {
    previous = list[i].lastModified();
    oldest = i;
    list[oldest].delete();
    catch (Exception exception) {System.out.println("Skipping reconciliation...");}
    private static String getDay() throws Exception {
    return DAY.format(Calendar.getInstance().getTime());
    private static class LogFilter implements FileFilter {
    public LogFilter() {}
    public boolean accept(File param) {
    try {
    if ((param.getName()).matches(FILTER)) {return true;}
    else {return false;}
    catch (Exception exception) {return false;}
    *The problem*:
    Ok, easy visual, this is the "log/" directory as I run the Log.java application repeatedly and iterate the date on my computer as I do so.
    Thursday
    *log/*
    +Thursday.log+
    Friday
    *log/*
    +Thursday.log+
    +Friday.log+
    Saturday
    *log/*
    +Thursday.log+
    +Friday.log+
    +Saturday.log+
    Sunday
    *log/*
    +Friday.log+
    +Saturday.log+
    +Sunday.log+
    Monday
    *log/*
    +Friday.log+
    +Saturday.log+
    +Monday.log+
    This is the point at which I go ???
    Turns out, the JRE skips the execution of my for loop in the *reconcile()* method when the date rolls over to Monday, and from then on it simply deletes the previous day's log instead of the oldest log.
    Why?  Who knows.
    Things I have tried:
    - Using another variable integer for the *readOnly()* method
    - Removing the synchronized keyword from the *log(String param)* method
    - Second call to *directory.listFiles(filter)* and setting *SIZE* to *3* after the old files have been set to read-only
    - Removing the call to *readOnly()*
    - Verified that the call to *readOnly()* does not alter the +modified+ date on the log files
    - Changed Logger.java from a +static+ class to a +local+ class
    Things I cannot do:
    This log application stores privy information about end-users at locations across the country in the event that there are support issues that need to be resolved, and the agreement is that we store this information no more than three days.  Just wanted to make sure, that the hopefully informed respondants to this issue, know that the obvious solution (storing seven day records), is unfortunately not available to me.
    Edited by: Threadstorm on Jan 8, 2009 8:24 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    HA! Most excellent. The last place I would ever look.
    Yes, seems like Java sorts the files in such a way that everything works fine without the loop until Monday rolls over.
    Now I can have a better appreciation for that second set of eyes.
    I use for loops so frequently that I never look at them (though I did stare at this one myself prior to this post, much to my chagrin now) but the subtracting iteration (which I use once in a blue moon) was necessary for the nature of the code.
    But ok, up and running! (whew) was going to be a long day until now.
    To answer your question though, the Logger is static so I don't have to pass it around to dozens and dozens of other modules but rather just include the package on the fly as I develop new modules that need to log information, and I like to write most mundane things myself if I can, that way I have the freedom to modify them at will.
    Thanks again! I'm now a happy camper once more.
    I'm also thankful that I don't have to chalk up another notch on the wall of cases where the JRE behaves magically and truly ignores code which I have definitely run into before. Something about listCellRenderers and the order of calls made to them, or some such and JRE doesn't read one of the lines. It's been a year or two.
    Edited by: Threadstorm on Jan 8, 2009 8:47 AM

  • Error message "VI is not executable"! Need help with Application Builder

    Hello,
    I have a problem with an application, built with the Application Builder. I have read some threads about the problem I have, but I still don't know a solution.
    When I run my front panel from LabVIEW, everything is good. So, now I created an application (and an installer) to be able to run it on other PCs as well. This application does not work. Everytime I start it on my PC, I get the error "VI is not executable. ...". I read in several forums solutions for this error, but I cannot fix it! I've changed my properties for the builder, but with no success. Perhaps, anybody has more ideas, what's the problem.
    To get a better idea from my project, here a little description of it:
    In the block diagram there is a while loop which is continuously runned. In this loop I only set some properties for the layout of the front panel, such as decorations which will be hidden/shown and changes of colours of indicators... For the rest, it waits for a click on the button "Start" in the front panel. After that, a DLL is called to communicate with a USB device. Some measurements are carried out and the DLL is closed. I hope, you can get a global idea from my block diagram...
    I use LabVIEW 8.5, the DLL is a third-party DLL, which we wrote on our own. But I think the DLL works properly, if it is called from a C# application it works and it works, too, by calling it from LabVIEW when I am in development mode.
    It's a project for university and I'm just a beginner in LabVIEW, so I don't have so much experiences in it, but I think i improved my knowlegde about LabVIEW very well in the last weeks!
    So, i hope to get an answer soon (the deadline for the project is not soooo far away )
    If you need more information, please let it know...
    I would be very grateful if there is someone with a working solution...
    Kind regards from the Netherlands,
    Sebastian

    Sebastian,
    Your architecture makes it very difficult to debug this and other problems.  Does the error message mention which VI is causing the problem?  It is very important to wire your error clusters everywhere.  In LabVIEW, when a node throws an error (Error.Status = T), future nodes do not execute.  At the end, place an error cluster indicator that you can see on your front panel.  When an error posts, you can right click the indicator (even in a compiled application) and select "Explain Error".
    This is a start, but you really need to push this into a queued-state machine before this gets any more complicated.  As it were, if anything in your loop hangs, your whole application hangs.  See attached for a queued-message handler (not advisable for actual applications, but you get the point.  You would want to have a type defined enum in lieu of strings, and shared data between states differently, etc.)
    -Jason
    Message Edited by LabBEAN on 01-20-2009 08:36 AM
    Certified LabVIEW Architect
    Wait for Flag / Set Flag
    Separate Views from Implementation for Strict Type Defs
    Attachments:
    State Machine.vi ‏18 KB

  • Why does my While loop not work?

    I was using the SetInterval timer but this kept causing problems getting the timing right,
    So I thought - get the loop to work infiitely...
    var cond=0;
    while (cond !=1){
    $("#DivStage1").fadeIn(1000);
    $("#DivStage1").delay(6500).fadeOut(500); //8000
    $("#DivStage1_1").show("slide", {direction:'left'}, 1000);
    $("#DivStage1_1").delay(6500).hide("slide", {direction:'left'},500);
    $("#DivStage1_2").delay(1000).show("slide", {direction:'left'}, 1000);
    $("#DivStage1_2").delay(5500).hide("slide", {direction:'left'}, 1000);
    $("#DivStage2").delay(8000).fadeIn(1000);
    $("#DivStage2").delay(17000).fadeOut(500); //8000 to 16000
                            $("#DivStage2_1").delay(8000).show("slide", {direction:'left'}, 1000);
                             $("#DivStage2_1 h2 #1 style='color: #FFF;'").show();
                             $("#DivStage2_1").delay(16000).hide("slide", {direction:'left'},500);
    The page does not execute the loop.
    Thanks in advance for any feedback

    Create a function for the loop and call the function when the document is ready.
    Don't forget to include the jQuery library, jquery.js or similar.

  • ORA-24338: statement handle not executed   -- error in returning refcursor

    My packaged procedure has Ref cursor as out variable.
    Calling the packaged procedure from Cognos 8. while trying to access the packaged procedure , getting the below error.
    ORA-24338: statement handle not executed
    Please provide a solution...

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    Confirm that the procedure works properly when called from sql*plus.
    For example here is some code that tests a package procedure I have in the SCOTT schema
    SET SERVEROUTPUT ON SIZE 1000000
    DECLARE
      l_cursor  test_refcursor_pkg.my_ref_cursor;
      l_ename   emp.ename%TYPE;
      l_empno   emp.empno%TYPE;
    BEGIN
      test_refcursor_pkg.test_proc (l_cursor);
      LOOP
        FETCH l_cursor
        INTO  l_empno, l_ename;
        EXIT WHEN l_cursor%NOTFOUND;
        DBMS_OUTPUT.PUT_LINE(l_ename || ' | ' || l_empno);
      END LOOP;
      CLOSE l_cursor;
    END;
    /

  • Not executing the step

    hi ,
    im using loop in workflow.
    in loop i have used 3 steps.
    while i was watching the log i found that  one particular step was not executed and its going to the next step  even i have given the steps sequentially in the loop.due to that condition is not satisfied and its showing the maximun number of nodes reached.
    how to correct this error.
    please help me.
    Raghu

    Check your workflow definition to see what is wrong. Also analyze the technical log.
    Regards,
    Martin
    Edited by: Martin Nooteboom on Jun 13, 2008 11:59 AM
    Or as you will have found from your other thread, reset the buffers. Please try to be more clear when you ask a question and try to give as much information as possible.

  • Scenario File to RFC (BAPI): BAPI not executed successful

    Hi Dear Friends!
    At execution of asynchronous Scenario File to RFC (BAPI BAPI_ACC_DOCUMENT_POST)
    I have the following error in RWB Communication Channel (RFC receiver):
    - Error: 2007-07-25 11:08:25 EEST: Message processed for interface BAPI_ACC_DOCUMENT_POST:
    com.sap.aii.af.rfc.afcommunication.RfcAFWException: error while processing message
    to remote system:com.sap.aii.af.rfc.core.client.RfcClientBapiException:
    BAPI not executed successful
    Simultaniously <b>Test Configuration</b> was executed successfully. And mapping is good.
    But I don't any message in <b>target system</b> in <b>sxmb_moni</b> (formed by BAPI).
    In <b>XI system</b> I see in <b>sxmb_moni</b>:
    <Trace level="1" type="T">--start sender interface action determination</Trace>
      <Trace level="1" type="T">select interface mi_sender*</Trace>
      <Trace level="1" type="T">select interface namespace urn:file:to:bapi</Trace>
      <Trace level="1" type="T">no interface found</Trace>
      <Trace level="1" type="T">--start receiver interface action determination</Trace>
      <Trace level="1" type="T">Loop 0000000001</Trace>
      <Trace level="1" type="T">select interface *</Trace>
      <Trace level="1" type="T">select interface namespace</Trace>
      <Trace level="1" type="T">no interface found</Trace>
      <Trace level="1" type="T">--no sender or receiver interface definition found</Trace>
    Please help me understand my error.
    With the best regards,
    Natalia Maslova

    Hi, Dear Friends! Thanks for support!
    My settings of
    Connection between systems:
    DX7 01 (client 001) - XI Integration Server and DE2 13 (client 200) - target system.
    Phisically both systems are in one server: 10.20.30.24 (srv24)
    Business system DE2_200 has Communication Channel: cc_bapi_r, its settings (in Integration Builder Configuration):
    Adapter Type: RFC
    Receiver
    Transport Protocol: RFC
    Message Protocol: RFC (RFC XML)
    Adapter Engine: Integration Server
    RFC Client Parameter:
    RFC Server Type: SAP System
    Application Server: 10.20.30.24
    System Number: 13
    Authentication Mode: Use Logon Data for SAP System
    Logon User: n_maslova
    Logon Password: *******=*******
    Logon Language: EN
    Logon Client: 200
    Maximum Connections: 1
    x Advanced Mode
    x Send 'Confirm Transaction'
    x Commit Handling for Single BAPI Calls
    x BAPI Advances Mode
    Successful RETURN-TYPE Values: 0
    As I understand these settings are the settings of RFC-destination for target system DE2 13 (200) from XI (DX7 01 001).
    In SLD, Business system DE2_200 is defined as:
    Integration:
    Role: Application System
    Related Integration Server: DX7_001
    Technical System: DE2 on srv24
    Client: 200 of DE2
    Logical System Name: DE1CLNT200
    In target system DE2 13 (200) with the help of transaction sm59 I created
    RFC-destination DX7_001 of type H:
    Technical setting parameters:
    Target Host: 10.20.30.24
    Prefix Path: /sap/xi/engine/?type=entry
    Service Number: 8001
    Registration and Safe:
    SSL: Non active.
    SSL: client certificate: DFAULT SSL-client
    Enter to system:
    Language: EN
    Client: 001
    User: PIAPPLUSER
    Status PW: saved
    Password: ********
    After that in this system DE2 13 (200) with the help of transaction sxmb_adm I set in Integration Engine -> Configuration -> Configurate Integration Engine
    (Change Global Configuration Data):
    Role of Business System: Application System
    Related Integr. Server: dest://DX7_001
    Best regards,
    Natalia

  • Subvi is not executable error, but it has no error

    Hey I hope you can help me with a weird error.
    I got the error "SubVi  'name' : SubVi is not executable" but when I click on the SubVi and open it it does not show me any description of an error. If I open the main vi or the SubVi alone it shows no error. Could it be a problem of a library or something else?
    I am using Labview 2012 and Labview 2012 Mindstorms NXT.
    If you neew more screenshots or the rest of the SubVis please tell me so :-)
    Thank you!
    Jan
    Attachments:
    automatischer Modus - ohne Wait - ohne Array - global.vi ‏80 KB
    Solar.vi ‏15 KB
    project.png ‏262 KB

    SmartCity-Project wrote:
    Thanks for all your replies!
    I found the error, the NXT does not support global variables in Target on NXT- Mode so I changed to Target on Computer - Mode and now it works.
    Unfortunately the program crashes after 15 minutes more or less. Could you imagine why? Is it because of to many bluetooth connections or a bad programm structure?
    After a very quick look at the code I would say that it is probably bad code. Your overuse of global variables, sequence structures and silly things like a For loop set to run once with everything inside the loop wrapped in a sequence frame is a goo dindication that you need to learn much more about data flow programming techniques. With the amount of global variables you are using your program is probably ripe with race conditions. In addition, you did not include any of the subVIs so we cannot see what is happening in them.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • While loop not performing correctly

    When I enter ANY number, the second while loop in the code below executes. It should not execute when 117, 239, 298, 326, or 445 is entered. I can't seem to figure out why this does not work, and I do not know what else to try.
    Hope someone can just give some assistance. Thank you!
    If I need to supply the entire program, just let me know.
    while(! done)
                   try
                        System.out.println("Enter the flight number");
                        entry = keyboard.nextInt();
                        while((entry != 117) || (entry != 239) || (entry != 298) || (entry != 326) || (entry!= 445))
                             System.out.println("Flight number must be 117, 239, 298, 326, 445");
                             System.out.println("Please try again");
                             entry = keyboard.nextInt( );
                             done = true;
                   catch(InputMismatchException e)
                        keyboard.nextLine();
                        System.out.println("Not the correct entry");
                        System.out.println("Please try again");
              }

    JosAH wrote:
    paulcw wrote:
    The outer loop loops on "not done", but in the body of that loop, done is unconditionally set to true. So the outer loop will only run once. Therefore it's pointless. I'm guessing that you meant to only set done to true if the user inputs "quit" or something.The 'not done' loop will iterate again if the user supplied incorrect input (not an int).Man that's a confusing flow of control. So if the user types in anything other than a number, it's causes a parse error (basically) and the exception causes it to skip the command to stop, and that makes it loop again.
    So apparently 3/4 of the people looking at that code didn't get it at first.
    It reminds me of the veda about Mel.
    Come up with something clearer.

  • Script is not executed - Standard-TimeOut

    Hello, I have a problem with a script, that is debugged without mistakes, but is not executed anyway. The Script consists of the movie with a keyframe  that creates a new Instance for an Object that again creates a series of new Instances for another Object (array) that controls an associated Movieclip.
    The Error: A Script was executed longer than the Standard-Time-Out of 15 Seconds.
    If necessary, I will add the script.
    Thank you

    The Script shall create an endless flow of fonts that fall from top to bottem (a "matrix in serif")
    The Main Movie
    import testklassen.*;
    stop();
    var FontFlow1:FontFlow = new FontFlow();
    The "testklassen"-package:
    The First Object "Font" controls the Motion of the "FontMovieClip".
    package testklassen {
        import flash.display.*;
        import flash.display.MovieClip;
        import flash.utils.*;
        import flash.events.*;
        import flash.events.Event;
        import fl.transitions.*;
        public class Font {
                public var Counter:int;
                public var X_Position:int;
                public var Y_Position:int;
                public var Speed:int;
                public var myFrameRate:Number;
                public function Font (pCounter, pX_Position, pY_Position, pSpeed)  {
                    this.Counter = pCounter;
                    this.X_Position = pX_Position;
                    this.Y_Position = pY_Position;
                    this.Speed = pSpeed;
                    this.myFrameRate = 1000/32;
                    //Loop moves the FontMovieClip from the top to the bottom...
                    //The Motion consists only of Y-component.
                    root.FontMovieClips[Counter].play();
                    var timer:Timer = new Timer(myFrameRate, 100);
                    timer.addEventListener(TimerEvent.TIMER, goOn);
                        function goOn()  {
                        this.Y_Position += this.Speed
                        root.FontMovieClips[Counter].Y = this.Y_Position;

  • Why is the second update in trigger not executing

    Hi all I'm just starting with pl/sql . My trigger works but the second update does not execute.
    why is it not executing? and how can I get it to execute?
    CREATE OR REPLACE TRIGGER bb_ordercancel_trg
    AFTER UPDATE OF idstatus ON bb_basketstatus
    FOR EACH ROW
    WHEN( new.idstage = 4)
    DECLARE
    CURSOR basketitem_cur is
    SELECT idproduct,quantity,option1
    from bb_basketitem
    where idbasket =:new.idbasket;
    lv_chg_num NUMBER(3,1);
    BEGIN
    FOR basketitem_rec in basketitem_cur LOOP
    IF basketitem_rec.option1 =1 then
    lv_chg_num := (.5*basketitem_rec.quantity);
    ELSE
    lv_chg_num := basketitem_rec.quantity;
    END IF;
    update bb_product
    set stock= stock - lv_chg_num
    where idproduct = basketitem_rec.idproduct;
    update bb_basket
    set orderplaced = NULL
    where idbasket = :new.idbasket;
    END LOOP;
    END;

    I retract that and with the modified code it works .
    thanks guys, I should have drank a little more coffee when I started this ;-)
    CREATE OR REPLACE TRIGGER bb_ordcancel_trg
    AFTER INSERT ON bb_basketstatus
    FOR EACH ROW
    WHEN( new.idstage = 4)
    DECLARE
    CURSOR basketitem_cur is
    SELECT idproduct,quantity,option1
    from bb_basketitem
    where idbasket =:new.idbasket;
    lv_chg_num NUMBER(3,1);
    BEGIN
    FOR basketitem_rec in basketitem_cur LOOP
    IF basketitem_rec.option1 =1 then
    lv_chg_num := (.5*basketitem_rec.quantity);
    ELSE
    lv_chg_num := basketitem_rec.quantity;
    END IF;
    update bb_product
    set stock= stock - lv_chg_num
    where idproduct = basketitem_rec.idproduct;
    update bb_basket
    set orderplaced = 0
    where idbasket = :new.idbasket;
    END LOOP;
    END;
    Edited by: user8690163 on Dec 8, 2009 12:57 PM

  • Expression is not executing.......

    in the if loop im trying to add a date with a number... the expression i showed below is not executing...
    DECLARE
    EID VARCHAR2 (20);
    DB DATE;
    FN varchar2(100);
    LN varchar2(20);
    BL BOOLEAN := TRUE;
    x number;
    APP NUMBER;
    REA VARCHAR2(200);
    BEGIN
    SELECT EMPNO,DOB,FNAME,LNAME
    INTO EID,DB,FN,LN
    FROM GENINFO
    WHERE EMPNO=:P12_EMPNO AND DOB=:P12_DOB;
    SELECT NVL(MAX(APP_NO),0)+1
    into APP from leave_form;
    SELECT REASON into REA from leave_form
    WHERE EMP_NO=:P12_EMPNO;
    :EMP_NO1:=EID;
    :CREATED_BY1:=FN||' '||LN;
    :APP_DATE1:=sysdate;
    :APP_NO1:=APP;
    :REASON1:=REA;
    BL := TRUE;
    :BLNF:=sys.DIUTIL.bool_to_int (BL);
    --htp.prn(x);
    EXCEPTION
    when no_data_found then
    BL := FALSE;
    :BLNF:=sys.DIUTIL.bool_to_int (BL);
    --htp.prn(x);
    IF :P12_FDATE IS NOT NULL AND :P12_TDATE IS NOT NULL THEN
    :P12_TDATE:=TO_CHAR(TO_DATE(':P12_FDATE','DD-MM-YYYY') + :P12_NO_OF_DAYS_REQ,'DD-MM-YYYY');-----this expression is not executing
    INSERT INTO LEAVE_FORM(EMP_NO,APP_NO,APP_DATE,NO_OF_DAYS_REQ,FDATE,TDATE,LEAVE_TYPE,REASON) VALUES(:EMP_NO1+1,:APP_NO1,:APP_DATE1,:P12_NO_OF_DAYS_REQ,:P12_FDATE,:P12_TDATE,:P12_LEAVE_TYPE,:REASON1);
    END IF;
    END;
    Edited by: 794244 on Feb 17, 2011 5:48 AM

    Try this...
    DECLARE
       EID   VARCHAR2 (20);
       DB    DATE;
       FN    VARCHAR2 (100);
       LN    VARCHAR2 (20);
       BL    BOOLEAN := TRUE;
       x     NUMBER;
       APP   NUMBER;
       REA   VARCHAR2 (200);
    BEGIN
       SELECT   EMPNO,
                DOB,
                FNAME,
                LNAME
         INTO   EID,
                DB,
                FN,
                LN
         FROM   GENINFO
        WHERE   EMPNO = :P12_EMPNO AND DOB = :P12_DOB;
       SELECT   NVL (MAX (APP_NO), 0) + 1 INTO APP FROM leave_form;
       SELECT   REASON
         INTO   REA
         FROM   leave_form
        WHERE   EMP_NO = :P12_EMPNO;
       :EMP_NO1 := EID;
       :CREATED_BY1 := FN || ' ' || LN;
       :APP_DATE1 := SYSDATE;
       :APP_NO1 := APP;
       :REASON1 := REA;
       BL := TRUE;
       :BLNF := sys.DIUTIL.bool_to_int (BL);
    --htp.prn(x);
    EXCEPTION
       WHEN NO_DATA_FOUND
       THEN
          BL := FALSE;
          :BLNF := sys.DIUTIL.bool_to_int (BL);
          --htp.prn(x);
          IF :P12_FDATE IS NOT NULL AND :P12_TDATE IS NOT NULL
          THEN
             :P12_TDATE := TO_DATE(:P12_FDATE, 'DD-MM-YYYY') + :P12_NO_OF_DAYS_REQ; -----this expression is not executing
             INSERT INTO LEAVE_FORM (EMP_NO,
                                     APP_NO,
                                     APP_DATE,
                                     NO_OF_DAYS_REQ,
                                     FDATE,
                                     TDATE,
                                     LEAVE_TYPE,
                                     REASON)
               VALUES   (:EMP_NO1 + 1,
                         :APP_NO1,
                         :APP_DATE1,
                         :P12_NO_OF_DAYS_REQ,
                         :P12_FDATE,
                         :P12_TDATE,
                         :P12_LEAVE_TYPE,
                         :REASON1);
          END IF;
    END;Cheers
    Ben

  • Plsql block not executing

    Hi ,
    The Below block not executing,please correct this block
    declare
    v_sql varchar2(1024);
    begin
     for c in (
       SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE 'B2M_%' and PARTITIONED='YES';
    loop
      v_sql:='DELETE FROM '||'' || c.TABLE_NAME || ''||'WHERE SUB_SUBSIDIARYCODE=&1' ||''||'and TO_CHAR(DATE_FROM_PK, 'DD/MM/YYYY')=&2';
      execute immediate v_sql;
      end loop;
    end;
    thanks,
    tmadugula

    It would be helpful if you provided the actual errors and posted the code using \ tags so it was legible.
    Please see {thread:id=2174552}
    As far as your code, you don't need the semi-colon in the SELECT statement. Second, you should consider using bind variables in your code because it will prevent SQL injection attacks as well as make it easier to read/maintain your code. Also, instead of converting the DATE_FROM_PK to a character data type, consider converting your input value to a DATE data type.
    This should work (not tested), in versions 10.2 and up:DECLARE
    v_sql varchar2(1024);
    v_date_filter VARCHAR2(10);
    v_subsidiary_code_filter VARCHAR2(10); -- Correct this data type if incorrect.
    BEGIN
    v_subsidiary_code_filter := q'[&1]';
    v_date_filter := q'[&2]';
    FOR c IN
    SELECT table_name
    FROM user_tables
    WHERE table_name LIKE 'B2M_%'
    AND partitioned = 'YES'
    LOOP
    v_sql:='DELETE FROM '|| DBMS_ASSERT.SQL_OBJECT_NAME(c.TABLE_NAME) || ' WHERE SUB_SUBSIDIARYCODE = :1 ' || ' AND TRUNC(DATE_FROM_PK) = TO_DATE(:2,''MM/DD/YYYY'')';
    EXECUTE IMMEDIATE v_sql USING v_subsidiary_code_filter, v_date_filter;
    END LOOP;
    END;Edited by: Centinul on Mar 11, 2011 8:30 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Simulation interface toolkit: SUB VI not executable error

    Hi;
    I have a real-time application where I model things in Simulink and use Simulation Interface Toolkit to carry out hardware-in-the-loop simulations. As a real-time target, I am using NI-PXI8106 with NI-PXI6251 DAQ card on it. Up until now, I was able to run my code just fine. However, for some reason, my vi didn't work today and gave several errors such as:
    SubVI NI_SIT_sitclient.Lvlib:RVE.vi: SubVI is not executable
    Details:The SubVI is not executable. You must fix all error in the subVI before this VI can run.
    SubVI NI_SIT_sit Init Model.vi: SubVI is not executable
    Details:The SubVI is not executable. You must fix all error in the subVI before this VI can run.
    This is just few of many error that I received...In the details section of the error list window, the error statement are usually like the following:
    SUBVI not supported for current target..
    Type not supported in the current target...
    The only thing that changed since the last time I ran this program with success is the IP change of the target machine..However, when I use Measurement and Automation tool, I am able to access my target machine (PXI8106) without a problem...Maybe there are some certain rules for IP settings on the PXI target? ...I can provide the details of my new IP configuration numbers if necessary...
    I also  reinstalled the SIT 5.0 on the target machine but It didn't do the trick. I am wondering if there is anyone out there who can help me out with this problem..
    Thank you so much!
    Kind Regards.

    Hi there,
    I was just wondering if you did manage to solve this problem. I'm a new user and have recently started using the Simulation interface toolkit. I have created my model using Simulink and used the real-time workshop to convert it to a .dll file. I tried to run it on labview and it seems to build it on the realtime target, however as soon as map it to the hardware (using a NI BNC-2111,It's just a bunch of analog inputs and output which I have connected to a voltmeter), a dialog box pops up with the the following error:
    Error 1003 occurred during host VI initialization: SIT_test1.vi >> NI_SIT_sitclient.lvlib:sit Init Model.vi >> NI_SIT_sitclient.lvlib:sit Connect to Target.vi
    <append>=========================
    Simulation Interface Toolkit:  The driver VI (SIT_Test_Driver.vi) is not executable.
    Check the following:
    1) You have not modified the driver VI.
    2) You properly installed SIT and any necessary driver software on the target.
    3) The target has not been locked from Measurement and Automation Explorer.
    Do you want to launch the SIT Connection Manager dialog box and reconfigure the simulation?
    Please look at the JPEG picture attached below to see how the error looks on my monitor.
    Thanks
    Attachments:
    error1.JPG ‏135 KB

  • Loops not in browser

    Trying to load loops into loop browser, garageband says " loops not in garageband format will not be displayed in browser' - this has not happened before.
    aiff files were shown, how to get browser to show aiff loops?
    thanks.
    4bs.

    Hangtime,
    this is all a bit much for me; GB on my laptop (G4 PB ) accepts these loops, and GB on my PB is currently running as should. The problem occured when I copied the song over to my mates G5, so I could ( supposedly ) enjoy the benefits of G5 power and speed. All that happened was a series of errors as the copied song ( which still opens ok on the PB ) such as not finding files etc; From here things got worse as I tried to reload loops and at first it all worked, then loops not recognised, and then finally, loops will not show in browser.
    I have a copy of the song bsck on my PB and it loads runs and sees loops just fine; plus, all the loops load into GB and are seen.
    End state is that I have a prope running GB with all loops on my PB, but my mate now has a non working GB on his G5
    4bs.

Maybe you are looking for