SELECT INTO clause strange problem

Hi all,
I need some help with a very strange select into statement.Select into throws NO DATA exception even if table has data.
I am trying to invoke procedure from BPEL.Inside the procedure,I am trying to get "name' from definitions table.But it always throws Data NOT Found exception.But table has relevant data and i am able to see the data by executing the same query outside the BPEL environment/flow(SQL PLUS).
Also,I kept dummy test table for Debugging purpose and it inserted with temp value '103'.
My procedure looks like below
temp:='103';
INSERT INTO test
VALUES ('Test-1' ||dummy,sysdate);
commit;
SELECT name
INTO p_name
FROM definitions
WHERE id =temp;
Please help me in this regards
Thanks in advance.

Hi Frank,
Thanks for quick response.
My actual query is
dummy:=assume getting_valid_value from BPEL(also same dummy inserting into temp value);
SELECT organization_code
INTO p_warehousename
FROM org_organization_definitions
WHERE .organization_code = dummy;
What are the schemas involved? APPS
(Who owns the table?
Who own the procedure? APPS
Is it defined with "AUTHID CURRENT_USER"? NO IDEA
Who runs it when you get the error? Thru BPEL actually
What runs the same query in SQL*Plus and sees a row?). v*alid value(ALF)*
I checked with low level security query as it returns nothing.
thanks

