Re : maex table
hai
any body tell me what is the purpose of maex table(legal control).
what are the things we have to up load.
thank you
regards
geetha
Hi,
Legal Control data is to be maintained for example, if there is any exemption of duty applicable for the material in the case of imports, for example.
There will be a certification of Examption allowed for such material, issued date of certificate, the number of the certificate etc, to be maintained in it. It is required for foreign trade application only. If the material is not required to be involved in either import or exports, that need not be filled. It is required if GTS or Foreign trade submodule of SAP is implemented.
Regards
Similar Messages
-
Need BAPI or Function Module to update MAEX Table
Hi Experts !!
I need to update the MAEX table in mass level through a batch job.
Updating the table directly is not recommended. So, a BAPI or a FM would have helped.
One more thing, if I update it through a BAPI or FM, will the change history log in MM02 or MM03 be maintained automatically by SAP ?
Also if I directly update the MAEX table, how to maintain the change history log ?
Below are the fields which I want to update.Those FM are update FM (check with SE37) called at end of transaction after checking data validity and must not be called alone in a customer program, using those FM is not better than direct SQL update of database (or you actually want to duplicate SAP standard checking and find every update FM to call, wrong idea usually)
Read also 1710449 - Transaction MM17 (Mass Change) or BAPI BAPI_MATERIAL_SAVEDATA does not support update on database table MAEX. So nowadays the correct solution is the use of Batch Input
Regards,
Raymond -
Material change tracking(MAEX data).
Hi,
For a given material i want to known whether the MAEX table entries are been changed.
Through MM04 we can known but i want known is there any table or FM for this..
Please reply back if i am not clear...
santhoshcheck How sap is doing .
In MM04 program search for FM
CHANGEDOCUMENT_READ_HEADERS
u can get the data from tables CDHRD/CDPOS. And u have to find out which class to u have to from that FM in MM04.
Regards
Prabhu -
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 -
Hello,
I'm getting Material Master Data in individual internal tables as below. Can some one please suggest how do I combine the data from different tables in to a single table based on Material Number.
I.e. Tables in which I get data based on Matnr are
mara
makt
marc
mvke
maex
mbew
mlan
klah
cabn
ausp.
Please suggest me on which internal table I should loop and which Internal table I should read.
Cheers,
Badamlalit,
Thanks for Quick response. I'm attaching the peice of code for your understanding. I've to include data from MAEX , MBEW ,MLAN , KLAH , CABN , AUSP in to final Internal Table lw_mat.Please note that final internal table lw_mat contains all the fields from the above tables.Kindly suggest do i need to loop or read on the below tables.
LOOP AT lt_mara INTO lw_mara.
*-Populate the Fields from mara to the Output Internal Table
MOVE-CORRESPONDING lw_mara TO lw_mat.
*-Populate the Material Descritpion to the output Internal Table
READ TABLE lt_makt INTO lw_makt WITH KEY matnr = lw_mara-matnr.
IF sy-subrc = 0.
MOVE-CORRESPONDING lw_makt TO lw_mat.
ENDIF." if sy-subrc = 0.
LOOP AT lt_marc INTO lw_marc WHERE matnr = lw_mara-matnr.
*-Populate the Plants to the output Internal Table
MOVE-CORRESPONDING lw_marc TO lw_mat.
*-Populate the Sales Organizations to the output Internal Table
READ TABLE lt_mvke INTO lw_mvke WITH KEY matnr = lw_marc-matnr
vkorg = lw_marc-werks.
IF sy-subrc = 0.
MOVE-CORRESPONDING lw_mvke TO lw_mat.
APPEND lw_mat TO lt_mat.
ENDIF." if sy-subrc = 0.
ENDLOOP. "loop at lt_marc
CLEAR lw_mat.
ENDLOOP. " LOOP AT lt_mara -
Hi,
I am writing a program.
It has a select statement with joins on 6 tables.
select LIKPBOLNR LIKPROUTE LIKPVBELN LIKPVSTEL LIKPWADAT_IST LIPSANZSN LIPSPOSNR LIPSVBELN VBFAPOSNN VBFAPOSNV VBFA~VBELN
VBFAVBELV VBFAVBTYP_N VBRPALAND VBRPBRGEW VBRPFKIMG VBRPGEWEI VBRPMATNR VBRPNETWR VBRPPOSNR VBRPVBELN VBRP~VRKME
VBRPWERKS MAEXALAND MAEXALNUM MAEXMATNR MARCMATNR MARCSTAWN MARC~WERKS
into (LIKP-BOLNR , LIKP-ROUTE , LIKP-VBELN , LIKP-VSTEL , LIKP-WADAT_IST , LIPS-ANZSN , LIPS-POSNR , LIPS-VBELN , VBFA-POSNN
, VBFA-POSNV , VBFA-VBELN , VBFA-VBELV , VBFA-VBTYP_N , VBRP-ALAND , VBRP-BRGEW , VBRP-FKIMG , VBRP-GEWEI , VBRP-MATNR
, VBRP-NETWR , VBRP-POSNR , VBRP-VBELN , VBRP-VRKME , VBRP-WERKS , MAEX-ALAND , MAEX-ALNUM , MAEX-MATNR , MARC-MATNR
, MARC-STAWN , MARC-WERKS )
from ( LIKP
inner join LIPS
on LIPSVBELN = LIKPVBELN
inner join VBFA
on VBFAPOSNV = LIPSPOSNR
and VBFAVBELV = LIPSVBELN
inner join VBRP
on VBRPPOSNR = VBFAPOSNN
and VBRPVBELN = VBFAVBELN
inner join MAEX
on MAEXALAND = VBRPALAND
and MAEXMATNR = VBRPMATNR
inner join MARC
on MARCMATNR = MAEXMATNR
and MARCWERKS = VBRPWERKS )
where LIKP~BOLNR in SP_01
and LIKP~ROUTE in SP_02
and LIKP~VBELN in SP_03
and LIKP~VSTEL in SP_04
and LIKP~WADAT_IST in SP_05
and VBFA~VBTYP_N in SP_06
and VBRP~MATNR in SP_07.
Can I use the above join? will it affect the performance of the programIf you want to use a join of six tables then you have to work carefully.
You must ckeck which table should be selected first, for which one doi you have condition in the where condition, are they selective, what index
do they use, how large is the table.
For the next tables you have on-condition maybe plus additional where conditions. Again what index is use, how selective is it, how large is the table.
In the optimal case you have all not the last field of a primary index on table A and in the on conditions always the primary key fields of the other
table B, C, D, E and F. In this case even a join of 6 tables works fine and is much faster than any FOR ALL ETRIES solution.
In real-life it will be more complicated. You should restrict the join to a small set which is quite clear and add the rest with FAE.
If you don't want to think about it, then you use immediatley FAE after the first select you will get some suboptimal performance.
Siegfried -
Hi ,Plz send list of tables in MM
HI,
Send mail 2 [email protected]MAKT : Material Descriptions
MARM : Unit Of Maesure for Material
MAKG : Material Cost Distribution groups
MAKV : Material Cost Distribution
MARV : MAterial Control Record
MABW : Management of differenly maintained material data
MAEX : Material Master - Legal Control
MAKZ : Material Cost Distribution Equilance No.
MAMT : Material Master Text per unit of measure & Text ID
MAPE : Material Master Export Control File
MATERIALID : Material Identification
MATERIALIDDI_TMP : File for incorrect data in direct input
MARI : Short Document - Material Movement
Also Check http://www.sap-img.com/sap-mm.htm
http://www.sap-img.com/materials/common-tables-used-by-sap-mm.htm
http://www.sapgenie.com/abap/tables_mm.htm
http://www.sap-img.com/sap-download/sap-tables.zip
http://www.allsaplinks.com/material_management.html
http://www.training-classes.com/course_hierarchy/courses/2614_SAP_R_3_MM_Invoice_Verification_-_Rel_4_x.php
http://www.sapfriends.com/sapstuff.html
Hope it helps.
Regards -
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 MHi,
Please check the below links...
Query for Opening And Closing Stock
Inventory Opening and Closing Stock
open stock and closing stock
Kuber -
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 PMI 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 PMI 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 AMHi,
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" );
}
Maybe you are looking for
-
Can't transfer apps from itunes after installing ios 7?
I installed ios 7 from itunes 11.1 and now when I sync my iphone, each apps get downloaded and installed but then it doesn't open. When I tap the app it shows installing (again) but after that nothing happens. And all the apps doesn't disappears even
-
Looping the same answer from the 1st row in the table
I have a database with 3 tables: (1) employeeTable (2) cityTable (3)stateTable. I reference the employee's city name and state code by each id number from the cityTable and stateTable. My Employee table has about 10 records, 3 has an idcity and idsta
-
How to repair .cshrc file ?
Hello, I this get error when my solaris 10 start : //.cshrc: syntax error at line 4: '(' unexpected my .cshrc file : "//.cshrc" 33 lines,840 characters #@(#)cshrc 1.1 89/11/29 SMI umask 022 set path=(/usr/bin /bin /usr/sbin /etc) setenv JAVA_HOME "/u
-
What recordset now called can somebody please correct this code? MIchael Horton
Private Sub ShowRecord_Click() Dim rst As DAO.Recordset Set rst = [Forms]![Assets].RecordsetClone rst.FindFirst "InvestID=" & List2 [Forms]![Assets].Bookmark = rst.Bookmark DoCmd.Close acForm, "GoToRecordDialog" End Sub
-
Maximum number of characters in displacement file
Is there a maximum number of characters that can be in the name of a saved displacement file? When I save a displacement file with 12 characters or less, the Filter>Distort>Displace works fine; when I save the same file with 13 characters, nothing ha