Problem retreving data from cluster table

Hi friends,
Iam facing a problem while retreving data from a cluster table..
select knumv
          kposn
          krech
          kawrt
          kbetr
          waers
          kpein
          kmein
          kwert
          from konv
          into table gt_konv
          where knumv in s_agnm.
In s_agnm i have 8 entries ie: iam giving manually 8 entries in s_sgnm-low.
If i do the above way iam getting exactly the 82 entries which i have in KONV table.. This is perfect..
But when iam using for all  entries iam getting only 58 records from the KONV table..
ie :
    SELECT KNUMV
           KPOSN
           KRECH
           KAWRT
           KBETR
           WAERS
           WAERS
           KPEIN
           KMEIN
           KWERT
           FROM KONV
           INTO TABLE ITAB1
           FOR ALL ENTRIES IN ITAB
           WHERE KNUMV = ITAB-F1
Here F1 is the field which is same as S_SGNM as above and it also contains same number of records as above
Now when iam running the 2nd select statment iam getting only 58 entries ... instead it should get 82 entries as above...
Can any one tell me how to correct..
Regards
Kumar

even if i use all the key fields , its giving me the same results 58 reocrds, instead it should give me 82.
select knumv
       kposn
       stunr
       zaehk
       from konv
       into table gt_tybh
       where knumv in s_agnm.
  if gt_tybh is not INITIAL.
    sort gt_tybh by agreement_number kposn stunr zaehk.
   select knumv
          kposn
          krech
          kawrt
          kbetr
          waers
          kpein
          kmein
          kwert
          from konv
          into table gt_konv
          for all entries in gt_tybh
          where knumv = gt_tybh-agreement_number and
                kposn = gt_tybh-kposn and
                stunr = gt_tybh-stunr and
                zaehk = gt_tybh-zaehk.
In the above iam getting all the 82 records for the select-options s_sgnm..
later iam trying to get the other fields form the same konv table by using for all entries... here even if iam using all the key fields also its not getting me the total 82 records...
Initially for s_sgnm which contains 8 values , for those 8 values iam getting 82 records it table gt_tybh. But later when iam using for all entries iam not getting those 82 records in the 2nd select statment in the internal table gt_konv.
Why is this happening...
can any one correct it..
Regards
Kumar

