Read from cluster table ZL-PCL2

Hi all,
I need to read cluster table ZL that stores wage type for pernr. Now previously i was suggested
FM 'CU_READ_RGDIR'
FM 'CD_RED_LAST'.
FM 'PYXX_READ_PAYROLL_RESULT'. But i want to use the statement
Import from database.
i have included the file RPC2ZL00.
then the statement
Import ZL to ZZL from database PCL2(ZL) ID ZL-KEY.
Now does anyone have idea abt ZL-KEY??
means what value i need to feed in ZL-KEy and how do i feed it??
thanks in advance for all those who help me..
Reena

Hi Reena,
Key is the combination of Pernr & sequence no., which u see it from report display payroll result(HINCLSTR) or RGDIR table.
Instead of Import statement You can also use macro as below .
  CALL FUNCTION 'CU_READ_RGDIR'
       EXPORTING
            PERSNR          = PERNR-PERNR
       TABLES
            IN_RGDIR        = RGDIR
       EXCEPTIONS
            NO_RECORD_FOUND = 1
            OTHERS          = 2.
  CHECK SY-SUBRC = 0.
  PAY_BEGDA = SEL-BEGDA.
  LOOP AT RGDIR WHERE SRTZA = 'A'  AND VOID = SPACE
                  AND  ( PAYDT >= SEL-BEGDA AND PAYDT <= SEL-ENDDA ).
    IF RGDIR-RUNDT >= PAY_RUNDT.
      MOVE RGDIR-RUNDT TO PAY_RUNDT.
      PAY_BEGDA = RGDIR-FPBEG.
      SEQNR = RGDIR-SEQNR.
    ENDIF.
  ENDLOOP.
  RX-KEY-PERNR = PERNR-PERNR.
  UNPACK SEQNR TO RX-KEY-SEQNO.
  <b>RP-IMP-C2-RU.</b> 
  CHECK RP-IMP-RU-SUBRC = 0.
Read the cluster table
  LOOP AT CRT.
  ENDLOOP.
  Hope this helps.
