Query in fetching invoice amount from table EKBE

Hi all,
In my custom report  the invoice amount is taken from the field  ekbe-dmbtr and is displayed wrongly.
For a particular Purchase order the account  assignment table EKKN has only one entry and for the same Purchase order the Purchase order history table EKBE has two entries.
For eg :
Table EKKN
Purchase order       Item               Seq Access number
20900753               000001            01
Table EKBE
Purchase order       Item               Seq Access number   Material Doc Number        Amount(DMBTR)
20900753               000001            01                              5105606685                      500
20900753               000001            99                              5105606685                      500
There is a loop at EKBE within the loop there is a IF condition which checks if
IF EKBE-PO number EQ EKKN-PO number and
EKBE-Item = EKKO-Item and
EKBE-Seq Access Number = EKKN-Seq Access number.
When the above condition is satisfied then the EKBE-DMBTR is added to the o/p field.
ENdloop.
In this case(several account exists for one mat doc,accounting dept use occasionally such cases) since EKKN does not hv seq access number 99 it does not take the second line into consideration so the amount displayed in the output has the value 500 instead of expected value 1000(sum of both the lines 01 and 99)
Can you please offer suggestion on how to solve this issue.I want to know if i can ommit the Seq access number check in the IF condition.In that case i would get the expected result 1000,but will it affect some other functionality.Or is there any other way to solve this.

Hi,
     We cannot say that Seq Access number is unimportant as it depends on the requirements of the client.....
Seq Access  is a number defining the account assignment i. e which account should be posted in a transaction ( see documentation of the data element of seq Access ).
We can omit checking of sequential number . Use read table EKKN instead of IF condition as we can check for multiple values of table EKKN.
Thanks,
Viquar Iqbal