Similar Messages

  • Read data from cluster tables

    Hi,
      I met a problem.
      How to read data from cluster tables using:
      b2-key-pernr = 20.
      b2-key-pabrj = 2006.
      b2-key-pabrp = 09.
      b2-key-cltyp = '1'.
      import saldo from database pcl2(b2) id b2-key.
    the problem is that the sy-subrc is always 4, could anyone help me?
    thank you very much!

    Hi,
    Import and export to database is used in two programs and not in the same program.
    <b>ZPROGRAM1.</b>
    tables : indx.
    Data : SALDO type i,
           indxkey LIKE indx-srtfd VALUE 'ZAB1'.
      indx-aedat = sy-datum.
      indx-usera = sy-uname.
      indx-pgmid = sy-repid.
    EXPORT SALDO TO DATABASE indx(zc) ID indxkey.
    In another program,
    <b>ZPROGRAM2.</b>
    tables : indx.
    Data : SALDO type i,
           indxkey LIKE indx-srtfd VALUE 'ZAB1'.
      indx-aedat = sy-datum.
      indx-usera = sy-uname.
      indx-pgmid = sy-repid.
      IMPORT SALDO FROM DATABASE indx(zc) ID indxkey.
    Best regards,
    Prashant

  • How to Extract data from Cluster table  and transperant table

    Hello BW Experts ,
    I want to extract the data from cluster table BSEG and a transperant table BKPF .
    The primary fields are BELNR , GJHAR and BUKRS.
    the fields of table BKPF to extarct is BUDAT and fields of BSEG table is HKONT , BSCHL , ZUONR and POSID.
    I can not create a view over these two tables as BSEG is a Cluster table.
    Please guide me.
    Regadrs ,
    Amol.

    hi Amol,
    take a look Sigg's weblog
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    you can use RSAX_BIW_GET_DATA_SIMPLE as sample, there specified import parameters
    FUNCTION RSAX_BIW_GET_DATA_SIMPLE.
    ""Lokale Schnittstelle:
    *" IMPORTING
    *" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
    *" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *" TABLES
    *" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *" E_T_DATA STRUCTURE SFLIGHT OPTIONAL
    *" EXCEPTIONS
    *" NO_MORE_DATA
    *" ERROR_PASSED_TO_MESS_HANDLER

  • SELECT is taking lot of time to fetch data from cluster table BSET

    <Modified the subject line>
    Hi experts,
    I want to fetch data of some fields from bset table but it is taking a lot of time as the table is cluster table.
    Can you please suggest me any other process to fetch data from cluster table. I am using native sql to fetch data.
    Regards,
    SURYA
    Edited by: Suhas Saha on Jun 29, 2011 1:51 PM

    Hi Subhas,
    As per your suggestion I am now using normal SQL statement to select data from BSET but it is still taking much time.
    My SQL statement is :
    SELECT BELNR
                  GJAHR
                  BUZEI
                  MWSKZ
                  HWBAS
                  KSCHL
                  KNUMH FROM BSET INTO CORRESPONDING FIELDS OF TABLE IT_BSET
                  FOR ALL ENTRIES IN IT_BKPF
                  WHERE BELNR = IT_BKPF-BELNR
                      AND BUKRS = IT_BKPF-BUKRS.
    <Added code tags>
    Can you suggest me anymore?
    Regards,
    SURYA
    Edited by: Suhas Saha on Jun 29, 2011 4:16 PM

  • How to select data from cluster table

    hi experts,
                   I have a report which picks data from bseg (cluster table ) for a month report it is taking around 4 minutes to process.I feel it is not good when take the report after some months.
    how to select data from these table???how to declare itab for these cluster tables????can we include any search condition or any other kind of internal table???
    please advice.
    mani

    Hi Manikandan,
    The following code may be helpful to understand how to select the data from cluster table.
    Types: Begin of ty_kna1,
    Kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_kna1,
    begin of ty_bseg,
    belnr type bseg-belnr,
    kunnr type bseg-kunnr,
    end of ty_bseg,
    begin of ty_final,
    belnr type bseg-belnr,
    kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_final.
    Data: it_kna1 type table of ty_kna1,
    wa_kna1 type ty_kna1,
    it_bseg type table of ty_bseg,
    wa_bseg type ty_bseg,
    it_final type table of ty_final,
    wa_final type ty_final.
    Select kunnr adrnr from kna1 into table it_kna1 where....
    if sy-subrc = 0.
    select belnr kunnr into table it_bseg for all entries in it_kna1 where kunnr = it_kna1-kunnr.
    endif.
    sort it_kna1 by kunnr.
    Loop at it_bseg into wa_bseg.
    move wa_bseg-belnr to wa_final-belnr.
    read table it_kna1 into wa_kna1 with kunnr = wa_bseg-kunnr binary search.
    if sy-subrc = 0.
    move: wa_kna1-kunnr to wa_final-kunnr,
    wa_kna1-belnr to wa_final-belnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    Loop at it_final into wa_final.
    write: / wa_final-belnr, wa_final-kunnr, wa_final-adrnr.
    endloop.
    Reward if useful.
    Thankyou,
    Regards.

  • Retrieve data from cluster tables

    hi
    can any one explain me how to retrieve data from cluster tables
    Regards
    sachin

    you can write a select
    select * from KONV
           into table it_konv
    where <condition>
    you cant join.. cluster tables..

  • How to fetch data from cluster tables

    hi
    i need to know  how to fetch data from cluster tables please update me if any
    i know that we cannot use joins in cluster table we use view etc
    but i need detailed inforation on methods for fetching data from cluster tables
    regards
    Nishant

    Hi,
        Check the following links
    http://fuller.mit.edu/hr/cluster_tables.html
    The specified item was not found.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33

  • How to access data from Cluster table....?

    Hi Experts,
    Can You plz tell How to import/read data from cluster table? Plz give me the syntaxes also..
    Thanx in advance.

    Types of TABLES and the differences
    Transparent tables
    Pool tables
    Cluster Tables
         From the user point of view, all tables are used to store data and there is no difference in behavior or operation of these tables. All of them can be managed by using the standard OPEN SQL. However from the administrator point of view, transparent tables do exists with the same structure both in the directory as well as the database, exactly with the same data and fields. While other two are not transparent in the sense that they are not manageable directly using database system tools. We cannot use Native SQL statements on these tables. These are logical tables, which are arranged as records of transparent tables.

  • Problem reading data from two tables

    Hi experts,
    I'm developing a JDBC - IDOC scenario that needs to read data from two oracle tables. I have created a BPM that has a initial fork for the two channels and it works fine.
    The problem is that I need to read data from the first, two or both tables depending if there is data to read. If there is data in the two tables it works, but if only there is data in one of the two tables, I have read problems. I have tryed to set the 'neccesary branches' to 1 but this is a problem when I have data in both tables.
    Any idea?
    Best Regards,
    Alfredo Lagunar.

    Hi,
    have your fork step inside a block and then right-click your block to insert a deadline branch to your BPM process and specify the time after which your BPM process should be cancelled.....so if in that time, you get data from both tables, your BPM will work okay otherwise if that time is over, then your BPM process will be cancelled.
    Regards,
    Rajeev Gupta

  • Problem fetching data from multiple tables

    Hi,
    I am facing a problem in fetching data from 3 different tables. i am able to get the data from 2 tables but when i try accessing data from other table, i am getting redundant data. please help, my query is as under.
    select a.*,b.*, c.BidAmount from carregister a , watchlist b, Bidmaster c where a.CarID= b.CarID and b.UserID = 23 and c.BidAmount=(select max(BidAmount) from BidMaster where carid=a.carid group by c.BidAmount);
    Regards,
    Ujjwal B Soni
    <Software Developer>
    Baroda Gujarat India

    Hi,
    I got the solution. The solved query is as under :
    select a.*,b.*,(select max(BidAmount) from BidMaster where carid=b.carid) as MAX_AMT from carregister a , watchlist b where a.CarID= b.CarID and b.UserID=23;
    Thank you all for replying me.
    Warm Regards,
    Ujjwal B Soni
    <Software Developer>
    <Baroda Gujarat India>

  • Data from Cluster Tables

    Hi,
      I am fetching data from BSEG  table , by using for all entries . But it is taking long time. Is there any other to do it for tables like BSEG ( Cluster tables ). Please help me .
    Regards,
    Prasad

    Hi Prasad
    You could  use  hashed tables to
    retrieve data from BSEG. That will be faster.
    According to the analysis on how sap retrieves the data from a cluster table (like bseg),it's almost the same to use a
    loop at  ht_bkpf -> select from bseg ... endloop
    or
    select ... from bseg
    for all entries in ht_bkpf where ....
    Regards
    Inder

  • How to extract data from cluster table

    Hi, experts,
    Here I want to extract change documents, which is from tables CDHDR(header) and CDPOS(line items). The problem is that CDPOS is a cluster table so that I can't create a view to develop a generic data source.
    I have search on the forum and some one said generic data source based on function module was a choice, but I think coding FM is so complex, especially including delta implementation.
    Could any one give me some advice? or give me some coding samples?
    Thanks a lot!

    Dear Sam,
    I would suggest you to have a look at the function module CHANGEDOCUMENT_READ u2013 you can use this function module as a core in the developed function module for generic extractor. Unfortunately, the suggested function module can not handle import parameters for field names, so the strategy which can be applied here is to use this function module to fill the internal table based on restrictions on object class and table name and then go through filled internal table and delete records which are not relevant for fields KOFIZ or ABRSPERR.
    As for delta implementation, would you please advise if delta relevant field based on timestamp generated on date and time of the change document is sufficient for your needs? If so then you can use fields UDATE and UTIME to generate timestamp on them including the field containing generated timestamp to the extract table. Next step here is to choose this field as delta relevant field in the Generic DataSource maintenance (TCode RSO2).
    Please inform me if this solution suits you or if you have any questions or concerns regarding it.
    My best regards,
    Vadim

  • To read data from cluster table  urgent

    i need to get personnel number(PERNR) from BSEG table which is a CLUSTER TABLE
    what else i have to add in here to get personnel number(PERNR)
    this code is giving no data only lots of ZEROS
    FORM getexpcode1 TABLES   in_tab21 STRUCTURE itcsy
                             out_tab21 STRUCTURE itcsy.
      DATA : w_belnr LIKE bseg-belnr,
                 w_bukrs LIKE bseg-bukrs,
                 w_gjahr LIKE bseg-gjahr,
                  w_pernr like bseg-pernr,
                 w_invnos(255).
    Read company code
      READ TABLE in_tab21 INDEX 1.
      IF sy-subrc = 0.
        w_bukrs = in_tab21-value.
      ENDIF.
    Read document number
      READ TABLE in_tab21 INDEX 2.
      IF sy-subrc = 0.
        w_belnr = in_tab21-value.
      ENDIF.
    Read Fiscal Year
      READ TABLE in_tab21 INDEX 3.
      IF sy-subrc = 0.
        w_gjahr = in_tab21-value.
      ENDIF.
      SELECT   pernr FROM bseg
        INTO  w_pernr
       WHERE  bukrs = w_bukrs
         AND  belnr = w_belnr
         AND  gjahr = w_gjahr.
      ENDSELECT.
      READ TABLE in_tab21 INDEX 1.
      out_tab21-value = w_pernr.
      MODIFY out_tab21 INDEX 1 TRANSPORTING value.
    ENDFORM.                    "GETEXPCODE1

    hi,
    try:
    SELECT pernr FROM bseg
    INTO w_pernr
    WHERE bukrs = w_bukrs
    AND belnr = w_belnr
    AND gjahr = w_gjahr
    AND PERNR <> SPACE.
    ENDSELECT.
    A.
    Message was edited by:
            Andreas Mann

  • Import data from cluster table to internal table ?

    Hi 
    My Cluster table is Zcar_00 .
    I have 2 tables for zcar_00 . Name is zcar_01 and zcar_02 . 
    zcar_01 values :
    VARKEY  PAGENO MAKE
      V1         1  OPEL
      V2         2  BMW
      V3         3  AUDI 
    zcar_02 values :
    VARKEY PAGENO MARKA MODEL
    V1        1  OPEL  ASTRA
    V1        1  OPEL  CORSA
    V1        1  OPEL  VCTRA
    V2        2  BMW   116
    V2        2  BMW   316
    V3        3  AUDI  A6 
    I want to read data in this cluster table (zcar_01 , z_car02 ) .
    My code is :
    IMPORT ITAB TO JTAB FROM DATABASE  zaraba_00 (*error* ) ID 'MARKA'.
    How can I do ?
    thanks for reply ..
    serkann

    Hi,
    Go through the following code.
    TYPES:
      BEGIN OF tab,
        col1 TYPE i,
        col2 TYPE i,
      END OF tab.
    DATA:
      wa_indx TYPE indx,
      wa_itab TYPE tab,
      cl      TYPE mandt VALUE '100',
      itab    TYPE STANDARD TABLE OF tab.
    IMPORT tab = itab FROM DATABASE indx(xy) TO   wa_indx CLIENT cl  ID 'TABLE'.
    WRITE: wa_indx-aedat, wa_indx-usera, wa_indx-pgmid.
    ULINE.
    LOOP AT itab INTO wa_itab.
      WRITE: / wa_itab-col1, wa_itab-col2.
    ENDLOOP.

  • How to read data from cluster table.

    Hi experts.
    CDPOS  --- "Change document items"   ... is a cluster table.
    how to select data from it into an internal table....
    please help..
    i will award points for every help.
    thanks
    saurabh.

    Hi Saurabh,
    Use the foll. statement,
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    For Eg,
    IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.
    This code reads the internal table ITAB from the cluster "table" into the internal table JTAB.
    Hope it helps.

Maybe you are looking for