Table s034

hi
i fetch data from table s034 but it take more time so have any soulation ? [already use pri.key in query then also take more time]
query is:-
select cmzubb cmagbb from s034
      into corresponding fields of table
     t_s031 where sptag > m_budat
       and werks in ('2502','1001','2002')
       and charg in bwtar
       and charg NOT in ('S','X')
       and matnr in matnr
       and ( lgort = 'FG01' or ( lgort = 'FG02' AND werks  
= '2002'  ) ).

hi do like this..
ranges: r_werks for t001w-werks,
        r_logrt  for mard-lgort .
r_werks-low = 2502.
r_werks-sign = 'I'.
r_werks-option = 'EQ'.
append r_werks.
r_werks-low = 2502.
append r_werks.
r_werks-low = 2502.
append r_werks.
r_werks-low = 2502.
append r_werks.
r_lgort-low = 'FG02'.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
append r_lgort.
r_lgort-low = '2002'.
append r_lgort.
select
cmzubb
cmagbb
from s034
into corresponding fields of table
t_s031 where sptag gt m_budat
and werks in r_werks
and charg in bwtar
and charg NOT in ('S','X')
and matnr in matnr
and  lgort = 'FG01'
or logrt  in r_lgort..

Similar Messages

  • Month wise Closing balance of Material Wise and  Batch Wise

    Hi,
    We can get period wise closing balance for Plant-Storage Location-materials in MARDH.
    But i didnt find any table which can provide Plant - S.Loc - Year - Period (or Month) - Batch wise closing Balances.
    Can any body please suggest a table on the above criteria.
    Thanks
    Pardha Saradhi Bandaru.

    Hi,
    The required batch information can be taken from the table S034
    Regards
    Merwyn

  • Vehicle Consumption Analysis question?

    I'm working with the Vehicle Consumption analysis objects in SAP BW (0PM_C12 and 0PM_DS08) and I've got a question regarding the retrieval of Operation hours.
    The 0PM_FLEET datasource retrieves Distance, Fuel, and Operating Hours from SAP ecc and the first two are mapped to the 0PM_DS08 datasource and subsequent cube. The Operating hours though are not mapped in the transformation.
    Anyone know what infoobject I should use to map both the operating hours measurment and the operating hours unit of measure value to the cube?
    Thanx,
    er

    Hi Rajesh,
    Such situations can be manged with simple solutions through Infoset-query or an ABAP code.
    MCIZ Integrated solution can be developed using tables S0114, MBEW
    OR
    a Solution using tables S034, MBEW  can be  had to capture consumption figures done through MIGO transactions.
    In both cases MBEW table is used to avail the Moving Average Price for Cost Calculations.
    Let's wait for other opinions
    Best of Luck
    Jogeswara Rao K

  • Table to see stock on particular date

    Hello SAP Gurus,
       I know that through mb5b report you can see the stock on posting date.But guys can u  tell me that from which table and field it takes the data?

    Please look at transactions MCBE and MCBR.  They are part of the inventory standard analysis.  These will show total consumption for the selected time periods.
    There is a ton of data availablie via the Logistics Information System and I think it is the most under utilized functionality in SAP.  If consultants and users really learned how to use this functionality you could probably do away with 80% of your custom reports.
    You can also use flexiblie analysis against structure/table S032, (not S039), and create your own analysis and reports.  These can be highly customized and saved and reused.  Variants can be created and the results can be saved in personal reports, emailed or downloaded.
    Other structures you might find of use in your particular query would be
    S031 - Movements
    S032 - Stocks
    S033 - Movements (indiv. records)
    S034 - Movements (batches)
    S035 - Stocks (batches)
    S039 as suggested above provides primarily averages which is not what your looking for.
    Craig
    Edited by: Craig Snyder on Apr 30, 2008 1:26 AM

  • Mm std tables

    give me the mm related standard tables

    Description     Table Name
    Material Cost Distribution     MAKV/MAKG/MAKZ
    Other Related     EMARA
    Structure     EMARC
    MRP Related     EMARC1
    Purchase Related     EMARC2
    PPC Related           EMARC3
    Material Export Control     MAPE/MAEX
    Materials --> Task List     MAPL
    General Data           MARA
    C Segment                 MARC
    Storage Location /Batch Seg.     MARD
    Unit of measure     MARM/MAMT
    Material Control record     MARV
    Material to BOM Link     MAST
    Material Valuation     MBEW
    Stock at Production Storage Bin     MBPR
    Material Document     MSEG
    Sales Order Stock     MSKA
    Special Stocks with Customer     MSKU
    Project Stock     MSPR
    Material Master status     MSTA
    General Data     LFA1
    VAT Details     LFAS
    Company Code          LFB1
    Dunning Details          LFB5
    Bank Details          LFBK
    Transactions Details     LFC1
    Ex/Im Related Details     LFE1
    Supplying Region     LFLR
    Purchase Organisation     LFM1
    Purchasing Data     LFM2
    Partner Functions          WYT3
    Stocks     MSLB
    Vendor Evaluation - Header     ELBK
    Vendor Evaluation - Material related     ELBM
    Vendor Evaluation - Main criterion     ELBP
    Basic Data     ASMD
    Service Short texts     ASMDT
    General Data     EINA
    Purchase Organisation Data     EINE
    Order Price History     EIPA
    Ex/Im Header Data     EIKP
    Ex/Im Detail Data     EIPO
    Purchasing Source lists     EORD
    General Data     KOMG
    Conditions (Item)     KONP
    General Data     AEBAN
    Requisitions     EBAN
    I/O for purchase req.     RM06E
    Purchasing Docu. Header     EKKO
    Purchasing Docu. Item     EKPO
    Conditions in PO     KONV
    Scheduling Agreement Release Documentation     EKEH
    Header Data for Scheduling Agreement Releases     EKEK
    Order Acceptance/Fulfillment Confirmations     EKES
    Delivery Schedules     EKET
    Partner Roles     EKPA
    Quota file header     EQUK
    Quota file item     EQUP
    Purchasing Docu. Item     EKPO
    Release Documentation     EKAB
    Vendor Address     EKAN
    History of Purchasing Document     EKBE/EKBZ
    Purchasing Condition     EKKI
    Account Assignment     EKKN
    Shipping Specifications     EKPV
    Order Acceptance/Fulfillment Confirmations (Shipping documents)     EKES
    ERS Procedure     EKRS
    Reservation/dependent requirements     RESB
    Document Header: Reservation     RKPF
    CLASS HEADER DATA     KLAH
    Class Type Texts                     TCLAT
    Characteristics of a Class           KSML
    Characteristic                       CABN
    Characteristic values                CAWN
    Value Texts                          CAWNT
    Allocation Table: Object to Class      KSSK
    Object to Characteristic Values     AUSP
    Material master valuation info if split valuation is used
         MBEW
    Batch master     MCHA
    Storage location batches quantities if batch mgmt is cross plant     MCH1
    Storage location batches quantities if batch mgmt is not cross plant     MCHB
    Stocks with vendor (includes batch level)     MSLB
    Stocks against Sales orders     ENT5117
    ENT5117 comprises     MARD, MSKA
    Confirmation control keys      T163E
    Customising - Description of confirmation control keys      T163F
    Customising - Link between confirmation control key and confirmation     T163G
    Confirmation control keys description     T163M
    Confirmations table for purchase orders      EKES
    PO line item details -confirmation control key for a PO line item     EKPO
    Incoterms General     TINC/TINT
    A/C entries     BSIM
    Against Orders     AUFM
    Purchase Order      CEKKO
    Purchase Requisition      CEBAN
    Preliminary posting doc.segment for vendors      VBSEGK
    Preliminary posting doc.segment for G/L accts     VBSEGS
    Parked invoices have an entry in the BKPF table but do not have an entry in the BSEG table until they are actually posted     In the VBSEGS table, all the material line items for a parked invoice are stored. When the parked document is actually posted, the entry from this table is deleted and an entry is made in the MSEG table as a final posting.
    Storage Bins     LAGP
    Control Cycle Header     PKHD
    Storage Unit Header Records     LEIN
    Transfer Req. Header     LTBK
    Physical Inventory Document - Header     IKPF
    Physical Inventory Document Items     ISEG
    Physical Inventory Conversion Parameter Appendix                ISEGO1
    Physical Inventory Document Additional Quantities Appendix      ISEGO2
    LIFO Material Layer                                                  MYML
    LIFO Period Stocks, Individual Material                              MYMP
    LIFO-relevant materials                                              MYMS
    LIFo Pool Layer     MYPL
    Forecast Values     PROW
    Quality notification     QMFE
    Quality notification - items     QMEL
    Inspection lot record     QALS
    Inspection processing: Usage decision     QAVE
    Material and inspection link     QMAT
    Problems: Vendor Analysis     S102
    Problems: Material Analysis     S102
    Sales Related material data     S004
    Purchasing group related data     S011
    Purchasing related LIS reports     S012
    Vendor Evaluation data     S013
    Subsequent Settlement     S015
    Material Usage     S026
    Stocks related LIS reports     S031
    Current Stock & grouping terms     S032
    Movements for single records     S033
    Movements for Batches     S034
    Batch Stocks     S035
    Batch Analysis data     S038
    Planning     S039
    Vendor Statistics     S068
    Purchasing     S080/S081/S082
    Stock placements/Removals WM     S090
    Flow of Quantities     S091
    Stock/Requirements Analysis     S094
    LIS Related Views     MCDY/MCL
    Client                    T000
    Account Assignments     T163K/T163I
    Authorization Objects     TOBJ/TOBJC/TOBJT
    Certificate Catg          T069
    Check Table Info.     DD08L
    Control Table for Vendor Evaluation                                     T147
    Currency Codes          TCURC
    Definition for Main Criteria for Vendor Evaluation              T147A
    Definition for Subcriteria for Vendor Evaluation                        T147C
    Definition of Evaluation Paths                                       T77AW
    Definition of Scope of List: Vendor Evaluation                          T147M
    Description of Evaluation Groups                                     T087T
    Description of Weighting Keys in Vendor Evaluation                      T147F
    Descriptions of LIS Information Structures                                TMC4T
    Descriptions of Logical Screens                                           T133B
    Descriptions of Material Status from MM/PP View                           T141T
    Descriptions of Release Groups                                            T16FH
    Descriptions of Release Indicators for Services                           T16FM
    Descriptions of Release Indicators: Purchasing Documents                  T16FE
    Descriptions of Release Strategies     T16FT
    Division Master     TSPA
    Domain Names     DD01L
    Domain Range     DD07L
    Field Names     DD04L
    Inv. Management: Text Table for Trans./Event Types Allowed           T158T
    Inv. Managmt Print Function: Active Form Version, Labels             T159M
    Inv. Mngmt - General: Transaction/Event Types Allowed                T158V
    Inv. Mngmt Print Function: Maintain Text Name for Labels     T159O
    LIS - Environment generation sample reports and references           TMCE
    LIS Default Sets and Format Classes                                  TMCSE
    LIS Evaluations                                                      TMCSA
    LIS Evaluations: Texts                                               TMCST
    LIS Information Structures                                           TMCSB
    LIS Libraries                                                        TMCSC
    LIS objects                                                          TMCO
    LIS Planning: Key Matrix Selection Control Table                     T444P  
    LIS Planning: Screen Sequence Control Table                          T444K
    LIS Readings for Internal Number Assignment: Alphanumeric            TMCSD
    LIS Standard Reports/Layouts for Evaluations                         TMCSF
    LIS Standard Reports/Layouts for Evaluations: Texts                  TMCSG
    LIS Transaction Code Control                                         TMCTC
    LIS: Characteristic Texts (external data and R/2)                    TMCTX
    LIS: Status Management - Updating     TMC2
    Logon data     USR02
    Main Criteria in Vendor Evaluation                                      T147G
    Material authorization groups in quality management                  TQ01B
    Material Group          T023
    Material Group Descriptions                                          T023T
    Material Groups                                                      T023
    Material Ledger Table                                                TCKM1
    Material Ledger Text Table                                           TCKMT
    Material master field selection                                      T130A
    Material master screen sequence control                              T138B
    Material Pricing Group 1                                             TVM1
    Material pricing group 1: Description                                TVM1T
    Material Pricing Group 2                                             TVM2
    Material Pricing Group 2: Description                                TVM2T
    Material Pricing Group 3                                             TVM3
    Material pricing group 3: Description                                TVM3T
    Material Pricing Group 4                                             TVM4
    Material pricing group 4: Description                                TVM4T
    Material Pricing Group 5                                             TVM5
    Material pricing group 5: Description                               TVM5T
    Material Pricing Group for Export/Import: Descriptions               TVFMT
    Material Pricing Group: Shipping Materials                           TVEGR
    Material Pricing Group: Shipping Materials: Designations             TVEGRT
    Material statistics groups                                          TVSM
    Material Status from Materials Management/PPC View                   T141
    Material Substitution: Reasons                                       TVSU
    Material Substitution: Texts for Reasons                             TVSUT
    Material Taxes                                                       TSKM
    Material Type Descriptions                                           T134T
    Material Types                                                       T134
    Material Types Allowed in BOM                                        T415M
    Material: Account Assignment Group Texts                            TVKMT
    Material: MRP profiles (definition)                                 T401A
    Materials Provided Indicator Texts                                  T417T
    Materials Provided Indicators                                       T417
    Materials: Account Assignment Groups                                TVKM
    Materials: Item Category Groups in Mat.Master: Texts                TPTMT
    Materials: Item Category Groups in Material Master                  TPTM
    Materials: Product Hierarchies                                      T179
    Materials: Product hierarchies (inverse)                            T179I
    Materials: Product hierarchies: Texts                               T179T
    Materials: Sales status                                             TVMS
    Materials: SD Status: Texts                                         TVMST
    Materials: Statistics groups: Texts        TVSMT
    Movement Type                                                          T156
    Movement Type Text                                                     T156T
    Movement Type: Quantities/Value Posting                                T156S
    Movement Types: Screen Selection     T156B
    MRP                                                                      T024D
    MRP default values per material type                                     TMW00
    MRP description                                                          T438T
    MRP distribution key (texts)                                             T437W
    MRP group text                                                           T438X
    MRP lot sizes                                                            T439A
    MRP Profile Descriptions                                                 T401T
    MRP transaction control     T450
    MRP Type                                                                 T438A
    Physical Inventory Stock Types                                       T064A
    Physical Inventory Stock Types and Allocated Movement Types          T150
    Physical Inventory: Texts     T064T
    PO Tolerance Limits     T169G
    Pricing Procedure                                                   T683
    Pricing Procedure: Data                                             T683S
    Pricing Procedures: Determination in Sales Docs.                    T683V
    Pricing Procedures: Procedure: Texts                                TVKVT
    Pricing Procedures: Texts                                           T683T
    Pricing Procedures: Transaction        TVKV
    Purchase Order History Categories                                  T163B
    Purchasing Area                                                    T026
    Purchasing Document Types                                          T161
    Purchasing Group     T024
    Purchasing Groups                                                  T024
    Purchasing organisations     T024E
    Purchasing Organizations                                           T024E
    Purchasing Organizations                                           T024Z
    Purchasing value key        T405
    Purchasing Various Control Parameters                              TMED
    R/3 Objects     TADIR/TRDIR
    Release Codes                                                         T161E
    Release Codes                                                         T16FC
    Release Groups                                                        T16FG
    Release Indicator, Purchase Requisition                               T161S
    Release Indicators: Purchasing Document                               T16FB
    Release Indicators: Service Entry Sheet                               T16FL
    Release Point Assignment for Purchase Requisition Release             T161F
    Release Prerequisite, Purchase Requisition                            T161G
    Release Prerequisites                                                 T16FV
    Release Statuses                                                      T16FK
    Release Strategies     T16FS
    SAP Tables     DD02L
    Scope of List: Vendor Evaluation     T147O
    SQL Tables     DD06L
    Stock display: basic list/detail list                                 T136
    Stock Mngmt Levels for Inventory Sampling                             T064S
    Stock Types and Allocated Fields in Physical Inventory                T150F
    Stock Types and Texts for Physical Inventory                          T064B
    Stock Types and Their Values                                          T156C
    Storage Bin Structure for Automatic Creation of Storage Bins          T343
    Storage Bin Type Search                                               T334P
    Storage Classes                                                       T646L
    Storage Classes Allowed per Storage Type                              T331L
    Storage Condition Texts                                               T142T
    Storage Conditions for Materials                                      T142
    Storage for Search Terms     TSFST
    Storage Locations                                                     T001L
    Storage Section Indicators                                            T304
    Storage Section Names                                                 T302T
    Storage Section Search                                                T334B
    Storage Type Control                                                  T331
    Storage Type Control for Block Storage                                T331B
    Storage Type Descriptions                                             T301T
    Storage Type Indicators                                               T305
    Storage Type Search                                                   T334T
    Storage Unit Type Check                                               T334E
    Storage Unit Types                                                    T307
    Table + Field Name     DD03L
    Table Tech. Specs     DD09L
    Table/Field Def.     DD03VV
    Texts for Main Criteria in Vendor Evaluation                            T147B
    Texts for Scope of List in Vendor Evaluation                            T147N
    Texts for Subcriteria in Vendor Evaluation                              T147D
    Transaction Code Texts                                              TSTCT
    Transaction Codes                                                   T588A
    Transaction Control: Inventory Management                           T158
    Transaction Control: Physical Inventory                             T158I
    Transaction Control: Services Management                            T265
    Transaction Description                                             T167T
    Transaction Parameters                                              T7032
    Transaction Texts: Invoice Verification     T169X
    Units of Measure          T006
    User address data     USR03
    User master record        USR01
    Valuation - Control                                                   TKEVA01
    Valuation acc. to Length of Absence                                   T5A4T
    Valuation area                                                        T001K
    Valuation area control table                                          TCKM2
    Valuation Category/Valuation type                                     T149B
    Valuation Class Descriptions                                          T025T
    Valuation Classes          T025
    Valuation Classes                                                     T025
    Valuation Classes                                                     T554O
    Valuation difference temporary storage                                TBKOW
    Valuation Levels for LIFO Inventory Valuation                         T001Y
    Valuation method names                                                T044B
    Valuation methods                                                     T880B
    Valuation of Pay Scales for Statistics                                T5D3N
    Valuation Strategies (CO-PA)                                          TKEVA02
    Valuation type/valuation class                                        T149
    Valuation types for valuation area                                    T149A
    Valuation variant for order costing                                   TCO10
    Valuation Variants in Costing                                         TCK05
    Valuation Variants in Costing - Texts                                 TCK06
    Valuations     T863W
    Vendor account groups                                              T077K
    Vendor Evaluation: Assignment Percentages - Points Scores               T147K
    Vendor Hierarchy Category                                          TLHIT
    Vendor master data screen selection (purch.org.)     T079M
    Warehouse costs for MRP lot size     T439L
    Warehouse Number Descriptions                        T300T
    Weighting Keys in Vendor Evaluation                                     T147J
    WM Default Values                                                       T340D   
    WM Movement Types                                                       T333
    WM Names of Storage Bin Types                                           T303T
    WM Screen Selection                                                     T341
    WM Storage Bin Types                                                    T303
    WM Storage Sections                                                     T302
    WM Storage Types                                                        T301
    WM Transactions                                                         T340
    WM Warehouse Numbers                                                    T300
    WM: Assignment MM Storage Location to WM Warehouse Number        T320

  • Movement Types that populate total usage quantity (MGVBR) in table S031

    Can anybody tell me what material movements (Movement types) populate the field 'Total Usage Quantity(MGVBR)'  in table S031? Any idea how to find out these mvmt. types.
    Thanks in advance,
    Satya.

    Hi,
    This is the field of a report.This field represents the total usage of a material on a perticular posting date.This is updated whenever a consumption happens for the material.
    It is the Total of planned and unplanned consumption.
    The planned consumption is updated when goods are taken from the warehouse as a result of a reservation.  The unplanned consumption is updated when goods are taken without a reservation.
    In the standard of Inventory Controlling this key figure is updated at the information structures S031 und S034 at the posting date.
    Regards,
    Rambhupal reddy

  • MB5B Report table for Open and Closing stock on date wise

    Hi Frds,
    I am trying get values of Open and Closing stock on date wise form the Table MARD and MBEW -Material Valuation but it does not match with MB5B reports,
    Could anyone suggest correct table to fetch the values Open and Closing stock on date wise for MB5B reports.
    Thanks
    Mohan M

    Hi,
    Please check the below links...
    Query for Opening And  Closing Stock
    Inventory Opening and Closing Stock
    open stock and closing stock
    Kuber

  • Error while dropping a table

    Hi All,
    i got an error while dropping a table which is
    ORA-00600: internal error code, arguments: [kghstack_free1], [kntgmvm: collst], [], [], [], [], [], [], [], [], [], []
    i know learnt that -600 error is related to dba. now how to proceed.
    thanks and regards,
    sri ram.

    00600 errors should be raised as service request with Oracle as it implies some internal bug.
    You can search oracle support first to see if anyone has had the same class of 00600 error, and then if not (and therefore no patch) raise your issue with Oracle.
    http://support.oracle.com

  • Logical level in Fact tables - best practice

    Hi all,
    I am currently working on a complex OBIEE project/solution where I am going straight to the production tables, so the fact (and dimension) tables are pretty complex since I am using more sources in the logical tables to increase performance. Anyway, what I am many times struggling with is the Logical Levels (in Content tab) where the level of each dimension is to be set. In a star schema (one-to-many) this is pretty straight forward and easy to set up, but when the Business Model (and physical model) gets more complex I sometimes struggle with the aggregates - to get them work/appear with different dimensions. (Using the menu "More" - "Get levels" does not allways give the best solution......far from). I have some combinations of left- and right outer join as well, making it even more complicated for the BI server.
    For instance - I have about 10-12 different dimensions - should all of them allways be connected to each fact table? Either on Detail or Total level. I can see the use of the logical levels when using aggregate fact tables (on quarter, month etc.), but is it better just to skip the logical level setup when no aggregate tables are used? Sometimes it seems like that is the easiest approach...
    Does anyone have a best practice concerning this issue? I have googled for this but I haven't found anything good yet. Any ideas/articles are highly appreciated.

    Hi User,
    For instance - I have about 10-12 different dimensions - should all of them always be connected to each fact table? Either on Detail or Total level.It not necessary to connect to all dimensions completely based on the report that you are creating ,but as a best practice we should maintain all at Detail level only,when you are mentioning any join conditions in physical layer
    for example for the sales table if u want to report at ProductDimension.ProductnameLevel then u should use detail level else total level(at Product,employee level)
    Get Levels. (Available only for fact tables) Changes aggregation content. If joins do not exist between fact table sources and dimension table sources (for example, if the same physical table is in both sources), the aggregation content determined by the administration tool will not include the aggregation content of this dimension.
    Source admin guide(get level definition)
    thanks,
    Saichand.v

  • Rendering xml-table into logical filename in SAP R/3

    Hi,
    I am trying to translate an xml-table with bytes into a logical filepath in SAP R3.
    Do I have to use the method gui-download or shall I loop the internal xml-table?
    When I tried to loop the xml-table into a structure, and then transfering the structure into the logical filename, I get problems with the line breaks in my xml-file. How do I get the lines to break exactly the same as I wrote them in my ABAP-code?
    Edited by: Kristina Hellberg on Jan 10, 2008 4:24 PM

    I believe you posted in the wrong forum.
    This forum is dedicated to development and deployment of .Net applications that connect and interact with BusinessObjects Enterprise, BusinessObjects Edge, or Crystal Reports Server. This includes the development of applications using the BusinessObjects Enterprise, Report Application Server, Report Engine, and Web Services SDKs.
    Ludek

  • Can you check for data in one table or another but not both in one query?

    I have a situation where I need to link two tables together but the data may be in another (archive) table or different records are in both but I want the latest record from either table:
    ACCOUNT
    AccountID     Name   
    123               John Doe
    124               Jane Donaldson           
    125               Harold Douglas    
    MARKETER_ACCOUNT
    Key     AccountID     Marketer    StartDate     EndDate
    1001     123               10526          8/3/2008     9/27/2009
    1017     123               10987          9/28/2009     12/31/4712    (high date ~ which means currently with this marketer)
    1023     124               10541          12/03/2010     12/31/4712
    ARCHIVE
    Key     AccountID     Marketer    StartDate     EndDate
    1015     124               10526          8/3/2008     12/02/2010
    1033     125               10987         01/01/2011     01/31/2012  
    So my query needs to return the following:
    123     John Doe                        10526     8/3/2008     9/27/2009
    124     Jane Donaldson             10541     12/03/2010     12/31/4712     (this is the later of the two records for this account between archive and marketer_account tables)
    125     Harold Douglas               10987          01/01/2011     01/31/2012     (he is only in archive, so get this record)
    I'm unsure how to proceed in one query.  Note that I am reading in possibly multiple accounts at a time and returning a collection back to .net
    open CURSOR_ACCT
              select AccountID
              from
                     ACCOUNT A,
                     MARKETER_ACCOUNT M,
                     ARCHIVE R
               where A.AccountID = nvl((select max(M.EndDate) from Marketer_account M2
                                                    where M2.AccountID = A.AccountID),
                                                      (select max(R.EndDate) from Archive R2
                                                    where R2.AccountID = A.AccountID)
                   and upper(A.Name) like parameter || '%'
    <can you do a NVL like this?   probably not...   I want to be able to get the MAX record for that account off the MarketerACcount table OR the max record for that account off the Archive table, but not both>
    (parameter could be "DO", so I return all names starting with DO...)

    if I understand your description I would assume that for John Dow we would expect the second row from marketer_account  ("high date ~ which means currently with this marketer"). Here is a solution with analytic functions:
    drop table account;
    drop table marketer_account;
    drop table marketer_account_archive;
    create table account (
        id number
      , name varchar2(20)
    insert into account values (123, 'John Doe');
    insert into account values (124, 'Jane Donaldson');
    insert into account values (125, 'Harold Douglas');
    create table marketer_account (
        key number
      , AccountId number
      , MktKey number
      , FromDt date
      , ToDate date
    insert into marketer_account values (1001, 123, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('27.09.2009', 'dd.mm.yyyy'));
    insert into marketer_account values (1017, 123, 10987, to_date('28.09.2009', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
    insert into marketer_account values (1023, 124, 10541, to_date('03.12.2010', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
    create table marketer_account_archive (
        key number
      , AccountId number
      , MktKey number
      , FromDt date
      , ToDate date
    insert into marketer_account_archive values (1015, 124, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('02.12.2010', 'dd.mm.yyyy'));
    insert into marketer_account_archive values (1033, 125, 10987, to_date('01.01.2011', 'dd.mm.yyyy'), to_date('31.01.2012', 'dd.mm.yyyy'));
    select key, AccountId, MktKey, FromDt, ToDate
         , max(FromDt) over(partition by AccountId) max_FromDt
      from marketer_account
    union all
    select key, AccountId, MktKey, FromDt, ToDate
         , max(FromDt) over(partition by AccountId) max_FromDt
      from marketer_account_archive;
    with
    basedata as (
    select key, AccountId, MktKey, FromDt, ToDate
      from marketer_account
    union all
    select key, AccountId, MktKey, FromDt, ToDate
      from marketer_account_archive
    basedata_with_max_intervals as (
    select key, AccountId, MktKey, FromDt, ToDate
         , row_number() over(partition by AccountId order by FromDt desc) FromDt_Rank
      from basedata
    filtered_basedata as (
    select key, AccountId, MktKey, FromDt, ToDate from basedata_with_max_intervals where FromDt_Rank = 1
    select a.id
         , a.name
         , b.MktKey
         , b.FromDt
         , b.ToDate
      from account a
      join filtered_basedata b
        on (a.id = b.AccountId)
    ID NAME                     MKTKEY FROMDT     TODATE
    123 John Doe                  10987 28.09.2009 31.12.4712
    124 Jane Donaldson            10541 03.12.2010 31.12.4712
    125 Harold Douglas            10987 01.01.2011 31.01.2012
    If your tables are big it could be necessary to do the filtering (according to your condition) in an early step (the first CTE).
    Regards
    Martin

  • Can not insert/update data from table which is created from view

    Hi all
    I'm using Oracle database 11g
    I've created table from view as the following command:
    Create table table_new as select * from View_Old
    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)
    Anybody tell me, what's happend? cause?
    Thankyou
    thiensu
    Edited by: user8248216 on May 5, 2011 8:54 PM
    Edited by: user8248216 on May 5, 2011 8:55 PM

    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)so what is wrong with the GUI tools & why posting to DATABASE forum when that works OK?

  • Not able to refresh the data in a table

    Hi In my application i fill data in a table on clikc of a button ..
    Following are the line of code i have user
    RichColumn richcol = (RichColumn)userTableData.getChildren().get(0);                                           (fetch the first column of my table)
    richcol.getChildren().add(reportedByLabel);                                                                   (reportedByLabel is a object of RichInputText)
    AdfFacesContext adfContext1 = AdfFacesContext.getCurrentInstance();
    adfContext1.addPartialTarget(richcol);
    adfContext1.addPartialTarget(userTableData);
    But on submit of that button table data is not refreshed after adding partial trigger on that table as well as that column also .... any idea??
    Edited by: Shubhangi m on Jan 27, 2011 3:50 AM

    Hi,
    The Code that you have shown adds an additional inputText component to the first column of a table.
    Is that your intention?
    If yes, please use the following code snippet to achieve your functionality:
    JSPX Code:
    <af:form id="f1">
    <af:commandButton text="Add Column" id="cb1"
    actionListener="#{EmployeesTableBean.onAddColumn}"/>
    <af:table value="#{bindings.Employees.collectionModel}" var="row"
    rows="#{bindings.Employees.rangeSize}"
    emptyText="#{bindings.Employees.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.Employees.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.Employees.collectionModel.selectedRow}"
    selectionListener="#{bindings.Employees.collectionModel.makeCurrent}"
    rowSelection="single" id="t1"
    binding="#{EmployeesTableBean.table}">
    <af:column sortProperty="EmployeeId" sortable="false"
    headerText="#{bindings.Employees.hints.EmployeeId.label}"
    id="c1">
    <af:outputText value="#{row.EmployeeId}" id="ot2">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.Employees.hints.EmployeeId.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="FirstName" sortable="false"
    headerText="#{bindings.Employees.hints.FirstName.label}"
    id="c2">
    <af:outputText value="#{row.FirstName}" id="ot1"/>
    </af:column>
    <af:column sortProperty="LastName" sortable="false"
    headerText="#{bindings.Employees.hints.LastName.label}"
    id="c3">
    <af:outputText value="#{row.LastName}" id="ot3"/>
    </af:column>
    </af:table>
    </af:form>
    Bean:
    public class EmployeesTableBean {
    private RichTable table;
    public EmployeesTableBean() {
    public void setTable(RichTable table) {
    this.table = table;
    public RichTable getTable() {
    return table;
    public void onAddColumn(ActionEvent actionEvent) {
    RichInputText newRichInputText = new RichInputText();
    newRichInputText.setId("new");
    newRichInputText.setValue("Name:");
    RichColumn richcol = (RichColumn)table.getChildren().get(0);
    richcol.getChildren().add(newRichInputText);
    AdfFacesContext adfContext1 = AdfFacesContext.getCurrentInstance();
    adfContext1.addPartialTarget(table);
    Thanks,
    Navaneeth

  • Unable to capture the adf table column sort icons using open script tool

    Hi All,
    I am new to OATS and I am trying to create script for testing ADF application using open script tool. I face issues in recording two events.
    1. I am unable to record the event of clicking adf table column sort icons that exist on the column header. I tried to use the capture tool, but that couldn't help me.
    2. The second issue is I am unable to capture the panel header text. The component can be identified but I was not able to identify the supporting attribute for the header text.

    Hi keerthi,
    1. I have pasted the code for the first issue
    web
                             .button(
                                       122,
                                       "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1824fhkchs_6']/web:form[@id='pt1:_UISform1' or @name='pt1:_UISform1' or @index='0']/web:button[@id='pt1:MA:0:n1:1:pt1:qryId1::search' or @value='Search' or @index='3']")
                             .click();
                        adf
                        .table(
                                  "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1c9nk1ryzv_6']/web:ADFTable[@absoluteLocator='pt1:MA:n1:pt1:pnlcltn:resId1']")
                        .columnSort("Ascending", "Name" );
         }

  • How to Activate the Table which Doesn't Exist - Can I create Table in SE11

    Hi Gurus,
    I am a BASIS Person ..so, I don't have much idea about ABAP Developement side . But, while applying patches to one of  the SAP Component, I get the following error message ( usr\sap\trans\log ) :
    Phase Import_Proper
    >>>
    SAPAIBIIP7.BID
    1 ED0301 *************************************************************************
    1 EDO578XFollowing objects not activated/deleted or activated/deleted w. warning:
    1EEDO519X"Table" "WRMA_S_RESULT_DATA" could not be activated
    1EEDO519 "Table Type" "WRMA_TT_UPDTAB_DSO" could not be activated
    1 ED0313 (E- Row type WRMA_S_RESULT_DATA is not active or does not exist )
    2WEDO517 "Domain" "WRMA_KAPPL" was activated (error in the dependencies)
    2WEDO517 "Data Element" "/RTF/DE_FISCPER" was activated (error in the dependencies)
    2WEDO517 "Data Element" "/RTF/DE_FISCVARNT" was activated (error in the dependencies)
    2WEDO517 "Data Element" "WRMA_DE_RCLASV" was activated (error in the dependencies)
    2WEDO517 "Data Element" "WRMA_DE_RMA_AMNT" was activated (error in the dependencies)
    2WEDO517 "Data Element" "WRMA_DE_RMA_INV" was activated (error in the dependencies)
    2WEDO517 "Data Element" "WRMA_DE_RMA_OBJ" was activated (error in the dependencies)
    2WEDO549 "Table" "V_WRMA_TRCLASVER" was activated (warning for the dependent tables)
    2WEDO549 "Table" "V_WRMA_TRCLASVPE" was activated (warning for the dependent tables)
    2WEDO549 "Table" "V_WRMA_TRCLPERCL" was activated (warning for the dependent tables)
    2WEDO549 "Table" "WRMA_S_STOCK_SELECTION_DATE" was activated (warning for the dependent tables)
    <<<
    Now, I checked Domain WRMA_KAPPL  in SE11 and it diplays that it is partially active :
    " The obeject is marked partially active for the following reasons :
       Errors occured when adjusting dependent Objects to a change. Some of the dependent objects could not
       be adjusted to this change. To adjust the dependent objects, you must perform the following actions
       the next time you activate this object.
                        - SET THE SYNP TIME STAMP IN THE RUNTIME OBJECT OFALL DEPENDENT OBJECTS
    My question is - how to activate this SYNP Time Stamp.. ?
                          - Once I activate this SYNP Time Stamp.. How do I activate this ..in SE11 or some other
                            TCode..
    Any / ALL Help is highy appreciated and would be rewarded with appropriate Reward Points.
    Thanks,
    Regards,
    - Ishan
    >> Ok, Now I forcefully activated the Domain and then all the 5  Data Elements in SE11 ...now I have error
         that table  WRMA_S_RESULT_DATA  and WRMA_TT_UPDTAB_DSO Could not be activated...
         ..And in SE11 > Input the first / Second Table  > Excute > Output : Table Does not Exist !!!
          - Now, How do I activate something which does not exist in the first place ?
        Any Input about this ?
    Thanks,
    Regards,
    - Ishan
    Edited by: ISHAN P on Jun 19, 2008 3:44 PM

    Read note 1152612 - Incorrect component type in structure WRMA_S_RESULT_DATA.
    The error occurs in Release BI_CONT 703 Support Package 9.
    If you require an advance correction for Support Package 9, make the following manual changes if the InfoObject 0TCTLSTCHG is inactive in your system.
    1. Use transaction RSA1 to call the Data Warehousing Workbench.
    2. Check whether the InfoObject 0TCTLSTCHG was already activated by the compilation process the first time you called transaction RSA1.  You can use transaction RSD1 to check this by entering 0TCTLSTCHG in the "InfoObject" field and choosing "Display".  Proceed as follows if the InfoObject is still not active:
    3. Go to BI Content activation.
    4. Select "Object Types".
    5. Open the "InfoObjects" tree and select "Objects".
    6. Search for the InfoObject 0TCTLSTCHG and select it.
    7. Transfer the object and activate it.
    These steps activate the required component type /BI0/OITCTLSTCHG. You can check again in transaction RSD1 to ensure that the InfoObject 0TCTLSTCHG is available as active.
    Jacek Fornalczyk

Maybe you are looking for