Similar Messages

  • Why do I have to use SELECT INTO clause in a Stored Proc ?

    Hi,
    I'm new to oracle. I've bought Oracle Database 10g SQL and Oracle Database 10 A beginner's Guide, two books from Oracle press but I can't find any answer for that.
    Why when I'm writing a Stored Procedure with a SELECT statement do I have to use an INTO clause ?? And why when the select returns more than one row do I have to use a cursor ? By the way is this the only way to return more than one row from a stored procedure ?
    Any help will be appreciated.
    Regards.
    S. Nunes

    Sounds like you may have some experience with other databases (SQL Server, maybe?) which allow you to create stored procedures which implicitly return result sets simply by embedding select statements.
    In Oracle, the correct way to do this is using ref cursors.
    See the following link for a good explanation:
    http://osi.oracle.com/~tkyte/ResultSets/index.html

  • MS-SQL - Oracle SELECT INTO conversion problem...

    Under MS-SQL (T-SQL) Select statement is defined as follows:
    SELECT select_list
    [INTO new_table_]
    ^^^^^^^^^^^^^^^^^^^^^
    FROM table_source
    [WHERE search_condition]
    [GROUP BY group_by_expression]
    [HAVING search_condition]
    [ORDER BY order_expression [ASC | DESC] ]
    Q:How under PL/SQL can one redirect sorted (ORDERed BY) results
    from SELECT query to another table.
    Slawek
    null

    I have asked the question because of the following reason:
    I have a large select query that returns rows from a table in
    different sort orders depending on user inputs, and I wonder if
    there is any way to return just the rows between two specified
    positions.
    I figured that I'm going to either create one temporary table
    with all the data (1000 records for example), sort the data in
    the prefered order and use the rownum method to obtain the row
    range (works fine under T-SQL). Other way is to try an inline
    view that return the rownumber. I can then restrict the numer of
    fields, e.g.
    select empid, rowNumber from emp,
    (select empid as id, rownum as rowNumber from emp) x
    where empid = id
    and rowNumber between 2 and 5
    The problem is that under Oracle the subquery is not allowed to
    have an ORDER BY clause (even if it had, rownum reflects row
    numbers before they were sorted) and there is no SELECT into
    TABLE_NAME.
    Michael Malicky (guest) wrote:
    : Slawek (guest) wrote:
    : : Under MS-SQL (T-SQL) Select statement is defined as follows:
    : : SELECT select_list
    : : [INTO new_table_]
    : : ^^^^^^^^^^^^^^^^^^^^^
    : : FROM table_source
    : : [WHERE search_condition]
    : : [GROUP BY group_by_expression]
    : : [HAVING search_condition]
    : : [ORDER BY order_expression [ASC | DESC] ]
    : : Q:How under PL/SQL can one redirect sorted (ORDERed BY)
    results
    : : from SELECT query to another table.
    : : Slawek
    : Order by is irrelevant when creating a new table out of a
    : query, as the rows are NOT stored in any order in a table.
    : The syntax for creating a new table out of an existing one
    : is:
    : CREATE TABLE new_table AS
    : SELECT select_list FROM old_table
    : WHERE ...
    : etc.
    : /mike
    null

  • PLS -00428-- an INTO clause is expected in the SELECT statement

    I dnt know what i'm doing wrong with statement, can you help me please.
    DECLARE start_date DATE:= to_date('01/09/2006' , 'DD-MON-YYYY');
    end_date DATE:= to_date('30/09/2006' , 'DD-MON-YYYY');
    BEGIN
    SELECT t.SEC_SHORT_NAME, t.SEC_ISIN, t.SEC_NO,t.SEC_NAME, t.TRADE_DATE,
    t.PAYMENT_DATE,t.COUNTERPARTY, t.PRICE , t.NOMINAL ,
                        t.TRANSACTION_NO,t.CURRENT_VALUE_PC, t.CURRENT_VALUE_SC, t.PAYMENT_AMOUNT_PC,
                        t.PAYMENT_AMOUNT_SC,
                   ct.AMOUNT , ct.CURRENCY,
              sb.BUSINESS_CLASS_LEVEL_2 ,sb.BUSINESS_CLASS_LEVEL_2_NAME,
              sb.BUSINESS_CLASS_LEVEL_3 ,sb.BUSINESS_CLASS_LEVEL_3_NAME,
              sb.BUSINESS_CLASS_LEVEL_4 ,sb.BUSINESS_CLASS_LEVEL_4_NAME,
    sb.BUSINESS_CLASS_LEVEL_5 ,sb.BUSINESS_CLASS_LEVEL_5_NAME
    from scdat.A_TRANSACTIONS t
    INNER JOIN scdat.A_COSTTAX ct     
         ON ct.TRANS_REF = t.TRANS_REF
    INNER JOIN scdat.A_SECS_BUSINESS_CLASS_TS sb
    ON sb.SEC_REF = t.SEC_REF           
    where t.TRADE_DATE >= to_char(start_date ,'DD-MON-YYYY')
    and t.TRADE_DATE < to_char(end_date ,'DD-MON-YYYY')
    and ct.COST_NAME = 'Broker commission'
    and sb.BUSINESS_CLASS_DEFINITION = 'FTSE';
    END;

    i think you should have placed your SELECT statement in a cursor variables since you
    are using a date range instead of the INTO clause. this is to avoid too many rows error.
    DECLARE
      Cursor c1(pStartDate Date, pEndDate Date) Is
        SELECT t.SEC_SHORT_NAME,
               t.SEC_ISIN,
               t.SEC_NO,
               t.SEC_NAME,
               t.TRADE_DATE,
               t.PAYMENT_DATE,
               t.COUNTERPARTY,
               t.PRICE,
               t.NOMINAL ,
               t.TRANSACTION_NO,
               t.CURRENT_VALUE_PC,
               t.CURRENT_VALUE_SC,
               t.PAYMENT_AMOUNT_PC,
               t.PAYMENT_AMOUNT_SC,
               ct.AMOUNT,
               ct.CURRENCY,
               sb.BUSINESS_CLASS_LEVEL_2,
               sb.BUSINESS_CLASS_LEVEL_2_NAME,
               sb.BUSINESS_CLASS_LEVEL_3,
               sb.BUSINESS_CLASS_LEVEL_3_NAME,
               sb.BUSINESS_CLASS_LEVEL_4,
               sb.BUSINESS_CLASS_LEVEL_4_NAME,
               sb.BUSINESS_CLASS_LEVEL_5,
               sb.BUSINESS_CLASS_LEVEL_5_NAME
          FROM scdat.A_TRANSACTIONS t
               INNER JOIN scdat.A_COSTTAX ct ON ct.TRANS_REF = t.TRANS_REF
               INNER JOIN scdat.A_SECS_BUSINESS_CLASS_TS sb ON sb.SEC_REF = t.SEC_REF
         WHERE t.TRADE_DATE                >= pStartDate
           AND t.TRADE_DATE                 < pEndDate
           AND ct.COST_NAME                 = 'Broker commission'
           AND sb.BUSINESS_CLASS_DEFINITION = 'FTSE';
      start_date     DATE:= to_date('01/09/2006','DD-MON-YYYY');
      end_date       DATE:= to_date('30/09/2006','DD-MON-YYYY');
    BEGIN
      For c1_rec in c1(start_date, end_date) Loop
         dbms_output.put_line('t.SEC_SHORT_NAME: '||t.SEC_SHORT_NAME);
         dbms_output.put_line('t.SEC_ISIN: '||t.SEC_ISIN);
      End Loop;
    END;

  • Where clause in SELECT INTO statement

    Hi,
    I am using multiple conditions in where clause for my SELECT INTO statement as follows.
    SELECT count(DTLA.LOCATION_ID)
    INTO LOCATION_ID_count
    FROM DOC2_MGR.DOC_TYPE_LOB_ASSOC DTLA
    WHERE (DTLA.DOC_TYPE_ID = 'XYZ' AND DTLA.lob_code = 'ABC');
    It considers only first condition and returns the result i.e. DTLA.DOC_TYPE_ID = 'XYZ' only.
    Does select into statement suppose to consider only one condition in where clause???
    Thanks in advance!
    --Sandeep                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I got it resolved. Here is list of things I noted
    1. I was using variable names same as column names. It was mixing up temp variable names with column name on the table, which doesn't make sense as I was referring column names in table.column format
    2. I had mixed few datatypes. Input param was suppose to be number where as I was passing it as Text
    Thanks anyway!
    --Sandeep                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • ERROR INTO clause is expected in SELECT

    Hi experts,
    on executing the following code on Application Express 4.0.2.00.09. I had the error like below.
    declare
    xml_Base_No_Gra_Iva number;
    xml_Base_Imponible NUMBER;
    xml_Base_Imp_Grav NUMBER;
    xml_Monto_Iva NUMBER;
    xml_Valor_Ret_Iva NUMBER;
    xml_Valor_Ret_Renta NUMBER;
    xml_Tpld_Cliente VARCHAR2(2);
    xml_Id_Cliente VARCHAR2(13);
    xml_Tipo_Comprobante VARCHAR2(2);
    xml_Numero_Comprobantes NUMBER;
    xml_Id_Informante VARCHAR2(19);
    begin
    select c."Tpld_Cliente" as xml_Tpld_Cliente,
    c."Id_Cliente" as xml_Id_Cliente,
    c."Tipo_Comprobante" as xml_Tipo_Comprobante,
    sum(c."Numero_Comprobantes") as xml_Numero_Comprobantes,
    sum(c."Base_No_Gra_Iva") as xml_Base_No_Gra_Iva,
    sum(c."Base_Imponible") as xml_Base_Imponible,
    sum(c."Base_Imp_Grav") as xml_Base_Imp_Grav,
    sum(c."Monto_Iva") as xml_Monto_Iva,
    sum(c."Valor_Ret_Iva") as xml_Valor_Ret_Iva,
    sum(c."Valor_Ret_Renta") as xml_Valor_Ret_Renta,
    c."Id_Informante" as xml_Id_Informante
    from "xml_VentasD" b
    INNER JOIN "xml_Informante" a ON (b."Id_Informante" = a."Id_Informante")
    INNER JOIN "xml_VentasD" c ON (c."Id_Informante" = b."Id_Informante"
    and c."Id_VentasD" = b."Id_VentasD"
    and c."Tpld_Cliente" = b."Tpld_Cliente"
    and c."Id_Cliente" = b."Id_Cliente")
    where a."Ruc" =:P12_RUC
    and a."Anio" =:P12_ANIO
    and a."Mes" =:P12_MES
    group by c."Tpld_Cliente", c."Id_Cliente", c."Tipo_Comprobante", c."Id_Informante"
    order by c."Tpld_Cliente", c."Id_Cliente";
    end;
    ORA-06550: line 17, column 8: PLS-00428: an INTO clause is expected in this SELECT statement
    Please can you help me?

    you declared INTO variables but not using it ...
    /* Formatted on 5/2/2013 6:58:55 PM (QP5 v5.185.11230.41888) */
    DECLARE
       xml_Base_No_Gra_Iva       NUMBER;
       xml_Base_Imponible        NUMBER;
       xml_Base_Imp_Grav         NUMBER;
       xml_Monto_Iva             NUMBER;
       xml_Valor_Ret_Iva         NUMBER;
       xml_Valor_Ret_Renta       NUMBER;
       xml_Tpld_Cliente          VARCHAR2 (2);
       xml_Id_Cliente            VARCHAR2 (13);
       xml_Tipo_Comprobante      VARCHAR2 (2);
       xml_Numero_Comprobantes   NUMBER;
       xml_Id_Informante         VARCHAR2 (19);
    BEGIN
         SELECT c."Tpld_Cliente",
                c."Id_Cliente",
                c."Tipo_Comprobante",
                SUM (c."Numero_Comprobantes"),
                SUM (c."Base_No_Gra_Iva"),
                SUM (c."Base_Imponible"),
                SUM (c."Base_Imp_Grav"),
                SUM (c."Monto_Iva"),
                SUM (c."Valor_Ret_Iva"),
                SUM (c."Valor_Ret_Renta"),
                c."Id_Informante"
           INTO xml_Tpld_Cliente,
                xml_Id_Cliente,
                xml_Tipo_Comprobante,
                xml_Numero_Comprobantes,
                xml_Base_No_Gra_Iva,
                xml_Base_Imponible,
                xml_Base_Imp_Grav,
                xml_Monto_Iva,
                xml_Valor_Ret_Iva,
                xml_Valor_Ret_Renta,
                xml_Id_Informante
           FROM "xml_VentasD" b
                INNER JOIN "xml_Informante" a
                   ON (b."Id_Informante" = a."Id_Informante")
                INNER JOIN "xml_VentasD" c
                   ON (    c."Id_Informante" = b."Id_Informante"
                       AND c."Id_VentasD" = b."Id_VentasD"
                       AND c."Tpld_Cliente" = b."Tpld_Cliente"
                       AND c."Id_Cliente" = b."Id_Cliente")
          WHERE a."Ruc" = :P12_RUC AND a."Anio" = :P12_ANIO AND a."Mes" = :P12_MES
       GROUP BY c."Tpld_Cliente",
                c."Id_Cliente",
                c."Tipo_Comprobante",
                c."Id_Informante"
       ORDER BY c."Tpld_Cliente", c."Id_Cliente";
    END;http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/selectinto_statement.htm

  • Problem with a stored procedure (Error(4,1): PLS-00428: an INTO clause..)

    Dear Oracle Experts,
    I try to use the stored procedure below but get this error :
    "Error(4,1): PLS-00428: an INTO clause is expected in this SELECT statement"
    I don't have any clue what could be wrong with my syntax. INTO wouldn't make any sense at this task.
    Does someone of you know what's wrong with my Procedure ?
    Hope someone can help,
    best regards,
    Daniel Wetzler
    create or replace PROCEDURE AnalysisCompatibility (DATEBEGIN timestamp, DATEEND timestamp)
    AS
    BEGIN
    select Fs.*,Vs.Analysispriority,Vs.Compatibility Compatibility from SigFacts Fs
    inner Join Variables Vs On
    (Fs.Var_Ref=Vs.Var_Ref and Fs.Machines_Ref=Vs.Machines_Ref )
    where Fs.DT between DATEBEGIN and DATEEND
    and
    Vs.AnalysisPriority > 0
    or
    VS.Compatibility in (6,7,8,9,10,11,13,21,22)
    order by Fs.DT,Fs.Machines_Ref desc, Vs.AnalysisPriority;
    END AnalysisCompatibility;

    I have created a table (ATREPORT.TEST) that has has got the same column name and type of the query output and i still get error message
    PLS-00403 -- statement ATreport.TESt cannot be used as an into target, pls help
    DECLARE start_date DATE := to_date('01/09/2006' , 'DD-MON-YYYY');
    end_date DATE := to_date('30/09/2006' , 'DD-MON-YYYY');
    BEGIN
    SELECT t.SEC_SHORT_NAME, t.SEC_ISIN, t.SEC_NO,t.SEC_NAME, t.TRADE_DATE,
    t.PAYMENT_DATE,t.COUNTERPARTY, t.PRICE , t.NOMINAL ,
                        t.TRANSACTION_NO,t.CURRENT_VALUE_PC, t.CURRENT_VALUE_SC, t.PAYMENT_AMOUNT_PC,
                        t.PAYMENT_AMOUNT_SC,
                   ct.AMOUNT , ct.CURRENCY,
              sb.BUSINESS_CLASS_LEVEL_2 ,sb.BUSINESS_CLASS_LEVEL_2_NAME,
              sb.BUSINESS_CLASS_LEVEL_3 ,sb.BUSINESS_CLASS_LEVEL_3_NAME,
              sb.BUSINESS_CLASS_LEVEL_4 ,sb.BUSINESS_CLASS_LEVEL_4_NAME,
    sb.BUSINESS_CLASS_LEVEL_5 ,sb.BUSINESS_CLASS_LEVEL_5_NAME
    INTO ATREPORT.TEST
    from scdat.A_TRANSACTIONS t
    INNER JOIN scdat.A_COSTTAX ct     
         ON ct.TRANS_REF = t.TRANS_REF
    INNER JOIN scdat.A_SECS_BUSINESS_CLASS_TS sb
    ON sb.SEC_REF = t.SEC_REF           
    where t.TRADE_DATE >= to_char(start_date ,'DD-MON-YYYY')
    and t.TRADE_DATE < to_char(end_date ,'DD-MON-YYYY')
    and ct.COST_NAME = 'Broker commission'
    and sb.BUSINESS_CLASS_DEFINITION = 'FTSE';
    END;

  • INTO clause expected in SELECT statement

    Hi all,
    I have this pl sql code that errors out:an INTO clause is expected in this SELECT statement.
    Code
    Declare
    prev_col1 FLOAT(10) := 0;
    temp3 temp2%rowtype;
    Begin
    select * from
    select col1, col2, col3,
    lag(col1,1,0) over(order by rownum) prev_col1
    from temp2 where <conditions here> order by col2
    where col1- prev_col1 > 10000 and col1>0 and prev_col1>0;
    End;
    I have tried in vain to use select into, with both the select statements(separately). Please advise.
    Basically, I am comparing a field with the previous field and identifying faulty fields. Then I want to replace the faulty field with the previous field.

    I have tried this in vain:
    Declare
    prev_col1 FLOAT(10) := 0;
    v_col1 temp2.col1%type;
    v_col2 temp2.col2%type;
    v_col3 temp2.col3%type;
    Begin
    select col1, col2, col3, prev_col1 into v_col1, v_col2, v_col3, prev_col1 from
    select col1, col2, col3,
    lag(col1,1,0) over(order by rownum) prev_col1
    from temp2 order by col3
    where col1- prev_col1 > 10000 and prev_col1 > 0;
    UPDATE temp2 SET col1= prev_col1 WHERE (col1- prev_col1 > 10000 and prev_col1 > 0);
    End;
    I am only able to update the declared variable:v_col1. How do I update the original value in table temp2?

  • SELECT * INTO Problem

    I need help, please. I'm trying this basic statement to create a backup copy of the hr.employees table.
    SELECT * INTO employees_Backup FROM employees
    Which I copied from examples on the internet (two sources, same syntax)
    When I run this in SQL Developer, I get the following:
    ORA-00905: missing keyword
    00905. 00000 - "missing keyword"
    *Cause:   
    *Action:
    Error at Line: 1 Column: 14

    Hi,
    Houffle wrote:
    ... Now, if I can just learn to format my code when I post.This site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Short code causes a strange problem - About the list again -- please read!

    Hi again people. Maybe you remember my project - has a list, that you can search thru using a text field. During the work I got stuck on a strange problem ( Again :-( ) My app has one text field, one combo box, one list and a text field once more. The code should do the following ->
    *1. Load the list, no problem with that.*
    *2. Show the elements of the list, that match the selected group in the combo box,no problem.*
    *3. Search thru the list using the text field,no problem.*
    4. When the user selects an element from the list, it should display its info in the second text field. This also works fine, but when after looking at info of one of the elements the things on numbers 2 and 3 ( look up! ) stop working. I must say that everything works fine until user selects an element from the list. I couldnt understand this kind of behavior so I am asking you to help me please.
    The code is very simple:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    class the_window extends JFrame implements DocumentListener, ItemListener, ListSelectionListener {
        FileReader reader;
        String data_base[][];
        String first_pass[];
        int number_of_elements;
        DefaultListModel dflm = new DefaultListModel();
        JList list;
        JTextField text_field = new JTextField();
        JTextField info_field = new JTextField();
        String groups[] = {"1. group" , "2. group"};
        JComboBox groups_cmbx = new JComboBox(groups);
        the_window(){
            super("the Window!");
            JPanel panel = new JPanel(null);
            Container c = this.getContentPane();
            c.add(panel);
            text_field.setBounds(10,10,170,25);
            text_field.getDocument().addDocumentListener(this);
            panel.add(text_field);
            groups_cmbx.setBounds(10,45,170,25);
            groups_cmbx.addItemListener(this);
            panel.add(groups_cmbx);
            list = new JList(dflm);
            list.setBounds(10,90,170,190);
            list.setFixedCellHeight(20);
            list.addListSelectionListener(this);
            panel.add(list);
            info_field.setBounds(10,280,170,25);
            panel.add(info_field);
            load_the_base();
            refresh();
            this.setSize(190,350);
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            this.setResizable(false);
            this.setVisible(true);
        public void itemStateChanged(ItemEvent e){
            refresh();
        public void valueChanged(ListSelectionEvent e){
            String str = (String) dflm.getElementAt(list.getSelectedIndex());
            int index = 0;
            for(int i = 0; i < number_of_elements; i++){
                if(str.equals(data_base[0])){
    index = i;
    break;
    info_field.setText(data_base[index][1]);
    private void load_the_base(){
    String data = "";
    try{
    reader = new FileReader("data.txt";);
    int r = 0;
    while((r = reader.read()) != -1){
    char c = (char) r;
    data += c;
    reader.close();
    }catch(IOException e){}
    first_pass = data.split(";");
    number_of_elements = first_pass.length;
    data_base = new String[number_of_elements][];
    for(int i = 0; i<number_of_elements; i++){
    data_base[i] = first_pass[i].split("#");
    private void refresh(){
    String search_str = text_field.getText();
    int selektovano = groups_cmbx.getSelectedIndex();
    dflm.clear();
    for(int i = 0; i < number_of_elements; i++){
    int grupa = Integer.parseInt(data_base[i][2]);
    if(grupa == selektovano){
    String at_the_moment = data_base[i][0]; // if you change this to String at_the_moment = data_base[i][1]; it works perfectly
    if(at_the_moment.startsWith(search_str)){
    dflm.addElement(at_the_moment);
    public void changedUpdate(DocumentEvent e){
    refresh();
    public void removeUpdate(DocumentEvent e){
    refresh();
    public void insertUpdate(DocumentEvent e){
    refresh();
    public class Main {
    public static void main(String[] args) {
    JFrame f = new the_window();
    Now, can you please tell me whats wrong with this?
    For the "data.txt" make a new text file using *notepad* and copy the following line into the document:
    _1. element#1. info#0;2. element#2. info#0;3. element#3. info#1;4. element#4. info#1;5. element#5. info#1;_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Darryl.Burke wrote:
    Keith, thanks for making that readable. So here's the diagnosis -
    In the refresh() method, calling defaultListModel.clear() results in a valueChanged(...) event in which this method calldefaultListModel.getElementAt(list.getSelectedIndex())results in the exception noted, as getSelectedIndex returns -1, the list being empty... you can't getElementAt(-1).
    I haven't analyzed all the code nor checked whether is now works as desired, but this small change to valueChanged counters the exception being thrown.   public void valueChanged(ListSelectionEvent e) {
    infoField.setText(""); // do this unconditionally
    if (list.getSelectedIndex() != -1) {
    String value = (String)defaultListModel.getElementAt(list.getSelectedIndex());
    for(int i = 0; i < numFields; i++){
    if(value.equals(matrix[0])){
    infoField.setText(matrix[i][1]);
    break;
    db
    Yea! You were right! I didnt think that calling *list_model.clear();* will result in calling *valueChanged()* ........
    That was some *clear()* thinking :-) Thank you!
    corlettk wrote:
    I cleaned up some variable & method names (tut tut), imports (very naighty), and some thread stuff... but it remains fundamentally the same codeIs it so important to "clean" the imports? How much does it slow down the loading time? Should I do this on all my projects, because they are all "very naighty"?
    ps. Thanks to all that gave some help to answering this strange question :-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Dynamic SELECT conditions in background - problem

    Hello,
    I faced a strange problem. I have function module which uses dynamic conditions in SELECT statement. Everything works fine in foreground processing, but in background the function gives no values. You can find a piece of code below. It's a bit long but as mentioned - works fine in foreground, so seems to be non-coding error...   I'd be thankful for any ideas...
    data: itwa_where_cond(72) occurs 20 with header line,
           wa_where_cond(72) type c,
      clear: itwa_where_cond[], itwa_where_cond.
      move 'BZOBJ  = ''0''' to wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate 'AND KADKY >= ''' l_date_start '''' into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate 'AND KADKY <= ''' l_date_end '''' into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate 'AND MATNR = ''' wa_matwrk-matnr '''' into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate 'AND WERKS = ''' wa_matwrk-werks '''' into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate 'AND KOKRS  = ''' pi_kokrs '''' into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      if not pi_freig is initial.
        clear wa_where_cond.
        concatenate  'AND FREIG =''' pi_freig '''' into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_tvers is initial.
        clear wa_where_cond.
        concatenate  'AND TVERS = ''' pi_tvers '''' into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_klvar is initial.
        clear wa_where_cond.
        concatenate  'AND KLVAR = ''' pi_klvar '''' into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_feh_sta is initial.
        clear wa_where_cond.
        concatenate  'AND FEH_STA = ''' pi_feh_sta '''' into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_kkzma is initial.
        clear wa_where_cond.
        concatenate  ' AND KKZMA = ''' pi_kkzma '''' into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      SELECT * FROM  KEKO into corresponding fields of table it_keko
                                             WHERE  (itwa_where_cond).  
    Regards,
    Grzegorz

    hI,
    TAKE THIS CODE... HOPE IT WORKS FOR YOU....
    clear: itwa_where_cond[], itwa_where_cond.
      move `BZOBJ  = '0'` to wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate `AND KADKY >= '` l_date_start `'`  into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate `AND KADKY <= '` l_date_end `'` into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate `AND MATNR = '` wa_matwrk-matnr `'` into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate `AND WERKS = '` wa_matwrk-werks `'` into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      clear wa_where_cond.
      concatenate `AND KOKRS  = '` pi_kokrs `'` into wa_where_cond.
      append wa_where_cond to itwa_where_cond.
      if not pi_freig is initial.
        clear wa_where_cond.
        concatenate  `AND FREIG = '` pi_freig `'` into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_tvers is initial.
        clear wa_where_cond.
        concatenate  `AND TVERS = '` pi_tvers `'` into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_klvar is initial.
        clear wa_where_cond.
        concatenate  `AND KLVAR = '` pi_klvar `'` into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_feh_sta is initial.
        clear wa_where_cond.
        concatenate  `AND FEH_STA = '` pi_feh_sta `'` into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      if not pi_kkzma is initial.
        clear wa_where_cond.
        concatenate  `AND KKZMA = '` pi_kkzma `'` into wa_where_cond.
        append wa_where_cond to itwa_where_cond.
      endif.
      SELECT * FROM  KEKO into corresponding fields of table it_keko
                                             WHERE  (itwa_where_cond).
    REGARDS
    SIDDARTH

  • Strange problem while clearing a customer

    Hi everybody
    I am encountering this strange problem while trying to clear some open items for certain customers. Though these customers have open items on them (checked in BSID and FBL5N), the system is giving a warning message saying that there are no open items on the customers while trying F-30 and F-32.
    The only thing that was different for these customers from the rest was that these customers had some transactions which were supposed to be cleared through AP payment run. (transactions for customer payment).
    Can anybody explain why the system was not considering these line items as open while accessing F-30 and F-32??

    Hi,
    - check SAP Note 136754
    some table fields in the missing documents using Transaction SE16. The following conditions must exist:
    BSIS-XOPVW = X      (Indicator: Open item management, only for G/L                     accounts)
    BSEG-XOPVW = X      (Indicator: Open item management)
    BSEG-AUGBL = space  (clearing document number)
    BSEG-DISBN = space  (discount document number)
    BKPF-BSTAT = space  (document status)
    BKPF-XSTOV = space  (indicator reversal flag)
    REGUS/REGUP -> see below
    Should one or more conditions not exist, please note the following information:
    1. BSEG-XOPVW <> X or BSIS-XOPVW <> X for G/L account line items:
                  The line item presumably comes from a time before you activated the open item management of a G/L account. Documents before this master record change do not contain this technical information. Use report RFSEPA02 if you want to bring the documents in line with the new master record. You must refer to the documentation of this report.
                  Because there may be problems subsequently acivating open item management, RFSEPA02 was changed as of Release 4.5A so that it cannot be started without modifications. SAP wants to make sure you are familiar with the problems, which may result from activating open item management. You can however restart RFSEPA02 when you have deactivated the line:
                  leave program.
    2. BSEG-XOPVW <> X for open item account line items:
                  This data status is not allowed. Contact the SAP Hotline.
    3. BSEG-DISBN <> space.
                  The line item has already been used within bill of exchange accounting.
    4. BKPF-BSTAT <> space.
                  This is a document with a special function, for example a sample document or recurring entry document. Generally these are not taken into account in clearing transactions.
    5. BKPF-XSTOV <> space.
                  The document was flagged for reversal. Only if you cancel the reversal flag, can you clear the document again. You can do this by removing the planned date for the reverse posting (BKPF-STODT) in the document header using Transaction FB02 (Change document).
    6. REGUS/REGUP:
                  Look at table REGUS using Transaction SE16. Enter the account (KONKO) in the selection screen. If you selected an entry, use the information Run date (LAUFD) and Identification (LAUFI) in Transaction F110 (payment program). Check the status of the payment run. If only the proposal was carried out, the documents proposed for payment are blocked for other clearing transactions. It is only when you delete the proposal run that the items are taken into account again in the clearing transaction.
    Rgds.

  • Strange problem in PS CS4 32-bit only

    I'm having a rather odd problem and haven't been able to find any discussions of something similar. I'm running Windows Vista Ultimate 64 SP1. I have both the 32- and 64-bit versions of PS CS4 installed with the latest updates.
    64-bit PS works like a champ. I love it. Were it not for a variety of plug-ins I use which are not yet 64-bit enabled, I would never use the 32-bit version of PS. However...
    When running 32-bit PS, the program acts as though I have some key or mouse button either pressed or like I'm repeatedly pressing a key. Sort of. It doesn't try to do something on its own - that is, if I open a file and sit here doing nothing, PS won't do anything on its own. I will, though, see the cursor flashing oddly.
    If I attempt to do anything, I end up fighting with the "phantom" keys. Sometimes, I need to press a key several times before it reacts. Often, I'll get warning sounds like you hear when you press a wrong key for a particular state. Certain actions won't hold sufficiently long to let me do something. I just ran into a stubborn problem like this. If I click the crop tool, I cannot type into the width, height, or resolution boxes on the tool bar. I can click there, see a vertical cursor appear for an instant, then it's gone.
    This is driving me nuts. I wish my plug-in vendors would get their acts together and add 64-bit compatibility, but so far only Imaginomic has done so with Noiseware (and I'm grateful to them!).
    Other info: I'm running with a bluetooth mouse and keyboard as well as an Intuous 3 tablet. I have an nVidea GeForce 8600 GT video card. I've tried disabling OpenGL in PS without help. Note again, 64-bit PS works brilliantly with all these. I'm running plug-ins from OnOne (Plugin Suite 4) and Nik (Viveza) as well as Noiseware mentioned above. I tried logging in with my wife's ID to see if any of my settings might be to blame, but it behaves the same with her ID. I'm not sure if this problem showed up with the PS update or if it was there from the start. I'm thinking it did not show this problem when I first upgraded to CS4. I was using CS2 previously, and it's still installed on this computer. It does not exhibit this problem.
    Any ideas or suggestions?
    Tony

    Mylenium - thanks. I also was suspicious of the tablet, but the tablet is not in use when this problem shows up. Nevertheless, I uninstalled the Wacom driver, removed the tablet connection, rebooted, and the problem persists. But, I did get a chance to install a new version of the driver (April 2009).
    Like I said - strange problem. Since it doesn't crash PS, there's not much data. No error message, no stack trace.
    One other tidbit. I still have the crop tool selected. If I load an image and place the cursor over the image window, the cursor changes between the crop cursor and the big white arrow. Back and forth. When it's doing this, if you want to use the selected tool, you have to click right when the tool's cursor is showing, otherwise you get the "bing" noise.

  • After Trigger Select into issue

    CREATE OR REPLACE TRIGGER "TAB2_AI"
    AFTER INSERT ON Table2
    FOR EACH ROW
    DECLARE
    t1ID number;
    t3Seq number;
    BEGIN
    Select t.id INTO t1ID from Table1 t where trim(upper(name)) = trim(upper(:new.NAME))
    SELECT Table3_SEQ.nextval into t3Seq from dual;
    Insert into Table3(ID,t1ID,t2ID,Active,CreatedDate) Values
    (t3Seq,t1ID,:new.ID,1,sysdate)
    EXCEPTION
    when others then
    raise_application_error(-20004,
    'Error occured! New Row ID = ' || :new.ID );
    END TAB2_AI;
    I am writing after Insert Trigger. I have 3 tables. I need to write after Insert on Table2.
    But in my Table 3 i want to insert table1 ID and table2 ID and other info.
    Now getting the table1 ID is giving the problem. Please See below statement. This is causing the problem.
    Select t.id INTO t1ID from Table1 t where and trim(upper(Dname)) = trim(upper(:new.NAME))
    Could you please tell me the work around how to put select into in a trigger? Any suggestions highly appreciated.
    Edited by: Chris90909 on Jan 29, 2010 9:20 AM
    Edited by: Chris90909 on Jan 29, 2010 9:29 AM

    You said
    Please See below statement. This is causing the problem.
    Select t.id INTO t1ID from Table1 t where and trim(upper(Dname)) = trim(upper(:new.NAME))But in your code you are using following query
    Select t.id INTO t1ID from Table1 t where trim(upper(name)) = trim(upper(:new.NAME))These are 2 different queries. In first one , in where clause you are using column name as Dname and the query you are using in your trigger has column name as name in where clause.

  • A strange problem in smart form?

    Hi,
       I met a strange problem in my smart form. When I click "Check" button in each window of each page, system said "Window (my window name) does not fit onto page(height)". Even I create a new page and a new window in it, it still said this error when I click "Check" button in the new window.
       I have tried to enlarge or reduce the window's size, but this error still occured. But I can activate the form correctly. And there is a syntax error in the generated program:
       FORM %EV2.
        LOOP AT INTO .
        CALL FUNCTION 'SSFCOMP_TABLE_ROW_BEGIN'
        EXPORTING I_LINE_TYPE = 'LINE2'
      You can see there's an error in loop statement.
      Could you tell me the reason and how to solve it?
      Thanks a lot!

    hi
    good
    as you have maneioned in your error  you have said that you have created your own window,but the check box as you mentioned which check box that it it is output options tab check box or in the condition tab check box.
    in the general attribute select the secondary window from the dropdown box and output options tab select the page size as you need .
    i hope you will get some output .
    thanks
    mrutyun

Maybe you are looking for

  • Send Form Info To Email Address

    I was wondering if someone could point me in the direction of a tutorial that explains how to build a form that sends the information captured to an email address. Thanks!

  • Is there a limit of characters in the document JavaScripts window?

    Hi, I have several functions with huge arrays of data linked to a button field. All works fine if everything is declared in the document scripts and if the array is not too big. Once I try to insert a very huge array in the document script I receive

  • Retrieving Database Name in PL/SQL

    I want to declare a variable whose value needs to be set to the database name. I don't want to pass it in as a parameter as it's an anonymous block in a unix script. Is there anyway other than assigning the variable "select * from global_name" within

  • Does SAP Business One support unicode  especially Chinese language

    Hi Experts please let me know the options Does SAP Business One support unicode  especially Chinese language Thanks & Regards Krish

  • Just installed DW trial and it says I have one use left?!

    So I've been having troubles getting the CS4 DW trial to work. It would crash at the loading screen. Every other CS4 app works fine. I finally figure out the problem, which was Acer e-Security software. So I uninstall that and reinstall CS4 and unins