Thanks,
Sarika.

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

  • Select from Cluster Table

    Hi,
    I want to read data fields name1 name2 name3 name4 from cluster table BSEC.
    I tried select statement it takes lot of time.
    Let me know if theres a better way.
    Any help will be rewarded with points.
    Thanks,
    blluesh

    Hi,
    Generally Select on cluster table will be very slow especially if u dont pass all the keys. Let me know what are all the fields u are passing to this select in WHERE clause. Also check the transperant table TCJ_CPD which has all name fields.
    Thanks,
    Vinod.

  • 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 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.

  • 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

  • Read from 2 tables, write only to one. Simple, but impossible??

    I've been messing about with various annotations for quite a while now, and I can't seem to figure out how to accomplish this seemingly simple task. I'm hoping somebody could explain to me the probably very obvious and simple mistake that I am making.
    I realize that question would otherwise point to problems in my database design and persistence strategy, but I can't seem to read from 2 tables, and write to only one. I have an entity bean that refers mainly to one table, but needs just one column of information from another table. It should not attempt to alter the secondary table, just join on it to get the one field it needs. So far, I've got the following:
    @Entity
    @Table(name = "ventureprofile")
    @SecondaryTable(name = "venture",
                    pkJoinColumns = @PrimaryKeyJoinColumn(name="ventureid"))
    @NamedQueries( {
            @NamedQuery(name = "Ventureprofile.findByVentureprofileid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureprofileid = :ventureprofileid"),
            @NamedQuery(name = "Ventureprofile.findByVentureid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureid = :ventureid"),
            @NamedQuery(name = "Ventureprofile.findByVenturesummary", query = "SELECT v FROM Ventureprofile v WHERE v.venturesummary = :venturesummary"),
            @NamedQuery(name = "Ventureprofile.findByLogoimagelocation", query = "SELECT v FROM Ventureprofile v WHERE v.logoimagelocation = :logoimagelocation"),
            @NamedQuery(name = "Ventureprofile.findByVisible", query = "SELECT v FROM Ventureprofile v WHERE v.visible = :visible ORDER BY v.venturename")
    public class Ventureprofile implements Serializable {
        @Id
        @GeneratedValue(strategy=GenerationType.AUTO, generator="Ventureprofile.ventureprofileid.seq")
        @SequenceGenerator(name="Ventureprofile.ventureprofileid.seq", sequenceName="ventureprofile_ventureprofileid_seq", allocationSize=1) 
        @Column(name = "ventureprofileid", nullable = false)
        private BigInteger ventureprofileid;      
        @Column(name = "ventureid", table="ventureprofile", nullable = false)
        private Long ventureid;
        @Column(name = "venturesummary")
        private String venturesummary;
        @Column(name = "logoimagelocation")
        private String logoimagelocation;
        @Column(name = "visible", nullable = false)
        private boolean visible;  
        @Column(table = "venture", name = "venturename", nullable=false, insertable=false, updatable=false)
        private String venturename;
    //... The extra column of data is "venturename", the tables are related by the column "ventureid". I contest, that since I have specified for read/write access no fields mapped to the 'venture' table (I specified with 'table=' any ambiguous columns), and described the table relationship via my @PrimaryKeyJoinColumn annotation, that toplink should not try to persist anything to the 'venture' table. However, I am getting the following exception:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: org.postgresql.util.PSQLException: ERROR: null value in column "venturename" violates not-null constraint
    Error Code: 0
    Call: INSERT INTO venture (ventureid) VALUES (?)
            bind => [220]
    Query: InsertObjectQuery(VCMarkWeb.db.entity.Ventureprofile[ventureprofileid=220])
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
    ...It seems pretty clear that toplink is trying to insert an empty row into the secondary table, and barfing since it is inserting no values, including those constrained to be nonnull. Anyway...I hope it's clear what's going on here, and perhaps somebody knows the right way to do this. Thanks fot your help!

    Tom and Cornelius,
    Thank you both for your ideas. This what I think I will do:
    1) Drive up to OWC (fortunately they are only about 15 miles away from where I live) and get a bigger HD and some more RAM.
    2) Copy the OS9 applications on the existing HD to a thumb drive.
    3) Install the new hard drive and memory
    4) Install OSX TIger and 9.2.2
    5) Maybe do the 4.1.8 firmware update also, maybe.
    6) Look around for a Superdrive and if I can get one for a good price, I'll do it otherwise I'll just use USB thumb drives if I need to copy something off the PB.
    One thing that I was fighting with the other day was that when I had the yoyo power supply plugged in and attached when the PB was in the kitchen, the batteries would not charge although the yoyo was outputting +24 VDC.
    I move everything to the garage, where I originally fixed the yoyo power supply, plug it in out there and the batteries started charging!!! Scratching my head...then I check the voltage between the metal barrel (with the Vsensing resistor attached between the metal shell and the ground wire) of power supply plug and the +24 VDC wire and there is 22 to 23 VDC with the batteries being charged. In the kitchen when they were not being charged, it was about 1.0 VDC. So I rotate the plug a little bit and the batteries start charging. Rotate it more and the batteries don't charge. Something else to do when I have spare time.
    Anyway, thanks for the help and suggestions.
    John

  • How do I read from one table and write to another identical table?

    I am very new to Oracle. I am trying to do something that should be very simple.
    I am trying to read from one table in SQL and then write to another
    Identically formatted table. I keep getting various errors. Could someone please
    post some vey simple code that will work so that I can play around with it?
    Any help would be greatly appreciated.
    Thanks,
    Ron

    Thanks, but I must be missing something.
    I have two tables, SONGLIST and SETLIST.
    The second line by itself works just fine on either table.
    Here is the code I used following your seggestion, along with it's error message.
    Hope you can help. Thanks again...
    INSERT INTO SETLIST
    SELECT TITLE FROM SONGLIST WHERE ROTATION <> 'X'
    ORA-00947: not enough values

  • JDBC outbound reading from multiple tables

    Hi,
    I have a scenario in which I have to read data from multiple tables.
    The keys of these tables (employee details) are dependent on a employee master table.
    Now there is a 1-N relationship between master and the details table. I have to send the data to an IDOC.
    I am stuck since reading from all the tables at the same time is not possible.
    Please suggest some solution.
    Thanks,
    Vaibhav

    Hi Bhavesh,
    Thanks for ur reply. It solved my problem.
    Full points to you...
    Pls help me with one more issue.
    As per the method u told i am reading from multiple tables. Each table has data for multiple employees.
    The response message is of the format
    <STATEMENT_Table1_response>
    <row>
       Data for emp 1
    </row>
    <row>
       Data for emp 1
    </row>
    </STATEMENT_Table1_response>
    <STATEMENT_Table1_response>
    <row>
       Data for emp 2
    </row>
    <row>
       Data for emp 2
    </row>
    </STATEMENT_Table1_response>
    <STATEMENT_Table2_response>
    <row>
       Data for emp 1
    </row>
    <row>
       Data for emp 1
    </row>
    </STATEMENT_Table2_response>
    <STATEMENT_Table2_response>
    <row>
       Data for emp 2
    </row>
    <row>
       Data for emp 2
    </row>
    </STATEMENT_Table2_response>
    I want to collect it to an idoc where i have data of each employee collected together. Like
    <Emp1>
      <Data from Table1>
      <Data from Table2>
    </Emp1>
    <Emp2>
      <Data from Table1>
      <Data from Table2>
    </Emp2>
    I have tried many ways and looks like a custom code in java have to written.
    Is there anything else possible?
    Thanks in Advance,
    Vaibhav

  • 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

  • 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

  • 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.

  • 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.

Maybe you are looking for