Similar Messages

  • Query Regarding fetching selected records from table

    Hi All,
    I have a table like below:
    NUM1     NUM2     TYPE
    1     2     A
    1     2     S
    2     3     S
    3     4     A
    3     4     S
    4     5     S
    If for a record TYPE='A' then do not select the records for those num1 and num2.
    Eg: for num1=1 and num2=2 there are two records with type='A' and 'S', only records with type 'A' should get selected.
    Output should be like this:
    NUM1     NUM2     TYPE
    1     2     A
    2     3     S
    3     4     A
    4     5     S
    Please anyone could help me in this query.
    Any help would be highly appreciated.
    Thanks & Regards
    Anuj

    Just MIN function will get what you want
    SQL> with t
      2  as
      3  (
      4     select 1 num1, 2 num2, 'A' type from dual union all
      5     select 1, 2, 'S' from dual union all
      6     select 2, 3, 'S' from dual union all
      7     select 3, 4, 'A' from dual union all
      8     select 3, 4, 'S' from dual union all
      9     select 4, 5, 'S' from dual
    10  )
    11  select num1, num2, min(type) type
    12    from t
    13  group by num1,num2
    14  order by num1,num2
    15  /
          NUM1       NUM2 T
             1          2 A
             2          3 S
             3          4 A
             4          5 S

  • Query to conbine 2 lines from table

    Hi all
    I have a problem in constructing sql query to combine 2 lines from table in Oracle 11g database.
    I will explain, i have one table containing call transactions loaded in one table from 2 different sources, one is from IN which is tagged IN and the other from MSC which is tagged MSC. One subscriber call is registered in IN and MSC and loaded in the table. The problem is the data from IN contains the call duration but not contains Cell information. I'm creating datamart to combine the two lines in one lines but i don't know how to do from query.
    Here is an overview if my data:
    Source     Orig     Dest     startdate     cellid     duration
    MSC     550000     220000     15/05/2012 02:03:29     235e     
    IN     550000 220000     15/05/2012 02:03:30          10
    MSC     550000     220000     15/05/2012 02:04:00     235e     
    IN     550000     220000     15/05/2012 02:03:59          15
    MSC     550000     220001     15/05/2012 02:06:18     235f     
    IN     550000     220001     15/05/2012 02:06:18          60
    The line i want to have is for each line of IN source i sjhould have the cellid like below:
    IN     550000     220000     15/05/2012 02:03:30     235e     10
    IN     550000     220000     15/05/2012 02:03:59     235e     15
    IN     550000     220001     15/05/2012 02:06:18     235f     60
    The query should linked by Orig, Dest and date but for some rows there are difference in seconds.
    Please help.
    Lucienot.

    user13513449 wrote:
    Hi
    Thanks for the reply, here below the create table script and some insert data example:
    CREATE TABLE TRANS
    CALLTRANSTYPE NVARCHAR2(6),
    ORIGANI NVARCHAR2(40),
    TERMANI NVARCHAR2(40),
    STARTTIME DATE,
    STOPTIME DATE,
    CELLID NVARCHAR2(10),
    CONNECTSECONDS NUMBER,
    SWITCHCALLCHARGE NUMBER
    0     555283806     222591626     05/15/2012 00:10:04     05/15/2012 00:13:31     03e9:7565     O     207.00     
    Insert into trans values('MSG','555283806','222591626',to_date('05/15/2012 00:10:04','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 00:13:31','mm/dd/yyyy hh24:mi:ss'),'03e9:7565',10,null); ...It looks like there's some mistake at the end of the CREATE TABLE statement and before the first INSERT statement. Is that supposed to be another INSERT statement?
    Test your code and, if necessary, correct it before you post it.
    Is that sample data supposed to produce the results you posted originally?
    If so, explain, step by step, ho9w you get them.
    If not, post the results you want from that smaple data, formatted, between \ tags, as explained in the forum FAQ {message:id=9360002}
    In my orioginal message, I said "ORDER BY" where I meant "GROUP BY".  If you change that, and use your new table and column names, does the query I posted earlier do what you want?  If not, point out where it is wrong, and show how you might get the right results in those places.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • OGG-01038  Cannot fetch required data from table

    hello i have the following error
    OGG-01038 Cannot fetch required data from table SIEBEL.S_EVT_MAIL due to missing key columns.
    here is my extract policy
    EXTRACT ext3
    setenv NLS_LANG=AMERICAN_AMERICA.AL32UTF8
    USERID ggs_owner, PASSWORD *******
    TRANLOGOPTIONS ALTARCHIVELOGDEST primary instance SBPRD1 /oraarch1/SBPRD, ALTARCHIVELOGDEST primary instance SBPRD2 /oraarch2/SBPRD
    FETCHOPTIONS FETCHPKUPDATECOLS
    DBOPTIONS ALLOWUNUSEDCOLUMN
    RMTHOST i**********, MGRPORT 7809
    RMTTRAIL /home/oracle/MIGRATE_SBPRD_ACFS/ggs/dirdat/ss
    DISCARDFILE discard.txt, APPEND
    DDL INCLUDE ALL
    TABLE IT.*;
    TABLE SIEBEL.S_EVT_MAIL,KEYCOLS(ROW_ID);
    TABLE SIEBEL.*;
    TABLE APDBA.*;
    TABLE EXECUTOR.*;
    TABLE FORTHNOVA.*;
    TABLE MIGRATOR.*;
    TABLE REPORTER.*;
    thanks a lot
    Edited by: user1165357 on Nov 24, 2011 1:06 PM
    Edited by: user1165357 on Nov 24, 2011 1:07 PM

    no pk or unique key
    SQL> desc SIEBEL.S_EVT_MAIL
    Name                                      Null?    Type
    ROW_ID                                    NOT NULL VARCHAR2(15 CHAR)
    CREATED                                   NOT NULL DATE
    CREATED_BY                                NOT NULL VARCHAR2(15 CHAR)
    LAST_UPD                                  NOT NULL DATE
    LAST_UPD_BY                               NOT NULL VARCHAR2(15 CHAR)
    MODIFICATION_NUM                          NOT NULL NUMBER(10)
    CONFLICT_ID                               NOT NULL VARCHAR2(15 CHAR)
    PAR_ROW_ID                                NOT NULL VARCHAR2(15 CHAR)
    EMAIL_ATT_FLG                             NOT NULL CHAR(1 CHAR)
    EMAIL_FORWARD_FLG                         NOT NULL CHAR(1 CHAR)
    MSG_MANL_EDTD_FLG                         NOT NULL CHAR(1 CHAR)
    BODY_LANG_ID                                       VARCHAR2(5 CHAR)
    CNTNT_CTG_DB_ID                                    VARCHAR2(15 CHAR)
    EMAIL_BCC_LINE                                     VARCHAR2(2000 CHAR)
    EMAIL_CC_LINE                                      VARCHAR2(2000 CHAR)
    EMAIL_RECIP_ADDR                                   VARCHAR2(250 CHAR)
    EMAIL_RECIP_NAME                                   VARCHAR2(100 CHAR)
    EMAIL_SNDR_ADDR                                    VARCHAR2(250 CHAR)
    EMAIL_SNDR_NAME                                    VARCHAR2(250 CHAR)
    EMAIL_TO_LINE                                      VARCHAR2(2000 CHAR)
    FORMAT_TYPE_CD                                     VARCHAR2(30 CHAR)
    MIME_CHAR_SET                                      VARCHAR2(50 CHAR)
    MSG_NUM                                            VARCHAR2(200 CHAR)
    EMAIL_BODY                                         LONG

  • Problem in fetching invoice data from VBRK table.

    Hi guys,
              I am developing an ABAP program where I have to fetch the invoice data from VBRK and VBRP  based on the PO data or SO data in table LIPS. But I am not been able to link the two tables. Can anyone please suggest what are the PO and SO fields in VBRK or how to get the invoice data from VBRK and VBRP based on the Sales Order or Purchase Order number from LIPS. Thanks in advance.

    example:-
    VBRK &  VBRP
    select b~vbeln
             b~posnr
             a~fkdat
             a~spart
             a~kunag
             a~vkorg
             a~rfbsk
             a~fkart
             a~vtweg
             a~bzirk
             a~kurrf
             a~waerk
             a~knumv  
             b~fkimg    
             b~netwr 
             b~mwsbp 
             b~matnr
             b~arktx 
             b~prodh 
             b~vkgrp 
             b~ktgrm 
             b~aubel 
             b~matnr 
      into corresponding fields of table itab
      from vbrk as a inner join  vbrp as b
    on avbeln = bvbeln
      where a~kunrg in p_cust and
            a~fkdat in p_date and
            a~spart in p_dev and
            a~vkorg in p_vkorg and
            a~vtweg in p_vtweg and
            a~rfbsk in p_rfbsk and
            a~regio in p_regio and
            a~fkart in p_type and
            b~werks in s_werks and
            b~matnr in matnr.

  • Fetching Invoice details from BSEG

    Hi experts,
                    I  fetched  details like BUZEI BUZEI KOART SHKZG MWSKZ DMBTR PSWBT PSWSL HWBAS KTOSL HKONT KUNNR MATNR TXJCD from Bseg . program execute  well in development server but very slow  in production server. Coding is given below , kindly provide solution for this.
    input.
    1.MANDT
    2.BUKRS
    3.VKORG
    4.FKDAT
    First i fetch invoices based on input from vbrk and vbrp table and  passed  in bseg.
    SELECT VBRKMANDT VBRKVBELN VBRKVKORG VBRKFKDAT VBRKBUKRS VBRPGSBER
      INTO TABLE ITAB
      FROM VBRK
      INNER JOIN VBRP ON VBRKVBELN = VBRPVBELN
      WHERE
       VBRK~MANDT IN S_MANDT AND
            VBRK~BUKRS IN S_BUKRS AND
            VBRK~VKORG IN S_VKORG AND
            VBRK~FKDAT IN S_FKDAT.
      RANGES : R_VBELN FOR VBRK-VBELN.
      LOOP AT ITAB.
        R_VBELN-SIGN = 'I'.
        R_VBELN-OPTION = 'EQ'.
        R_VBELN-LOW = ITAB-VBELN.
        APPEND R_VBELN.
      ENDLOOP.
      LOOP AT ITAB.
        ITAB-FYEAR = ITAB-FKDAT+0(4).
        MODIFY ITAB INDEX SY-TABIX.
      ENDLOOP.
      DATA : BELNR LIKE BSEG-BELNR.
      SELECT BELNR GJAHR BUZEI KOART SHKZG MWSKZ DMBTR PSWBT PSWSL HWBAS KTOSL HKONT KUNNR MATNR TXJCD
      FROM BSEG INTO TABLE GTAB FOR ALL ENTRIES IN ITAB
      WHERE BUKRS IN S_BUKRS AND
            BELNR IN R_VBELN AND      
            GJAHR = ITAB-FYEAR .
    Thanks & regards
    G.Vendhan

    Hi Vendhan,
    SELECT VBRK~MANDT VBRK~VBELN VBRK~VKORG VBRK~FKDAT VBRK~BUKRS VBRP~GSBER
    INTO TABLE ITAB
    FROM VBRK
    INNER JOIN VBRP ON VBRK~VBELN = VBRP~VBELN
    WHERE
    VBRK~MANDT IN S_MANDT AND " Not required so comment it...
    VBRK~BUKRS IN S_BUKRS AND
    VBRK~VKORG IN S_VKORG AND
    VBRK~FKDAT IN S_FKDAT.
    RANGES : R_VBELN FOR VBRK-VBELN.
    LOOP AT ITAB.
    R_VBELN-SIGN = 'I'.
    R_VBELN-OPTION = 'EQ'.
    R_VBELN-LOW = ITAB-VBELN.
    APPEND R_VBELN.
    ENDLOOP.
    LOOP AT ITAB.
    ITAB-FYEAR = ITAB-FKDAT+0(4).
    MODIFY ITAB INDEX SY-TABIX.
    ENDLOOP.
    DATA : BELNR LIKE BSEG-BELNR.
    As you are interesed to get the data for the billing document only select data from vbrk only...
    and use that internal table in for all entries with BSEG rather then join of vbrk and vbrp while
    IF ITAB[] IS NOT INITIAL[]. " Check this condition before using For all Entries alwayse...
    SELECT BELNR GJAHR BUZEI KOART SHKZG MWSKZ DMBTR PSWBT PSWSL HWBAS KTOSL HKONT KUNNR MATNR TXJCD
    FROM BSEG INTO TABLE GTAB FOR ALL ENTRIES IN ITAB
    WHERE BUKRS IN S_BUKRS AND
    BELNR IN R_VBELN AND  " Wrong... You are supposed to pass vbrk-VBELN to BSEG-VBELN as BELNR and VBELN are different and contains diff data as well..
    GJAHR = ITAB-FYEAR
    AND KOART =  'D'. " Include it for customers
    ENDIF.
    Also I would like to suggest you if you can use below tables if possible...
    BSAD                           secondary Index for Customers (Cleared Items)
    BSID                             secondary Index for Customers
    So you need to change the logic to get correct data first...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Need full main query to fetch Invoices for RAXINV.rdf

    Hello All,
    Please send me the complete query which fetches the Invoices for RAXINV.rdf.
    In standard query, it consists of lexical parameters. Need query without any lexical parameters.
    Please do the needful.
    Thanks,
    Abdul

    Hello All,
    Can anyone take up this, and share the Main Query which fetches the Invoices in RAXINV.rdf for SELECTED Option.
    this Query involves lot of lexical parameters. I'm not able to get it.
    Please do the needful.
    Thanks.

  • Fetching  an image from table to be displayed in HTML

    I'm making something similar to the [online store Packaged Applications from Oracle.|http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html]
    I have small problem.
    <td rowspan="5" valign="top"><img src="f?p=&APP_ID.:30:0:#IMG#" width="50" height="50"></td>
    This is how the image is fetch from table EBA_OLS_IMAGES in the online store app. The parameter #IMG# is the id of the image, not the blob file.
    So can some one explain to me how this link works.. What the .:30:0: means.

    hi,
    So can some one explain to me how this link works.. What the .:30:0: means.please read the following link to understand deeply syntax of URL in oracle apex
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm#BEIFCDGF
    With Regards,
    Sunil Bhatia

  • SQL Query to get match string from table

    Hi Experts,
    BANNER                                                                         
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production         
    PL/SQL Release 11.1.0.7.0 - Production                                         
    CORE     11.1.0.7.0     Production                                                     
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production                        
    NLSRTL Version 11.1.0.7.0 - Production                                         
    5 rows selected.
    WITH T AS
    SELECT 'JOHN' FIRSTNAME,'PLAYER' LASTNAME FROM DUAL UNION ALL
    SELECT 'MICHEAL','SMITH' LASTNAME FROM DUAL UNION ALL
    SELECT 'SCOTT','MANAGER' LASTNAME FROM DUAL UNION ALL
    SELECT 'FIRST NAME','LAST NAME' LASTNAME FROM DUAL
    )SELECT * FROM T;
    Input String to my Query will be "JOHN NAME SMITH"
    I need to match the input string to provide result based on Firstname OR Lastname from table.
    How can i acheive this?
    Thanks,

    what the problem in constructing??
    you can use something like this....
    declare
    vStrng varchar2(100) := 'JOHN NAME SMITH';
    v_temp varchar2(1000):= 'SELECT  DISTINCT  firstname,lastname FROM employees,
      (SELECT regexp_substr('''||vStrng||''',''[[:alpha:]]+'',1,level) parsedstr
         FROM dual
        CONNECT BY level<=LENGTH(regexp_replace('''||vStrng||''',''[[:alpha:]]'',''''))+1
      ) WHERE instr(firstname,parsedstr)>0 OR instr(lastname,parsedstr)      >0';
    vSQL varchar2(1000):= 'SELECT ENAME,EMPNO,DEPT.DEPTNO FROM EMP,DEPT WHERE EMP.DEPTNO=DEPT.DEPTNO AND (firstname,lastname) in ('||v_temp||')';
    begin
    --rest of your code....
    end;edit: In the same way...you can use any of the above mentioned solutions..
    Ravi Kumar
    Edited by: ravikumar.sv on Apr 6, 2010 4:12 PM

  • Need help for SQL SELECT query to fetch XML records from Oracle tables having CLOB field

    Hello,
    I have a scenario wherein i need to fetch records from several oracle tables having CLOB fields(which is holding XML) and then merge them logically to form a hierarchy XML. All these tables are related with PK-FK relationship. This XML hierarchy is having 'OP' as top-most root node and ‘DE’ as it’s bottom-most node with One-To-Many relationship. Hence, Each OP can have multiple GM, Each GM can have multiple DM and so on.
    Table structures are mentioned below:
    OP:
    Name                             Null                    Type        
    OP_NBR                    NOT NULL      NUMBER(4)    (Primary Key)
    OP_DESC                                        VARCHAR2(50)
    OP_PAYLOD_XML                           CLOB       
    GM:
    Name                          Null                   Type        
    GM_NBR                  NOT NULL       NUMBER(4)    (Primary Key)
    GM_DESC                                       VARCHAR2(40)
    OP_NBR               NOT NULL          NUMBER(4)    (Foreign Key)
    GM_PAYLOD_XML                          CLOB   
    DM:
    Name                          Null                    Type        
    DM_NBR                  NOT NULL         NUMBER(4)    (Primary Key)
    DM_DESC                                         VARCHAR2(40)
    GM_NBR                  NOT NULL         NUMBER(4)    (Foreign Key)
    DM_PAYLOD_XML                            CLOB       
    DE:
    Name                          Null                    Type        
    DE_NBR                     NOT NULL           NUMBER(4)    (Primary Key)
    DE_DESC                   NOT NULL           VARCHAR2(40)
    DM_NBR                    NOT NULL           NUMBER(4)    (Foreign Key)
    DE_PAYLOD_XML                                CLOB    
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    SELECT
    j.op_nbr||'||'||j.op_desc||'||'||j.op_paylod_xml AS op_paylod_xml,
    i.gm_nbr||'||'||i.gm_desc||'||'||i.gm_paylod_xml AS gm_paylod_xml,
    h.dm_nbr||'||'||h.dm_desc||'||'||h.dm_paylod_xml AS dm_paylod_xml,
    g.de_nbr||'||'||g.de_desc||'||'||g.de_paylod_xml AS de_paylod_xml,
    FROM
    DE g, DM h, GM i, OP j
    WHERE
    h.dm_nbr = g.dm_nbr(+) and
    i.gm_nbr = h.gm_nbr(+) and
    j.op_nbr = i.op_nbr(+)
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    I am using above SQL select statement for fetching the XML records and this gives me all related xmls for each entity in a single record(OP, GM, DM. DE). Output of this SQL query is as below:
    Current O/P:
    <resultSet>
         <Record1>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <DM_PAYLOD_XML1>
              <DE_PAYLOD_XML1>
         </Record1>
         <Record2>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML2>
              <DM_PAYLOD_XML2>
              <DE_PAYLOD_XML2>
         </Record2>
         <RecordN>
              <OP_PAYLOD_XMLN>
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XMLN>
         </RecordN>
    </resultSet>
    Now i want to change my SQL query so that i get following output structure:
    <resultSet>
         <Record>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <GM_PAYLOD_XML2> .......
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XML1>
              <DM_PAYLOD_XML2> .......
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XML1>
              <DE_PAYLOD_XML2> .......
              <DE_PAYLOD_XMLN>
         </Record>
         <Record>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML1'>
              <GM_PAYLOD_XML2'> .......
              <GM_PAYLOD_XMLN'>
              <DM_PAYLOD_XML1'>
              <DM_PAYLOD_XML2'> .......
              <DM_PAYLOD_XMLN'>
              <DE_PAYLOD_XML1'>
              <DE_PAYLOD_XML2'> .......
              <DE_PAYLOD_XMLN'>
         </Record>
    <resultSet>
    Appreciate your help in this regard!

    Hi,
    A few questions :
    How's your first query supposed to give you an XML output like you show ?
    Is there something you're not telling us?
    What's the content of, for example, <OP_PAYLOD_XML1> ?
    I don't think it's a good idea to embed the node level in the tag name, it would make much sense to expose that as an attribute.
    What's the db version BTW?

  • Please help..it's Urgent..How to fetch the value from table row from Page

    Hi,
    I have created a table with 2 LOV's , LOV2 is dependent on LOV2.
    Here I can not use the general Dependent LOV concept, as these values are coming from 2 different LookUps.
    I am not able to fetch the user input for LOV1 (from page) .that is why not able to set the where cluse fro 2nd LOVVO.
    I have used this code:
    if ("ViolationCat".equals(lovInputSourceId)) {
    OAMessageLovInputBean msglov =
    (OAMessageLovInputBean)webBean.findChildRecursive("ViolationCat");
    // String p_violation_category = "'"+(String)msglov.getValue(pageContext)+"'";
    String p_violation_category =
    (String)msglov.getValue(pageContext);
    // System.out.println(" p_violation_category =" +
    // p_violation_category);
    String v_violation_category = "";
    //System.out.println("vcat=" + vCat);
    OAViewObject violationVO =
    (OAViewObject)am.findViewObject("SNI_Violation_DtlsVO2");
    Number vcatViolationIdnum =
    (Number)violationVO.getCurrentRow().getAttribute("ViolationId");
    String vcatViolationId = "" + vcatViolationIdnum;
    pageContext.putTransactionValue("vcatViolationId",
    vcatViolationId);
    pageContext.putTransactionValue("p_violation_category",
    p_violation_category);
    String query =
    " SELECT LOOKUP_CODE, \n" + " MEANING, \n" +
    " LOOKUP_TYPE \n" +
    " FROM apps.fnd_lookup_values \n" +
    " WHERE LOOKUP_TYPE ='SNI_VIOLATION_CATEGORY' AND MEANING=?";
    PreparedStatement ps = txn.createPreparedStatement(query, 1);
    try {
    ps.setString(1, p_violation_category);
    ResultSet rs = ps.executeQuery();
    //System.out.println("before while,");
    // rs.next();
    // v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category="+v_violation_category);
    while (rs.next()) {
    //System.out.println("inside while");
    v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category=" +
    // v_violation_category);
    ps.close();
    } //try ends
    catch (Exception e) {
    e.getMessage();
    //System.out.println("in catch.." + e.getMessage());
    OAViewObject subCatVO =
    (OAViewObject)am.findViewObject("SNI_ViolationSubCategoryVO1");
    //System.out.println("get VO before where clause: subCatVO::"+subCatVO.getQuery());
    subCatVO.setWhereClause("LOOKUP_TYPE like '%SNI_VIOL_SUB_CAT_" +
    v_violation_category + "'");
    System.out.println("after set where clause VO: subCat VO::" +
    subCatVO.getQuery());
    subCatVO.executeQuery();
    // System.out.println("query of subCat VO::" +
    // subCatVO.getQuery());
    //End of sub category Validation
    It is working fine only for the 1st row of teh table.
    I have tried to fetch the value using :
    String violationCategory = (String)violationVO.getCurrentRow().getAttribute("ViolationCategory");
    String violationSubcategory = (String)violationVO.getCurrentRow().getAttribute("ViolationSubcategory");
    But it is fetching null value.
    Please tell me how can I able to fetch the values.

    Hi
    in your scenarion,first u have to identify the particular row of table where the changes is being made ,u have to use this code .when u select the lov ,first it will give the row refernce and then u have to catch the lov event
    OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    262
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    thanx
    Pratap

  • Problem with Fetching Million Records from Table COEP into an Internal Tabl

    Hi Everyone ! Hope things are going well.
           Table : COEP has 6 million records.
    I am trying to get records based on certain criteria, that is, there are atleast 5 conditions in the WHERE clause.
    I've noticed it takes about 15 minutes to populate the internal table. How can i improve the performance to less than a minute for a fetch of 500 records from a database set of 6 million?
    Regards,
    Owais...

    The first obvious sugession would be to use the proper indexes. I had a similar Issue with COVP which is a join of COEP and COBK. I got substanstial performance improvement by adding "where LEDNR EQ '00'" in the where clause.
    Here is my select:
              SELECT kokrs
                     belnr
                     buzei
                     ebeln
                     ebelp
                     wkgbtr
                     refbn
                     bukrs
                     gjahr
                FROM covp CLIENT SPECIFIED
                INTO TABLE i_coep
                 FOR ALL ENTRIES IN i_objnr
               WHERE mandt EQ sy-mandt
                 AND lednr EQ '00'
                 AND objnr = i_objnr-objnr
                 AND kokrs = c_conarea.

  • Fetching Null Value from table

    I have a table where I am want to findout the total number of product (count of product) based on the ProdName.
    I have the following table with two columns:
    create table newproduct (prodid integer, prodname varchar(30));
    Insert into newproduct values (100, 'TowerA')
    Insert into newproduct values (160, 'TowerA')
    Insert into newproduct values (170, 'TowerB')
    Insert into newproduct values (120, 'TowerB')
    Insert into newproduct values (140, 'TowerC')
    Insert into newproduct values (180, '')
    So here the query that I trying to use:
    Select Distinct prodname from newproduct;
    Select prodid from newproduct where prodname is null; /* Correct way */
    Select prodid from newproduct where prodname in (''); /* I want result (180) by using this query */
    How can I do it?

    I'm not sure why you're trying to accomplish it that way, but you could try to use NVL to do that.
    You just need to make sure whatever value you input in the NVL is something you won't ever obtain as a real column value.
    Select prodid from newproduct where nvl(prodname, 'NULL VALUE HERE!') in ('NULL VALUE HERE!');Also, for performance reasons, since you're applying a function to the column, it won't be looking up indexes for matches, unless you create a function-based index.
    Nulls are not indexed anyway, but I'm not sure what you're trying to do with this query.

  • Parallel Query - using hints for multiple 'from' tables

    Currently I am running the following (simplified) query:
    INSERT /*+ APPEND */ INTO NEW_TAB (ID)
    SELECT DISTINCT T1.BIG_ID
    FROM   BIG_TAB1 T1, BIG_TAB2 T2
    WHERE  T1.BIG_ID = T2.ID2
    AND    T2.METHOD = 1
    AND    T1.CODE IN ( /*16 codes here*/ );When this migrates to the production platform the DBAs have asked me to code it for parallel processing.
    We implement 4 processors for parallel processing and so usually I would do the following hint between INSERT and INTO;
    /*+ PARALLEL (BIG_TAB1, 4) */As my query here accesses two tables how would I modify this statement to make it run in parallel? Would it be;
    INSERT /*+ PARALLEL (BIG_TAB1, 4) */ /*+ PARALLEL (BIG_TAB2, 4) */ INTO NEW_TAB (ID)
    SELECT DISTINCT T1.BIG_ID?
    Thanks for any help!
    fakelvis

    Ah, brilliant.
    Thank you!
    Also, on a related note, I'm using a query of similar size in a PL/SQL script. This big query is in a cursor and the data selected here is then inserted into another table depending on a few criteria.
    For this to run on parallel, would the parallel hint be placed in the cursor's SELECT query or on the verious INSERTs within the body of the code? I'm assuming it's in the actual SELECT query of the cursor, but just thought I would check as I'm new to hints!
    Thanks again!

  • Dynamic selection screen fetching the value from table fields

    hi gurus,
    i have one table say ztable...and i should create a dynamic selection screen which should populate the selection screen by the table field names.
    example..if i have 3 fields im my table..my selection screen should have three selection option fields..and in future if i add one more field in my table it should automatically create another slection-option in selection screen..
    thanks
    Sudheer

    Do you mean like SE16 works. If so, you should notice that if you  amend the selection fields, the screen program is actually re-generated.
    That is what is happening. A program is being created and re-generated.
    To create a dynamic selection screen in a single program is not possible ( I may be wrong ). If it is possible, then you would have problems in defining selection screen field names and using them.

Maybe you are looking for

  • How-to install mod_jk in base Apache

    I want to install mod_jk in Apache web server in order to forward requests to Tomcat. I tried to follow the instruction on the Apache page (WebserverHowTo) but there are too many gaps in what they say do and the default configuration of Apache on the

  • Document properties aren't syncing up with SharePoint in Record Center Libraries

    In a record center's document/record library, I'm not able to link word document properties with sharepoint item attributes using "Quick Parts" as I can with Document Libraries. Could this be because of a separate issue with how the Record Center han

  • Dual 30-pin adapter

    Does anyone make a cable with the adapter that goes into the bottom of the iPhone on both ends?  I want to hook it up to a music base station but hate having to take it out of the Otter Box each time.

  • 5D Mark III - Underexposed images

    I just got a new 5D Mark III, and it seems to be underexposing images by about a full stop. I've tried all the metering modes, and it doesn't seem to change anything. Anyone else having this problem? Thanks, Jm

  • Oracle In Windows Cluster

    Hi We are having a windows cluster environment? I want to add Oracle to this environment. There are a few issues 1) Could we add Oracle standard edition to windows cluster? Please provide me some document depicting the process to do so. Thanks