Probel while selecting data from table

Hi,
  As per my below code i want to select data from table AFKO  where  PLNBEZ = it_mat-matnr, and  GETRI  IS BLANK , but data is not comingin IT_AFKO
**********************CODE
select AUFNR RSNUM GAMNG PLNBEZ From AFKO into table it_afko for all entries in it_mat
                                                          where PLNBEZ = it_mat-matnr
                                                            and GETRI =  '  '.
regards,
zafar

Hi,
Try below code
select AUFNR RSNUM GAMNG PLNBEZ From AFKO into table it_afko for all entries in it_mat
where PLNBEZ = it_mat-matnr
and GETRI = '00000000'.
Hope you need the records for which GETRI is not updated.
Regards
Vinod

Similar Messages

  • Error while selecting date from external table

    Hello all,
    I am getting the follwing error while selecting data from external table. Any idea why?
    SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
      2        SE_CUST_ID NUMBER(38),
      3        SE_TRAN_AMT_LCY FLOAT(126),
      4        SE_REVERSAL_MARKER VARCHAR2(255))
      5  ORGANIZATION EXTERNAL (
      6    TYPE ORACLE_LOADER
      7    DEFAULT DIRECTORY ext_tables
      8    ACCESS PARAMETERS (
      9      RECORDS DELIMITED BY NEWLINE
    10      FIELDS TERMINATED BY ','
    11      MISSING FIELD VALUES ARE NULL
    12      (
    13        country_code      CHAR(5),
    14        country_name      CHAR(50),
    15        country_language  CHAR(50)
    16      )
    17    )
    18    LOCATION ('SE2.csv')
    19  )
    20  PARALLEL 5
    21  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> select * from se2_ext;
    SQL> select count(*) from se2_ext;
    select count(*) from se2_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04043: table column not found in external source: SE_REF_NO
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

    It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
    HTH -- Mark D Powell --

  • Time Out Dump while extracting data from table CKIS

    Dear Friends,
    I am getting TIme Out dump for the below code, while extracting data from table CKIS.
    Table CKIS doesn't have any Indexes. Please guide me to resolve this.
    Regards,
    Viji.
    form get_keko_ckis.
      SELECT kalnr kalka kadky tvers bwvar matnr werks kokrs
             FROM keko
             INTO TABLE i_keko1
             FOR ALL ENTRIES IN i_final_modify
                 WHERE matnr = i_final_modify-main_f
                   AND werks = p_werks
                   AND kokrs = p_kokrs
                   AND kadat = p_kadat
                   AND bidat = p_bidat
                   AND bwdat = p_bwdat.
      IF sy-subrc = 0.
        SORT i_keko1 BY kalnr kalka kadky tvers bwvar.
        SELECT kalnr kalka kadky tvers bwvar posnr typps kstar
               matnr menge gpreis
               FROM ckis
               INTO TABLE i_ckis_temp
               FOR ALL ENTRIES IN i_keko1
               WHERE kalnr = i_keko1-kalnr
                 AND kalka = i_keko1-kalka
                 AND kadky = i_keko1-kadky
                 AND tvers = i_keko1-tvers
                 AND bwvar = i_keko1-bwvar.
            IF sy-subrc = 0.
              SORT i_ckis_temp BY kalnr kalka kadky tvers bwvar.
              LOOP AT i_ckis_temp INTO wa_ckis_temp.
                wa_ckis-kalnr  = wa_ckis_temp-kalnr.
                wa_ckis-kadky  = wa_ckis_temp-kadky.
                wa_ckis-posnr  = wa_ckis_temp-posnr.
                wa_ckis-typps  = wa_ckis_temp-typps.
                wa_ckis-kstar  = wa_ckis_temp-kstar.
                wa_ckis-matnr1 = wa_ckis_temp-matnr1.
                wa_ckis-menge  = wa_ckis_temp-menge.
                wa_ckis-gpreis = wa_ckis_temp-gpreis.
              CLEAR wa_keko1.
              READ TABLE i_keko1 INTO wa_keko1
                                 WITH KEY kalnr = wa_ckis_temp-kalnr
                                          kalka = wa_ckis_temp-kalka
                                          kadky = wa_ckis_temp-kadky
                                          tvers = wa_ckis_temp-tvers
                                          bwvar = wa_ckis_temp-bwvar
                                          BINARY SEARCH.
                 IF sy-subrc = 0.
                    wa_ckis-matnr = wa_keko1-matnr.
                    wa_ckis-werks = wa_keko1-werks.
                 ENDIF.
                 APPEND wa_ckis TO i_ckis.
                 CLEAR: wa_ckis_temp, wa_ckis.
              ENDLOOP.
            ENDIF.
        REFRESH: i_keko1, i_ckis_temp.
      ENDIF.
    endform.                    " get_keko_ckis

    Hi Try minimising the conditions in where clause
         SELECT fields..... FROM CKIS
         WHERE KALNR = KEKO-KALNR AND
                      KADKY = KEKO-KADKY AND
                      TVERS = KEKO-TVERS AND
                      TYPPS = 'M'.
        after this, deleting unwanted records from internal table as per pending conditions...
    Regds,
    Anil

  • Select data from table not in another table

    Hi,
    I want to select data from table A which is not in table B.
    Currently I am doing:
    select
    snoA,
    nameA,
    dobA
    from A
    where snoA not in
    (select snoB from A, B
    where snoA = snoB
    and nameA = nameB)
    But above is very slow.
    Can I do something like:
    select
    snoA,
    nameA,
    dobA
    from A, B
    where
    EXCLUDE ( snoA = snoB and nameA = nameB)
    Please note that I need the where condition on both the columns.
    any help will be appreciated.
    -- Harvey

    What are the approximate data volumes in A and B?
    What is "very slow"?
    What version of Oracle?
    What is the query plan?
    Without knowing anything about your system, my first thought would be to see if a NOT EXISTS happened to be faster for your data
    SELECT snoA,
           nameA,
           dobA
      FROM a
    WHERE NOT EXISTS (
        SELECT 1
          FROM b
         WHERE a.snoA = b.snoB
           AND a.nameA = b.nameB )Of course, I'm not sure why you are joining A & B in your NOT IN subquery. It would seem like you would just need a correlated subquery, i.e.
    SELECT snoA,
           nameA,
           dobA
      FROM a
    WHERE snoA NOT IN (
        SELECT snoB
          FROM b
         WHERE a.snoA = b.snoB
           AND a.nameA = b.nameB )That should be more efficient than the original query. The NOT EXISTS version may or may not be more efficient than the NOT IN depending on data volumes.
    Justin

  • Can a procedure select data from tables on other schemas?

    Can a procedure select data from tables on other schemas?
    If it is posible, which syntax should I use to identify the tables and schemas on the SELECT query?

    Yes , it is possible..unless the current user has the right privileges on others' db objects schema.
    Now , as regards the syntax....
    1) The more descriptive way is to use the format ... <owner_schema>.<obj_name>.
    2) If you have declared public synonyms of other schema's objects then you can refer to them as just <obj.name>.... but the <owner_schema>.<obj_name> is not wrong.
    3) If the db objects reside on another database you must have declared a db link.... then the syntax is <owner_schema>.<obj_name>@<db_link_name>.
    Regards,
    Simon

  • Select data from table where field is initial

    I have table that has 10 million records.
    I want to select data from this table where certain date field is blank.
    *SELECT * FROM table*
    INTO TABLE internal table
    WHERE PSTNG_DATE = BLANK.
    Does anybody know how to select data from data base table when certain field is blank.
    I cont select all data once and delete which i dont want, the table is big, it will blow up app server.
    thanks in advance,
    Sachin
    Moderator: Pls do not lock the posting instead provide me the link, its disrespecting.

    Respect the forum rules and common sense, and you will be respected.
    "how to select data from a database table when the field is blank" is very basic, and basic questions will be locked, because they have been asked many times and you can find the answer yourself with a little effort. There is nothing disrespectful about it.
    Thread locked.
    Thomas

  • Selecting datas from tables where tbale name is store in a row

    Hi
    I need to select datas from several different table (QE01, QE02, QE06, QEXXetc.).
    The code of the tables I need to select from is store in another table.
    Here's an example:
    In the table JOURNAL, I have several entries:
    01
    06
    21
    31
    These are the codes of the tables I need to select datas from:
    QE01
    QE06
    QE21
    QE31
    I can't use variables in here, how could that be done ?

    Hi,
    This should not be a question on how to query data, but rather on how to store them.
    You did not mention any version, but I suggest you read about partitioning,
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25789/schemaob.htm#CNCPT112
    Could be that especially exchange partition is interesting.
    My guess is that these tables are created on the fly as part of data loads?
    If so, complete that ETL process by exchanging the just loaded data into a partioned table. And your problem of what to query has disappeared.
    Regards
    Peter

  • Program error while accessng data from table

    Hi all,
    In report , while accessing data for Sales order printing for Export, in sales order the NETWR is
    1,070,000 (same as in sales order) but in Cond.table it is diplaying KAWRT and KBETR as
    10,700.00. In program  in select query for VBAK , it is taking the value 10,700.00. could any one tell me what has to be done ?
    Thanks,

    >
    Khushi p wrote:
    > In report , while accessing data for Sales order printing for Export, in sales order the NETWR is
    > 1,070,000 (same as in sales order) but in Cond.table it is diplaying KAWRT and KBETR as
    > 10,700.00. In program  in select query for VBAK , it is taking the value 10,700.00.,
    kwart need not be same that of netwr.netwr is in a way final taxable amount.Provide appropriate condition type  while fetching from KONV .
    Cheers

  • Selecting date from table of type c.

    hi,
    i have a field  in table type c.......the field contain date in fallowing format 02.07.2007 ,if i have to write a select query for that table ,for selecting all entrie between two dates ...how can i do.....
    note : date in the table is of type char.i cant change the table type it is standard.i now the lenght process.please suggest me the short format

    Check if below code can give you some lead:
    PARAMETERS: p_date1 TYPE datum,
                p_date2 TYPE datum.
    DATA: l_date1 TYPE char10,
          l_date2 TYPE char10.
    START-OF-SELECTION.
      CONCATENATE: p_date1+6(2) p_date1+4(2) p_date(4) INTO l_date1
                      SEPARATED BY '.',
                   p_date2+6(2) p_date2+4(2) p_date(4) INTO l_date2
                      SEPARATED BY '.'.
      SELECT <fld1> <fld2> ...
             INTO <itab>
             FROM <table>
             WHERE date bt (l_date1, l_date2)
             AND...

  • How do you select data from tables not in the Properties table list?

    Hi I am new to SAP B1.
    I am amending the production order and wish to add fields from the Bill of Materials table Itt1.  However this table is not in the list of tables for this report.
    1. Do I have to redo the whole report in Crystal or is there a way of using the PLD report?
    2. This table join needs to have 2 fields in the join the father and the child item codes.  How many joins can the PLD report look after?  I assume that Relate to is the first join and next segment is a second join.  Am I right or not as I have been unable to find any reasonable documentation on creating and maintaining PLD reports.
    3. Where can I find information if any on System Variables and what data they represent?
    Thanks
    Chris

    Hi Cris,
    welcome to Sdn forum!
    For question 1, i think you can do this using pld.
    For question 2, to be able to view other tables, you will need to hold the ALT button and press the database table(Properties section on the lower right portion of the PLD screen), you can now view other tables. then to join other tables you will need to RELATE to and Next Segment, you can also find this under Properties and go to Content Tab.
    for question 3, you will need to create a query that will lead you to the exact field name, say for example SELECT Price from POR1, this price is actually variable 81 from purchase order line and the equivalent value is the por1.price..
    Regards,
    Darius Gragasin

  • How to select data from table having date in timestamp

    hi All,
    I have table and having one field date in type (Timestamp(6))
    Date Timestamp(6)
    I want to select the data from this table for yesterday or current date or someother day
    Please let me know the query for the same.
    Regards
    Kumar

    Do you really have a column named "DATE"? That is a reserved word in Oracle-- you cannot (easily) use it as a column name
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engin
    e options
    SQL> create table abc (
      2    date timestamp(6)
      3  );
      date timestamp(6)
    ERROR at line 2:
    ORA-00904: : invalid identifierIt wouldn't be helpful to have a column named DATE either.
    If you have a table ABC and a column TABLE_TIMESTAMP_FIELD, you would simply do as Bruce has suggested
    SELECT *
      FROM abc
    WHERE table_timestamp_field > systimestamp - 1will give you all rows from ABC where TABLE_TIMESTAMP_FIELD is from the last 24 hours. If you want all rows where TABLE_TIMESTAMP_FIELD was some time yesterday
    SELECT *
      FROM abc
    WHERE table_timestamp_field >= trunc(systimestamp - 1)
        AND table_timestamp_field < trunc(systimestamp)Justin

  • Select data from table depending on date range

    i have first table with following data, This is calender for a year
    I have 2nd table , user created period from 1st table
    I want to select acctstartdate from 1st tale which are not within 2nd table period.
    I want to select acctstartdate as jan to aug only. I dont want to select acctstartdate for sept and oct-dec.
    Same with acctenddate. I want to select Jan-aug only
    How to do this ??
    h2007

    Do you mean this?
    SELECT *
    FROM Table1 t1
    WHERE NOT EXISTS (SELECT 1
    FROM Table2
    WHERE ACCTYRID = t1.ACCTYRID
    AND ACCTYR = t1.ACCTYR
    AND (t1.ACCTSTARTDATE BETWEEN ACCTSTARTDATE AND ACCTENDDATE
    OR t1.ACCTENDDATE BETWEEN ACCTSTARTDATE AND ACCTENDDATE
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Select dates from table

    Hello,
    this is my table
    CREATE TABLE TEMP_LEAP
        "DATE_FROM" DATE
      )Data in it is inserted with procedure that takes 2 parameters of date format:
    CREATE OR REPLACE
    PROCEDURE  "T_PROC" (p_dat_from date, p_dat_to date) IS
    BEGIN
    DECLARE
      day       number     := 0;
      st           NUMBER := 0;
    BEGIN
    day := p_dat_to+1 - p_dat_from;
    for p in 1 .. day    
    loop  
       insert into temp_leapp (date_from) values (p_dat_from+st);   
        st := st+1; 
    end loop; 
    commit;
    END;
    END; Now lets fill up the data in table:
    execute T_PROC(TO_DATE('01.01.2010','DD.MM.YYYY'),TO_DATE('17.08.2013','DD.MM.YYYY'));Data is now filled in the table.
    What i want to do is make a select statment that will do the following output data:
    01.01.2010 - 31.12.2011
    01.01.2012 - 31.12.2012
    01.01.2013 - 17.08.2013What i want is get the leap year if there is one. I only need days of the year so dont mind the months.
    I need to check if there is a leap year in given period p_dat_from and p_dat_to.
    If its not then we will get only one record from our select statment and it will be made of values of: p_dat_from - p_dat_to.
    If there is a leap year in our given period we will get folowing statments (example above).
    01.01.2010 - 31.12.2011 <- first date is p_dat_from and second is the last day before leap year
    01.01.2012 - 31.12.2012 <- this is leap year. First date is start of leap year and last date is end of leap year or p_date_to (if it ends in leap year).
    01.01.2013 - 17.08.2013 <- and this is the period after leap year.
    This is a scrap of code i came ou with so far:
    SELECT
    MIN(date_from),
    MAX(date_from)
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) = 0
    union
    SELECT
    MIN(date_from) over (partition by to_char(date_from,'yyyy')),
    MAX(date_from) OVER (PARTITION BY to_char(date_from,'yyyy'))
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) <> 0
    ORDER BY 1,2;Ok thats it. I hope its understandable what i need to do.
    If you got any questions please ask away.
    PS there is all i need to do. Dont bother with questions "what i february is after before etc" i do not care about that. All the other logic is already fixed all i need is what i wrote above.
    Thanks.
    Edited by: BluShadow on 14-Mar-2013 08:24
    fixed code tags

    Here's one way...
    SQL> create table temp_leap(date_from DATE)
      2  /
    Table created.
    SQL>
    SQL> insert into temp_leap
      2  select date '2010-01-01' + rownum - 1
      3  from dual
      4  connect by rownum <= (date '2013-08-17' - date '2010-01-01') + 1
      5  /
    1325 rows created.
    SQL>
    SQL> commit
      2  /
    Commit complete.
    SQL> ed
    Wrote file afiedt.buf
      1  select min(date_from)||' - '||max(date_from)
      2  from
      3        (select date_from
      4              ,sum(leap_yr_switch) over (order by date_from) as leap_yr_switch_cnt
      5        from (
      6              select date_from
      7                    ,case when lag(leap_yr) over (order by date_from) != leap_yr then 1 else 0 end as leap_yr_switch
      8              from (
      9                    select date_from
    10                          ,case when mod(to_number(to_char(date_from,'YYYY')),400) = 0
    11                                 or (    mod(to_number(to_char(date_from,'YYYY')),4) = 0
    12                                     and mod(to_number(to_char(date_from,'YYYY')),100) != 0
    13                                    )
    14                           then 1 else 0 end as leap_yr
    15                    from temp_leap
    16                   )
    17             )
    18       )
    19  group by leap_yr_switch_cnt
    20* order by min(date_from)
    SQL> /
    MIN(DATE_FROM)||'-'||MAX(DATE_FROM)
    01-JAN-2010 00:00:00 - 31-DEC-2011 00:00:00
    01-JAN-2012 00:00:00 - 31-DEC-2012 00:00:00
    01-JAN-2013 00:00:00 - 17-AUG-2013 00:00:00Edited by: BluShadow on 14-Mar-2013 08:51
    slight correction to the leap year calculation, forgot about the 100 yrs not being leap years.

  • Select datas from table in horizontal

    Hi all,
    I have this table PARAPROV where the fields is
    CODI_PROV NOT NULL VARCHAR2(3)
    CODI_REGI NOT NULL VARCHAR2(3)
    CODI_SIGL_PROV NOT NULL VARCHAR2(2)
    And I run this statment
    select codi_sigl_prov SIGLA from paraprov
    where codi_regi = (select codi_regi
    from paraprov where codi_sigl_prov='LT');where the result is
    SIGLA
    FR
    LT
    RI
    RM
    VT
    How can I have as result, one record, like this?
    SIGLA
    FR/LT/RI/RM/VT
    It's possible?
    Thank's a lot
    Paolo from Madrid

    SQL>
    SQL> With t As
      2  (
      3    Select 'FR' col From dual Union All
      4    Select 'LT' From dual Union All
      5    Select 'RI' From dual Union All
      6    Select 'RM' From dual Union All
      7    Select 'VT' From dual
      8  )
      9  Select ltrim(max(SYS_CONNECT_BY_PATH(col,'/')),'/') "Col"
    10  From
    11  (
    12     Select col,
    13           row_number() over (Order By col) As curr,
    14           row_number() over (Order By col) -1 As prev
    15    From t
    16  )
    17  Connect By prev = Prior curr
    18  Start With curr = 1;
    Col
    FR/LT/RI/RM/VT
    SQL>

  • Heterogeneous Connectivity: Error when select data from table

    Hi all,
    I use Heterogeneous Connectivity in Oracle 10g Linux to connect SQL server Database. I use FeeTDS ODBC driver. After configuration, I create database link in Oracle, Database link is active.
    But in SQLplus, I write: select * from all_catalog@DBL; It views all tables and views in sql server database.
    When I write: select * from AA@DBL; It produce error:
    ORA-00942: table or view does not exist
    [Generic Connectivity Using ODBC]Record AA has no fields. Loading failed
    ORA-02063: preceding 2 lines from DBL
    Please help me. Thank you very much!

    I am sorry, i did not go through the entire message of yours
    Does AA exist, does not contain columns, describe the table please.
    Maybe you should not try Select * from ,,,, rather Select specific fields.. Also if in the remote database, the field and tablename are written in lower case you may want to try
    select "field_name" , from "aa" etc
    ammar sajdi

Maybe you are looking for