Urgent, SELECT statement results in error

hi all, this is very urgent, could you guys have a look at my SELECT statement?
  SELECT vk~kunnr         "customer no
          vk~vbeln         "sales order no
          vk~audat         "date
          vk~vbtyp         "SD DOCUMENT CATEGORY
          vk~knumv         "lwk
          vp~kwmeng        "qty
          vp~matnr         "material no
          vp~posnr         "LINE ITEM
          vd~bstkd         "PURCHASE ORDER NO
*          kv~kwert         "lwk
          FROM  vbak AS vk
          INNER JOIN vbap AS vp
          ON vk~vbeln = vp~vbeln
          INNER JOIN vbkd AS vd
          ON vk~vbeln = vd~vbeln
*          INNER JOIN konv AS kv
*          ON kv~knumv = vk~knumv
          INTO CORRESPONDING FIELDS OF TABLE it_so
          WHERE vk~vkorg IN s_vkorg
          AND vk~audat IN s_date
          AND vk~kunnr IN s_kunnr
          AND vp~matnr IN s_matnr
          AND vd~bstkd IN s_bstkd
          AND vk~vbeln IN s_vbeln
*          AND kv~kschl = 'ZP00'
          AND vk~vbtyp = 'C'.
The commented lines are the new additions that i want to add to the SELECT statement. But when i un-comment them, i get an error while activating my program. Error is as follows:
For pooled tables, cluster tables, and project views, JOIN is not allowed: "KONV".
Is there a way i can go around it?

Hi,
look at this SAP note : 550043
Symptom
KEPM: dump 'MESSAGE_TYPE_X' during automatic planning method execution.
Other terms
KEPM MESSAGE_TYPE_X transform characteristic value
Reason and Prerequisites
This note is related only to cases, if dump 'MESSAGE_TYPE_X' is raising
during execution of planning method, for which is possible to define
transformation of characteristics values i.e. Copy, Forecast, Top-Down
distribution, Ratios and Customer Enhancement.
Dump is raising in case, if there was defined transformation of char.
values in parameter set definition for some characteristic. Later on,
this characteristic was removed from planning level definition but
characteristic wasn't removed from relevant customizing of transform
characteristic values before.
Solution
Please apply attached program correction.
Regards,
GSR.

Similar Messages

  • Dynamic SELECT statement causing CX_SY_DYNAMIC_OSQL_SEMANTICS error.

    Hello Gurus,
    We have a dynamic SELECT statement in our BW Update Rules where the the Selection Fields are populated at run-time and so are the look-up target and also the WHERE clause. The code basically looks like below:
              SELECT (lt_select_flds)
                FROM (lf_tab_name)
                INTO CORRESPONDING FIELDS OF TABLE <lt_data_tab>
                FOR ALL ENTRIES IN <lt_source_data>
                WHERE (lf_where).
    In this instance, we are selecting 5 fields from Customer Master Data and the WHERE condition for this instance of the run is as below:
    WHERE: DIVISION = <lt_source_data>-DIVISION AND DISTR_CHAN = <lt_source_data>-DISTR_CHAN AND SALESORG = <lt_source_data>-SALESORG AND CUST_SALES = <lt_source_data>-SOLD_TO AND OBJVERS = 'A'
    This code was working fine till yesterday when we encountered serious performance problems and the Basis team had to do some changes at the DB level [Oracle]. Ever since, when we execute our data load, we get the CX_SY_DYNAMIC_OSQL_SEMANTICS.
    Is setting changes at the Oracle level cause issues with how the data is being read at the DB. If yes, can you suggest what can we do to this code to get is working correctly [in case Basis can't revert back their changes]?
    Would appreciate any help we can get here.

    You don't understand - this error comes up when we run specific BEx queries.  It was working yesterday, but today it is not.  Our support package did not change from yesterday.  We did not apply any OSSnotes.
    We are however doing pre-prepare on our Prod system.
    The temporary table is used to store SIDs for use in the join.  the table exists in the dictionary, but not at an Oracle level.

  • Group By Select Statement aggregate function error.

    I am using Dreamweaver MX4 and have an ASP web page. I can easily do this in Access 2007 a simple "group by" sum totals statement.
    Why can I not get this to work on a web page? Are the "#" signs messing this up in the Code2 Select Statement?
    How can I get Code2 to work correctly? Code1 works fine. A user enters the customer and a date range on a form and submits request. I get error message in Dreamweaver. You tried to execute a query where the specified expression field3 is not part of an aggregate function
    Code1. This works fine SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #1/2/09# AND Field6 <= #1/30/09#  GROUP BY Field3, Field10
    Code2. I get error message SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #Date1# AND Field6 <= #Date2#  GROUP BY Field3, Field10

    I am using Dreamweaver MX4 and have an ASP web page. I can easily do this in Access 2007 a simple "group by" sum totals statement.
    Why can I not get this to work on a web page? Are the "#" signs messing this up in the Code2 Select Statement?
    How can I get Code2 to work correctly? Code1 works fine. A user enters the customer and a date range on a form and submits request. I get error message in Dreamweaver. You tried to execute a query where the specified expression field3 is not part of an aggregate function
    Code1. This works fine SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #1/2/09# AND Field6 <= #1/30/09#  GROUP BY Field3, Field10
    Code2. I get error message SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #Date1# AND Field6 <= #Date2#  GROUP BY Field3, Field10

  • Why would this select statement give an error?

    *LOOKUP Z_HELPER
    *DIM TGT1 : ACCOUNT="AA_1070100"
    *DIM CATEGORY="ACTUAL"
    *DIM TIME="2011.JAN"
    *ENDLOOKUP
    *SELECT(%TGTDEST2%, "[ID]", TARGETDESTINATION, "[UNIQUEIDENTIFIER]"=LOOKUP(TGT))
    UniqueIdentifier is a property of Targetdestination dimension. Here is the error its giving:
    Validation status of executable file: Failed
    - Unclosed quotation mark after the character string '=LOOKUP(TGT'. in:select [ID] from mbrTARGETDESTINATION where [UNIQUEIDENTIFIER]"=LOOKUP(TGT
    Validation status of syntax: Failed
    - Invalid syntax found; see statements in red

    Nilanjan, I changed TGT to TGT1, still same thing.  Here is the big picture outcome I am trying to achieve.
    Reporting App
    Entity   Costcenter    Shipto   Time          Category  Account    Signed data
    ABC        CO1             USA    2011.jan      Actual     ACT123       200
    So data is coming in like this, the business wants to set up rules such as.....when Costcenter is CO1 AND Shipto is USA AND Entity is ABC....Change the shipto from USA to INDIA. These rules have to be able to be updated by a business user, So I cant hardcode these rules. My manager doesnt want to use Stored procedures, so here is what I did....
    Z_Helper App(Non reporting App)
    Entity Costcenter Shipto   signeddata (other required dimensions are just dummy values)
    ABC     CO1            USA       9
    Now how does 9 get linked to INDIA? I created a new dimension called TARGETDESTINATION. it has ID(which is nothing but shipto country values), and a property called UNIQUEIDENTIFIER. Unique Identifier basically just assigned a unique value to that shiptocountry member row.
    So now I need to write a script logic in reporting app that will look up signed data of 9 in this example, and I was thinking use a select statement to pull INDIA from TARGETDESTINATION dimension.
    Let me know if you have any suggestions. thanks.

  • URGENT :::: Prepared Statement : Invalid Conversion Error

    Hi,
    I have prepared statement to update a database record. It is working fine but sometime it throws follow. SQLException. I checked the data I'm passing to the prepared statement. Everything works fine on the desktop but sometime it throws the foolow. exception on the websphere server.
    Error = SQL ERROR -99999 [IBM][CLI Driver] CLI0102E Invalid conversion. SQLSTATE=07006 In Method = performBulkOperation Of Class = com.bbh.actionworld.bulksql.BulkProcessing
    Its an urgent problem. Could you please help me ?
    thanks in advance.

    Hi
    I am using a prepared statement to insert records into an RDBMS. I am using JDK 1.4.1. I use setTime to set the date fields.
    My statement is
    pstmtAddFC.setTime(15, Time.valueOf("00:00:00"),
    Funcs.getCalendar(mydate));
    Where getCalendar sets the calandar to the date specified in mydate.
    I am using the JDBC:ODBC driver to connect to the database.
    This works fine with Oracle but gives
    java.SQL.Exception: [IBM][CLI Driver] CLI0102E Invalid Conversion. SQL STATE =07006
    Any suggestions? Thanks
    Regards
    Lakshmi

  • Iff statement results in #Error

    This formula results in an error when the first value is true, otherwise it works fine.  If the budget_quanty > 0 then it works just fine. What am I missing? I am trying to calculate the percent of budget to actual.  This is used as an expression
    in a total field.
    Thanks,
    Trish
    =iif(Sum(Fields!BUDGET_QTY.Value) = 0, 1,
    iif(Sum(Fields!ACTUAL_COSTING_QTY.Value) = 0, 0,
    Sum(Fields!ACTUAL_COSTING_QTY.Value) / Sum(Fields!BUDGET_QTY.Value)))
    Trish Leppa

    Are you sure fields have only numeric data?
    can you try this?
    =iif(Not(IsNumeric(Fields!ACTUAL_COSTING_QTY.Value)) Or Not(IsNumeric(Fields!BUDGET_QTY.Value)),Nothing,
    iif(Sum(Fields!ACTUAL_COSTING_QTY.Value) = 0, 0,
    Sum(Fields!ACTUAL_COSTING_QTY.Value) / IIf(Sum(Fields!BUDGET_QTY.Value)=0,1,Sum(Fields!BUDGET_QTY.Value))))
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Passing variable in a select statement

    Everything about this query works except I'm trying to capture the @companyid (which is a variable) into a column in my table via my select statement.
    My error is Invalid column name 'A113', etc.  However it is the A113 I'm trying to insert into the first column of the table SAP_GLsummary
    Can someone fix my syntax so this works.
    -- retrieves a list of gl balances from all companies
    truncate table sap_glsummary
    declare @companyID char(6)
    declare c_company cursor for
    select INTERID from dbo.GP_Interid
    open c_company fetch next from c_company into @companyID
    while @@fetch_status = 0
    begin
    insert into SAP_GLsummary
    exec ('select ' + @companyID + ' , [Year],[Period ID],[Account Number],[Account Description],[Credit Amount],[Debit Amount]
    FROM ' +'cgygp01.'+ @companyID + '.dbo.AccountSummary')
    fetch next from c_company into @companyID
    end
    close c_company
    deallocate c_company

    Try
    - retrieves a list of gl balances from all companies
    truncate table sap_glsummary
    declare @companyID char(6)
    declare c_company cursor for
    select INTERID from dbo.GP_Interid
    open c_company fetch next from c_company into @companyID
    while @@fetch_status = 0
    begin
    insert into SAP_GLsummary (Col1, Col2, ...)
    exec ('select ' + quotename(@companyID,'''') + ' , [Year],[Period ID],[Account Number],[Account Description],[Credit Amount],[Debit Amount]
    FROM ' +'cgygp01.'+ quotename(@companyID) + '.dbo.AccountSummary')
    fetch next from c_company into @companyID
    end
    close c_company
    deallocate c_company
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Snapshot too old ORA-01555 from select statement (discoverer)??

    Hi All
    Am I loosing the plot .. but we have a select statement run from discoverer which is causing the famous snapshot too old error.
    My understanding is that undo is generated from select/insert/update.
    So why is the following discoverer Select statement causing the error?
    from alert
    ORA-01555 caused by SQL statement below (SQL ID: gk0wxgqmx66sh, Query Duration=3866 sec, SCN: 0x001e.089cf3f9):
    SELECT  ( ROUND(( TO_DATE(SYSDATE)-o101038.HIRE_DATE )/365,2) ) as
      "  bla bla
    ORDER BY o101020.SUB_ORGANIZATION_NAME ASC
    Thanks in Advance

    simon.9999 wrote:
    Hi All
    Am I loosing the plot .. but we have a select statement run from discoverer which is causing the famous snapshot too old error.
    My understanding is that undo is generated from select/insert/update.
    So why is the following discoverer Select statement causing the error?
    from alert
    ORA-01555 caused by SQL statement below (SQL ID: gk0wxgqmx66sh, Query Duration=3866 sec, SCN: 0x001e.089cf3f9):
    SELECT  ( ROUND(( TO_DATE(SYSDATE)-o101038.HIRE_DATE )/365,2) ) as
      "  bla bla
    ORDER BY o101020.SUB_ORGANIZATION_NAME ASC
    Thanks in Advance
    The SELECT statement is the victim.
    Some session is doing DML against the same table against which the SELECT occurs & is likely doing COMMIT inside a LOOP.

  • Regarding this select statement

    hi,
    i am not getting value i write like this select statement
    plz check error in this code.
    TABLES: VBAK,
    vbrk.
    TYPES: BEGIN OF TYP_VBAK,
          VBELN TYPE VBELN_VA,
          VBTYP TYPE VBTYP,
          VGBEL TYPE VGBEL,
          END OF TYP_VBAK,
           BEGIN OF TYP_VBRK,
              VBELN TYPE VBELN,
              WAERK TYPE WAERK,
              VKORG TYPE VKORG,
              KNUMV TYPE KNUMV ,
              FKDAT TYPE FKDAT,
              LAND1 TYPE LLAND,
              NETWR TYPE NETWR,
              KUNRG TYPE KUNRG,
              EXNUM TYPE EXNUM,
              MWSBK TYPE MWSBP,
              END OF TYP_VBRK.
    DATA: GT_VBAK TYPE TABLE OF TYP_VBAK,
          IT_VBRK TYPE standard TABLE OF TYP_VBRK WITH HEADER LINE.
         LS_VBRK TYPE TYP_VBRK,
      SELECT VBELN
             WAERK
             VKORG
             KNUMV
             FKDAT
             LAND1
             NETWR
             KUNRG
             EXNUM
             FROM VBRK INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
             WHERE VBELN = '0090060045'.

    Check from SE16 whether vbeln = 0090060045 is present in VBRK or not.
    Regards,
    Joy.

  • Xml parsing error while selecting whole result set for sql query

    Hi All,
    I am having xml parsing error while selecting whole query result set. The data is coming fine for default result set of 50 rows.
    My exception is below.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00234: namespace prefix "xsi" is not declared
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    *31011. 00000 - "XML parsing failed"*
    **Cause: XML parser returned an error while trying to parse the document.*
    **Action: Check if the document to be parsed is valid.*
    My sql query is below that is giving results for default result set of 50 rows.
    select extract(xmlType(clob_xml_colm_name), '//v2:node1//childnode/text()','xmlns:v2="namespace_url"').getStringVal()  from table_name
    My sql developer version is below.
    Java(TM) Platform     1.7.0_04
    Oracle IDE     3.1.07.42
    Versioning Support     3.1.07.42
    My database version is below.
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
    Please could any one help me urgently as the sql query is supposed to be correct as it is returning query results, but the problem happening when i try to select whole result set.
    Thanks and regards,

    What does the XML look like? It appears that some of the supposed XML stored as a CLOB is not really valid XML. Find the row in the table that is causing your issue and review the "XML" in it.

  • How to return the result set of multiple select statements as one result set?

    Hi All,
    I have multiple select statements in my stored procedure that I want to return as one result set 
    for instance 
    select id from tableA
    union 
    select name from table b 
    but union will not work because the result sets datatypes are not identical so how to go about this ?
    Thanks

    You have to CAST or CONVERT (or implicitly convert) the columns to the same datatype.  You must find a datatype that both columns can be converted to without error.  In your example I'm guessing id is an int and name is a varchar or nvarchar. 
    Since you didn't convert the datatypes, SQL will use its data precedence rules and attempt to convert name to an int.  If any row contains a row that has a value in name that cannot be converted to an int, you will get an error.  The solution is
    to force SQL to convert the int to varchar.  So you want something like
    select cast(id as varchar(12)) from tableA
    union
    select name from tableb
    If the datatypes are something other that int or varchar, you must find a compatable datatype and then convert one (or both) of the columns to that datatype.
    Tom

  • Sql Error in Select statement when doing subquery

    Hi,
    I am trying to see what the error is in the subquery part of the select statement.
    Subquery should be fetching the safety_stock_quantity based on the MAX(effectivity_date).
    Any suggestions?
    SELECT kbn.last_update_date,itm.segment1,itm.description,kbn.kanban_card_number,kbn.kanban_size,
                   (SELECT msc.safety_stock_quantity
    FROM mtl_safety_stocks msc
    WHERE msc.effectivity_date = (select MAX(msc2.effectivity_date)
                   from mtl_safety_stocks msc2
                                            where msc2.inventory_item_id = itm.inventory_item_id
                                                 and msc2.organization_id = itm.organization_id)
                   AND msc.inventory_item_id = itm.inventory_item_id
         AND msc.organization_id = itm.organization_id                                        
    FROM mtl_system_items_b itm
    ,mtl_onhand_quantities_detail moqd
              ,mtl_safety_stocks msc
              ,mtl_kanban_card_activity kbn
    WHERE itm.inventory_item_id = kbn.inventory_item_id
    AND itm.organization_id = kbn.organization_id
    AND itm.inventory_item_id = moqd.inventory_item_id
    AND itm.organization_id = moqd.organization_id
    AND moqd.subinventory_code = kbn.source_subinventory
         AND kbn.card_status = 1
         AND kbn.supply_status = 5
         AND msc.inventory_item_id = itm.inventory_item_id
         AND msc.organization_id = itm.organization_id     
    GROUP BY
    kbn.last_update_date,itm.segment1,itm.description,kbn.kanban_card_number,kbn.kanban_size;
    Thanks
    Pravn

    Hi, Pravn,
    Remember the ABC's of GROUP BY:
    When you use a GROUP BY clause and/or an aggregate fucntion, then every item in the SELECT clause must be:
    (A) an <b>A</b>ggregate function,
    (B) one of the "group <b>B</b>y" expressions,
    (C) a <b>C</b>onstant, or
    (D) something that <b>D</b>epends entirely on the above. (For example, if you "GROUP BY TRUNC(dt)", you can "SELECT TO_CHAR (TRUNC(dt), 'Mon-DD')").
    There's a GROUP BY clause in your main query, so every item in the main SELECT clause must be one of the above. The last item, the unnamed scalar sub-query, is none of the above.
    How can you fix this problem? That depends on your data, the results you want, and perhaps on your Oracle version. If you'd like help, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved. Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle you're using.
    You may have noticed that this site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (including, but limited to, actual code) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Performance Tuning 'Runtime Error' on Select statement

    Hi Experts,
    Good Day!
    I would like to ask some help regarding a custom program that will encounter 'Runtime Error' on the below codes on how to perform performance tunning especially number 1.
    1.
    SELECT A~VBELN A~ERDAT A~AUART A~VKORG A~VTWEG A~SPART A~VDATU
             A~KUNNR B~POSNR B~MATNR B~ARKTX B~ABGRU B~KWMENG B~VRKME
             B~WERKS B~VSTEL B~ROUTE
          FROM VBAK AS A INNER JOIN VBAP AS B ON A~VBELN EQ B~VBELN
                         INNER JOIN VBEP AS C ON A~VBELN EQ C~VBELN
                           AND B~POSNR EQ C~POSNR
            INTO CORRESPONDING FIELDS OF TABLE I_DATA_TAB
              WHERE A~VBELN  IN S_VBELN
                AND A~VKORG  IN S_VKORG
                AND A~AUART  IN S_AUART
                AND A~VTWEG  IN S_VTWEG
                AND A~SPART  IN S_SPART
                AND A~VDATU  IN S_VDATU
                AND A~KUNNR  IN S_KUNNRD
                AND B~MATNR  IN S_MATNR
                AND B~KWMENG IN S_KWMENG
                AND B~VRKME  IN S_VRKME
                AND B~WERKS  IN S_WERKS
                AND C~EDATU  IN S_VDATU.
    2.
    SELECT VBELN FROM LIKP INTO LIKP-VBELN
                  WHERE LFDAT IN S_VDATU
                    AND VKORG IN S_VKORG
                    AND LFART EQ 'YSTD'
                    AND KUNNR IN S_KUNNRP
                    AND KUNAG IN S_KUNNRD
        SELECT VBELN POSNR LFIMG MATNR WERKS
           FROM LIPS INTO (LIPS-VBELN, LIPS-POSNR, DISPLAY_TAB-DEL_QTY,
                           LIPS-MATNR, LIPS-WERKS)
                 WHERE VBELN EQ LIKP-VBELN
                   AND MATNR IN S_MATNR
                   AND VTWEG IN S_VTWEG
                   AND SPART IN S_SPART
                   AND WERKS IN S_WERKS.   
         ENDSELECT.
      ENDSELECT.
    4.
    SELECT DELIVERY POSNR MATNR PODLFIMG FROM T9YPODI INTO
        (T9YPODI-DELIVERY, T9YPODI-POSNR, T9YPODI-MATNR, T9YPODI-PODLFIMG)
                           WHERE MATNR   IN S_MATNR
                             AND PODDATE IN S_VDATU.
    Answer's will be a great help.
    ~Thank You,
      Lourd
    Edited by: Lourd06 on Oct 23, 2009 10:32 AM
    Moderator message - Welcome to SCN.
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting. You're in the driver's seat here. It's up to you to do some analysis before expecting that people can halp you. - post locked
    And please use code tags.
    Edited by: Rob Burbank on Oct 23, 2009 9:13 AM

    Hi All,
    We've checked the transaction ST22 it is TIME OUT. I really need your help on this the program will dump in number 1 Select statement. Can you help me perform a performance tunning.
    In transaction ST22
    Runtime Errors         TIME_OUT
    Date and Time          21.10.2009 08:51:33
    Short text
         Time limit exceeded.
    What happened?
         The program "ZV0PSR10" has exceeded the maximum permitted runtime without
         interruption and has therefore been terminated.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    Error analysis
         After a specific time, the program is terminated to make the work area
         available to other users who may be waiting.
         This is to prevent a work area being blocked unnecessarily long by, for
         example:
         - Endless loops (DO, WHILE, ...),
         - Database accesses with a large result set
         - Database accesses without a suitable index (full table scan)
         The maximum runtime of a program is limited by the system profile
         parameter "rdisp/max_wprun_time". The current setting is 1200 seconds. If this
          time limit is
         exceeded, the system attempts to cancel any running SQL statement or
         signals the ABAP processor to stop the running program. Then the system
         waits another 60 seconds maximum. If the program is then still active,
         the work process is restarted.
    ~Thank you
    Lourd
    Edited by: Lourd06 on Oct 23, 2009 11:22 AM
    Edited by: Lourd06 on Oct 23, 2009 11:33 AM

  • Select statement issue--urgent

    Hi All,
    i need information regarding below select statement.
    SELECT ebelp
               ebeln
               vgabe
               SUM( menge ) AS menge
               shkzg
          FROM ekbe
          INTO TABLE t_ekbe
         WHERE ebeln EQ t_documents-ebeln
           AND ebelp EQ t_documents-ebelp
           AND ( vgabe EQ c_1
            OR   vgabe EQ c_2 )
         GROUP by ebelp ebeln vgabe shkzg.
    I am working 4.5b version now.All the data declartion is correct.This select statement goes to Dump .when ever data is selected before the select statment.
    let me any other choices to do same.its urgent.
    Thanks,
    Arnald

    Hi...Arnald..
    Try this way... Runtime error may be bcoz of the Order of fields....
    types : begin of st_ekbe,
                 EBELN TYPE EKBE-EBELN,
                 EBELPTYPE EKBE-EBELP,
                 VGABE TYPE EKBE-VGABE,
                 SHKZG TYPE EKBE-SHKZG,
                 MENGE TYPE EKBE-MENGE,
               end of st_ekbe.
    DATA: T_EKBE TYPE TABLE OF ST_EKBE.
    SELECT
    ebeln
    ebelp
    vgabe
    shkzg
    SUM( menge )
    FROM ekbe
    INTO TABLE t_ekbe
    WHERE ebeln EQ t_documents-ebeln
    AND ebelp EQ t_documents-ebelp
    AND ( vgabe EQ c_1
    OR vgabe EQ c_2 )
    GROUP by  ebeln  ebelp vgabe shkzg.
    <b>Reward if Helpful</b>

  • Getting an ORA-24333 error while parsing a non SELECT statement ...

    Hi,
    I'm new to this forum and I've search through the entire forum to see if my problem was already solved, but at first sight it doesn't ?
    So I hope that someone can help me one this : I'm facing a strange problem with the OCI 8i. I've encapsulated any OCI call into a set of C++ classes. Everything works fine apart for one point : whenever I try to parse a NON "select" statement, I get the ORA-24333 error.
    Basically, the code follow the current schema (only "important" states are written here) :
    -> Opening an Oracle Session
    -> Receving de statement.
    -> Analyse it with a call to OCIStmtPrepare() with OCI_NTV_SYNTAX set.
    -> Calling OCIBindByName() to associate each variable with a data.
    -> Calling OCIStmtExecute() with OCI_DESCRIBE_ONLY set in order to retrieve the current list of INPUT/OUTPUT columns.
    And this is where the problem arise.
    With a statement like : "SELECT MyPackage.MyFunction(:v1) FROM DUAL"
    Everthing works fine. I can bind the INPUT/OUTPUT ":v1" variable.
    But with a statement like : "BEGIN MYFUNTION(:v1); END;"
    I get the ORA-24333 error after the call to OCIStmtExecute().
    I get this error only when I set OCI_DESCRIBE_ONLY. If I call OCIStmtExecute() with OCI_DEFAULT, the OCI execute the statement. This is fine but it's not what I want. I cannot change the statement received (by design), so they should be proceeded as received.
    What I'm looking for is a way to successfully perform the OCIStmtExecute() with OCI_DESCRIBE_ONLY set in order to get the list of variables columns related to the current statement.
    Any help would be greatly apprecitated here. Thanks !
    Here are my current configurations.
    -> Windows 2000 SP5 OCI 8i / VC++ 6.0
    -> Macintosh OS X 10.3.4 / Code Warrior 8.3
    (The code produce exactly the same results/troubles on both plateforms.)
    Thanks in advance for your respons.

    Hi,
    I'm new to this forum and I've search through the entire forum to see if my problem was already solved, but at first sight it doesn't ?
    So I hope that someone can help me one this : I'm facing a strange problem with the OCI 8i. I've encapsulated any OCI call into a set of C++ classes. Everything works fine apart for one point : whenever I try to parse a NON "select" statement, I get the ORA-24333 error.
    Basically, the code follow the current schema (only "important" states are written here) :
    -> Opening an Oracle Session
    -> Receving de statement.
    -> Analyse it with a call to OCIStmtPrepare() with OCI_NTV_SYNTAX set.
    -> Calling OCIBindByName() to associate each variable with a data.
    -> Calling OCIStmtExecute() with OCI_DESCRIBE_ONLY set in order to retrieve the current list of INPUT/OUTPUT columns.
    And this is where the problem arise.
    With a statement like : "SELECT MyPackage.MyFunction(:v1) FROM DUAL"
    Everthing works fine. I can bind the INPUT/OUTPUT ":v1" variable.
    But with a statement like : "BEGIN MYFUNTION(:v1); END;"
    I get the ORA-24333 error after the call to OCIStmtExecute().
    I get this error only when I set OCI_DESCRIBE_ONLY. If I call OCIStmtExecute() with OCI_DEFAULT, the OCI execute the statement. This is fine but it's not what I want. I cannot change the statement received (by design), so they should be proceeded as received.
    What I'm looking for is a way to successfully perform the OCIStmtExecute() with OCI_DESCRIBE_ONLY set in order to get the list of variables columns related to the current statement.
    Any help would be greatly apprecitated here. Thanks !
    Here are my current configurations.
    -> Windows 2000 SP5 OCI 8i / VC++ 6.0
    -> Macintosh OS X 10.3.4 / Code Warrior 8.3
    (The code produce exactly the same results/troubles on both plateforms.)
    Thanks in advance for your respons.

Maybe you are looking for