How to 'inner join' internal table or cluster table ??
Hi,
when i inner join table BSEG it said is a cluster table can't be inner joined .
i wonder how i can "inner join" bseg with a internal table such as
data: begin of i_bseg_trans,
bukrs like bseg-bukrs,
gjahr like bseg-gjahr,
belnr like bseg-belnr,
total_runtimes like i_runtimes-total,
already_runtimes like i_runtimes-already,
left_runtimes like i_runtimes-left,
end of i_bseg_trans.
and similar things trouble me when considering several internal tables .
thanks for any help!!
Hi,
but if there's more than 2 tables, for example
data: begin of it_bseg occurs 0,
bukrs like bseg-bukrs,
else_1 type i,
end of it_bseg.
data: begin of t occurs 0,
bukrs like bseg-bukrs,
end of t.
data: begin of r occurs 0,
bukrs like bseg-bukrs,
else type c,
end of r.
select bukrs from bkdf into table t.
select bukrs from bkdf into corresponding fields of table it_bseg.
select bseg~bukrs "else_1
from bseg "it_bseg
into table r
for all entries in t
where bseg~bukrs = t-bukrs.
" and it_bseg-bukrs = t-bukrs.
in the select clause i mean whether there's a method similar to the way just drop the " in my code.
now my solution is to use another loop on it_bseg, but i think when table amount is large this is really a boring solution.
Similar Messages
-
Reg: how to join more than one cluster table into one
Hi gurus
How to join more than one cluster table into one
amkHi,
You cannot join cluster tables
Best way is to select from the header table and then select from the item table table using for all entries of header table.
regards,
Advait -
How to convert Internal Table to Cluster Table ?
How to convert Internal Table to Cluster Table ?
Use :
EXPORT itab TO DATABASE dbtab(ar) ID key.
<i>EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
Additions:
1. ... = f (for each field you want to export)
2. ... FROM f (for each field you want to export)
3. ... CLIENT g before ID key )
4. ... USING form
5. ... FROM wa (as last addition or after dbtab(ar))
In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Implicit field names not allowed with clusters and Table work areas not allowed.
Effect
Stores a data cluster in database table dbtab. The specified objects obj1 ... objn (fields, structures, or tables) are stored as a single cluster in the database table dbtab.
The specified database table dbtab must have a standard structure.
The database table dbtab is divided into various logically-related sections (ar, two-character name).
You can export a collection of data objects (a data cluster) to a part of the database using a key (field key).
You can import individual data objects from this collection using the IMPORT statement.
Notes
In classes, you must always assign explicit names to the data objects you want to export, that is, you must use either addition 1 or addition 2.
In classes, you must always specify the work area explicitly, that is, addition 5 is obligatory.
The table dbtab that appears after DATABAE must be declared under TABLES (except in addition 5).
You cannot export the header lines of internal tables. If you specify the name of an internal table with header line, the system always exports the body of the table.
You cannot export data, object, or interface references.
The data is stored in the database, and is consequently not actually stored until a database commit occurs (see LUW). Until this point, you can undo all of your changes using a database rollback (see Programming Transactions).
Example
Exporting two fields and an internal table to the database table INDX:
TABLES INDX.
TYPES: BEGIN OF ITAB3_TYPE,
CONT(4),
END OF ITAB3_TYPE.
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
F1(4), F2 TYPE P,
ITAB3 TYPE STANDARD TABLE OF ITAB3_TYPE WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 2,
WA_INDX TYPE INDX.
Fill the data fields before CLUSTR
before the actual export
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
Export der Daten.
EXPORT F1 FROM F1
F2 FROM F2
ITAB3 FROM ITAB3
TO DATABASE INDX(ST) FROM WA_INDX ID INDXKEY.
</i>
Regards -
How many SECONDARY INDEXES are created for CLUSTER TABLES?
how many SECONDARY INDEXES are created for CLUSTER TABLES?
please explain.There seems to be some kind of misunderstanding here. You cannot create a secondary index on a cluster table. A cluster table does not exist as a separate physical table in the database; it is part of a "physical cluster". In the case of BSEG for instance, the physical cluster is RFBLG. The only fields of the cluster table that also exist as fields of the physical cluster are the leading fields of the primary key. Taking again BSEG as the example, the primary key includes the fields MANDT, BUKRS, BELNR, GJAHR, BUZEI. If you look at the structure of the RFBLG table, you will see that it has primary key fields MANDT, BUKRS, BELNR, GJAHR, PAGENO. The first four fields are those that all cluster tables inside BSEG have in common. The fifth field, PAGENO, is a "technical" field giving the sequence number of the current record in the series of cluster records sharing the same primary key.
All the "functional" fields of the cluster table (for BSEG this is field BUZEI and everything beyond that) exist only inside a raw binary object. The database does not know about these fields, it only sees the raw object (the field VARDATA of the physical cluster). Since the field does not exist in the database, it is impossible to create a secondary index on it. If you try to create a secondary index on a cluster table in transaction SE11, you will therefore rightly get the error "Index maintenance only possible for transparent tables".
Theoretically you could get around this by converting the cluster table to a transparent table. You can do this in the SAP dictionary. However, in practice this is almost never a good solution. The table becomes much larger (clusters are compressed) and you lose the advantage that related records are stored close to each other (the main reason for having cluster tables in the first place). Apart from the performance and disk space hit, converting a big cluster table like BSEG to transparent would take extremely long.
In cases where "indexing" of fields of a cluster table is worthwhile, SAP has constructed "indexing tables" around the cluster. For example, around BSEG there are transparent tables like BSIS, BSAS, etc. Other clusters normally do not have this, but that simply means there is no reason for having it. I have worked with the SAP dictionary for over 12 years and I have never met a single case where it was necessary to convert a cluster to transparent.
If you try to select on specific values of a non-transparent field in a cluster without also specifying selections for the primary key, then the database will have to do a serial read of the whole physical cluster (and the ABAP DB interface will have to decompress every single record to extract the fields). The performance of that is monstrous -- maybe that was the reason of your question. However, the solution then is (in the case of BSEG) to query via one of the index tables (where you are free to create secondary indexes since those tables are transparent). -
How can I get data in flat file from Pool table and cluster table ?
Hi,
I am working in one Achiving project. My requirement is to get data into flat file from Cluster table and pool table.
Is there any tool avilable to download data into flat file from pool table and cluster table ?
if table name given in the selection screen then data will be downloaded into flat file.
waiting for quick response.
Best Regards,
BansidharData cannot be retrived directly form the cluster table
as the Cluster results are stored in Cluster Key say for example PCLkey
and form that Key we need to fetch the data
these clustes are not the part of PNP or PNPCE tables
for ur info kindly check -
How can we extract unique materials from cluster tables
I want to get unique materials from CDPOS table( which is a cluster table) when i use SELECT distinct its giving me syntax error
Hi,
I don't think you can use select distict for material in table CDPOS (cluster table). You can only use distinct * or count ( * ) aggregation function.
Regards,
Ferry Lianto -
Inforation on Pool tables and cluster tables required.
I want to know about the pool tables and cluster tables like how to create them and how to look the tables associated with the given tables. Like for the table BSEG we have other tables linked BSID etc. I'm new to this concept please guide me.
<b>Pooled Table:</b>
A pooled table in R/3 has a many-to-one relationship with a table in the database (see Figures 3.1 and 3.2). For one table in the database, there are many tables in the R/3 Data Dictionary. The table in the database has a different name than the tables in the DDIC, it has a different number of fields, and the fields have different names as well. Pooled tables are an SAP proprietary construct.
When you look at a pooled table in R/3, you see a description of a table. However, in the database, it is stored along with other pooled tables in a single table called a table pool. A table pool is a database table with a special structure that enables the data of many R/3 tables to be stored within it. It can only hold pooled tables.
R/3 uses table pools to hold a large number (tens to thousands) of very small tables (about 10 to 100 rows each). Table pools reduce the amount of database resources needed when many small tables have to be open at the same time. SAP uses them for system data. You might create a table pool if you need to create hundreds of small tables that each hold only a few rows of data. To implement these small tables as pooled tables, you first create the definition of a table pool in R/3 to hold them all. When activated, an associated single table (the table pool) will be created in the database. You can then define pooled tables within R/3 and assign them all to your table pool.
Pooled tables are primarily used by SAP to hold customizing data.
<b>Cluster Table:</b>
A cluster table is similar to a pooled table. It has a many-to-one relationship with a table in the database. Many cluster tables are stored in a single table in the database called a table cluster.
A table cluster is similar to a table pool. It holds many tables within it. The tables it holds are all cluster tables.
Like pooled tables, cluster tables are another proprietary SAP construct. They are used to hold data from a few (approximately 2 to 10) very large tables. They would be used when these tables have a part of their primary keys in common, and if the data in these tables are all accessed simultaneously.
Table clusters contain fewer tables than table pools and, unlike table pools, the primary key of each table within the table cluster begins with the same field or fields. Rows from the cluster tables are combined into a single row in the table cluster. The rows are combined based on the part of the primary key they have in common. Thus, when a row is read from any one of the tables in the cluster, all related rows in all cluster tables are also retrieved, but only a single I/O is needed.
A cluster is advantageous in the case where data is accessed from multiple tables simultaneously and those tables have at least one of their primary key fields in common. Cluster tables reduce the number of database reads and thereby improve performance.
Restrictions on Pooled and Cluster Tables
1. Pooled and cluster tables are usually used only by SAP and not used by customers, probably because of the proprietary format of these tables within the database and because of technical restrictions placed upon their use within ABAP/4 programs. On a pooled or cluster table:
2. Secondary indexes cannot be created.
3. You cannot use the ABAP/4 constructs select distinct or group by.
4.You cannot use native SQL.
5.You cannot specify field names after the order by clause. order by primary key is the only permitted variation.
For creation of pooled /cluster table, have a look at below link.
http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
For creation of table pool /cluster, have a look at below link.
http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
Have a look at below link.
http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm
Best Regards,
Vibha
*Please mark all the helpful answers -
Generic extractors on pool table and Cluster tables
Good Afternoon all,
Can we create generic extractors on Cluster or pool Table. If yes Let me know how?
I am trying to create a Generic Extractor on BSEC Table but it is not allowing me to do this. It throws error that"Extraction from pool tables and cluster tables is not permitted"
Kindly guide me on this
Thanks,
Vaishali.Hi
you cannot do generic extraction directly on pooled or cluster tables.
You can create a function module, then you can create a Generic Data source based on this..
Hope it helps,
Thanks,
Teja
Edited by: Teja badugu on Apr 15, 2008 12:24 PM -
How to use inner joins for 4 0r 5 tables
Hai Experts,
plz check my code, n plz help to inner join all the tables
TYPES : BEGIN OF ITAB,
EBELN TYPE EKKO-EBELN, "P.O.NUMBER
AEDAT TYPE EKKO-AEDAT, "DATE
BPRME TYPE EKPO-BPRME, "UNIT PRICE
MENGE TYPE EKPO-MENGE, "Purchase order quantity
WERKS TYPE EKPO-WERKS, "PLANT
BRTWR TYPE EKPO-BRTWR, "Gross order value in PO
STRAS TYPE LFA1-STRAS, "House number and street
LIFNR TYPE LFA1-LIFNR, "VENDOR NO
NAME1 TYPE LFA1-NAME1, "V NAME
ORT01 TYPE LFA1-ORT01, "CITY
LAND1 TYPE LFA1-LAND1, "LAND
PSTLZ TYPE LFA1-PSTLZ, "POSTAL CODE
MAKTX TYPE MAKT-MAKTX, "DESCRIPTION
END OF ITAB.
<b>and i got stucked here:</b>
<u></u>
SELECT EKKO~EBELN
EKKO~AEDAT
EKPO~BPRME
EKPO~MENGE
EKPO~WERKS
EKPO~BRTWR
LFA1~LIFNR
LFA1~STRAS
LFA1~NAME1
LFA1~ORT01
LFA1~LAND1
LFA1~PSTLZ
MAKT~MAKTX
INTO TABLE ITAB
FROM EKKO
INNER JOIN EKPO LFA1 T001W MAKT
ON EKKOEBELN = EKPOEBELN
EKKO~EBELN
WHERE EKKO~EBELN IN S_EBELN.hi Rajesh,
you have to join the tables one by one:
SELECT ekko~ebeln
ekko~aedat
ekpo~bprme
ekpo~menge
ekpo~werks
ekpo~brtwr
lfa1~lifnr
lfa1~stras
lfa1~name1
lfa1~ort01
lfa1~land1
lfa1~pstlz
makt~maktx
INTO TABLE itab
FROM ekko AS ekko
INNER JOIN ekpo AS ekpo
ON ekkoebeln EQ ekpoebeln
INNER JOIN lfa1 AS lfa1
ON ekkolifnr EQ lfa1lifnr
INNER JOIN t001w AS t001w
ON ekpowerks EQ t001wwerks
INNER JOIN makt AS makt
ON ekpomatnr EQ MAKTmatnr
WHERE ekko~ebeln IN s_ebeln.
This is the complete SELECT. BUT! The performance will be much better if you take out T001W and MAKT from the INNER JOIN. Do select on these tables in separate steps and merge the internal tables afterwards.
hope this helps
ec -
How to get the data from a cluster table to BW
Dear All,
I want to extract the data from R/3 to BW by using 2 tables and one Cluster B2.
Actually my report contains some fields from PA2001, PA2002 and one cluster table B2 (Table ZES). Can I create View by using these 3 tables? If it is not possible how can I get the data from the cluster? Can I create generic datasource by using cluster tables directly?
In SE11 Transaction the Cluster (table ZES) is showing invalid table.
I referred some Forums, but no use.
Can any body tell me procedure to get the data from a cluster (table ZES) ?
Waiting for you results.
Thanks and regards
RajeshHI Siggi,
Thank you for your reply..
I am also planning to do FM to get the data. But it is saying that the Cluster table ZES does not exist (ZES is the the standard table, in SE11 also).
How can I use the Fields from the that table.?
What can I do now, can you please explain me about this point.
Waiting for your reply.
Thanks and Regards
Rajesh
Message was edited by:
rajesh -
How can i join the header and item table to fetch the data
hi experts,
i have a doubt in using inner join or for all entries, for fetching the data from the item table mseg, by taking the doc.no from mkpf. Plz sort out the difference, what happens, if i use the both statements for fetching dataHi,
Both has same functionality.
but if u are using FAE, u ahev to check for the
~intial condition of the source table,
~ duplicate entries, if any
Inner join will fetch the data from all the join tables at once. FAE will fetch the date from a table first then use that data to fetch data from subsequent table.
say in ur case, if u r using FAE,
1.select from mkpf.
2.select from mseg fae in I_MKPF.
first try using JOIN. if it is taking lots of time, then try FAE.
regards,
madhu -
Inner join-select -primary key in table issue
Hi ,
Iam using FEBKO(header) and FEBEP(item) in inner join select .But the datas fetching by this selct in not correct.The analysis is the is no common primary fields in the both table.
Question 1-> Can i use inner join without common primary key in the both tables, weather it possible to make a select without common primary key in both table. Please kindly let me know.
Question 2-> What is the other possible way to give the selct for both table(better performance)
Regards,
VeeraHi,
When you use INNER JOIN in this case, link your tables based on KUKEY and ESNUM fields, bcoz there can be many items under a single header. So this will work for you, even from the performance point of view.
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T -
Hello Friends,
I have replicated the transparent tables by applying filters in IUUC_REPL_CONTENT but I know it's different for Cluster tables.
Does anyone replicated the BSEG or CDPOS ?
I need some inputs on this folks.
Thanks in advance.
Regards
RajaMay be this is helpful - http://scn.sap.com/community/replication-server/blog/2014/02/25/how-to-filter-on-the-initial-load-parallelize-replication
-
How to inner join attribuet from user with system resource on sccm 2012 query
Hi , I am using SCCM 2012. Trying to create a WQL query to get list of computers with department name and netbios names,etc. these are in USER and SYSTEM RESOURCE object type seperately. The query wizard doesn't allow me to choose sytem
resource and USER attribute at same time. In JOIN, the inner join also doesn't have SYSTEM RESOURCE attribute class for me to join it with USER attribute class. Any way to resolve this issue so that I can get a query as mentioned?
I tried the wql below and pasted to my test query, it gave an error. I guess it's because that wql is on sccm2007.
Please advise,thanks!
http://social.technet.microsoft.com/Forums/en-US/8c47f069-5390-45bd-a619-5f5498947baa/sccm-query-which-joins-system-resource-and-user-resource?forum=configmgrgeneral
http://social.technet.microsoft.com/Forums/en-US/8c47f069-5390-45bd-a619-5f5498947baa/sccm-query-which-joins-system-resource-and-user-resource?forum=configmgrgeneral
Thanks and best regards, -- KFHi,
Try the suggestion by Garth Jones or post a new thread at
http://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG
I am not familiar with WQL, maybe you could get better help at the forum above.
Juke Chou
TechNet Community Support -
Hi,
Please can any one tell me that how can we find transperent tables in the Cluster table.
Eg: KONV is cluster of which all tables.
Thanks
SameerHi Vikash,
Follow the steps.
<li>SE11->KONV->Display
<li>Click on Delivery and Maintenance tab
<li>Double click on Table Cluster KOCLU.
<li> Place cursor on KOCLU and use Where-Used List. You will find list of Cluster tables attached to Table Cluster. In your case only one entry is found.
<li>You can follow same procedure for BSEG,
<font color=red>Small correction:</font>Logically related cluster tables can be stored together in Table cluster(Not Cluster pool).
Regards,
Venkat.O
Maybe you are looking for
-
Pls All Prof I need HELP !! ADOBE ACROBAT PRO 9.0.0
Hi all profs am glad to ask you and be wid you in here .. am working in a printing press environment and i'm new user of acrobat 9 i have a problem with printing any b;ack & white PDF document as a gray scale the output is not 100% pure black for exa
-
Hi Experts, Ssytem details:PI7.1, While processing messages from source system to PI system. we are getting the below error : PLAINHTTP_ADAPTER ATTRIBUTE_CLIENT HTTP client code 400 ICM_HTTP_CON_FAILED The messages get stuck while processing from so
-
Setting first visible row in Web Dynpro ALV in Releases above 7.0
Hello Everybody, I have an ALV in which a particular row should be set to lead selection and also set as the first visible row in this ALV for the first display. The index for this row is determined at runtime. I used the method SET_FIRST_VISIBLE_ROW
-
How to read multiple documents from a system directory?
Hi, I'm trying to read multiple documents from a specific folder that contains pdfs, jpgs... the only activity I found is the Read Document, but this activity does not have the option to read all docs under my folder!. so any one can tell me if there
-
Real-Time Collaboration Instant Messaging & .wmv video ?
Hi, is posible using the last version Netweaver 2004s and Netweaver 2004s BI for some <b>Real-Time Collaboration Instant Messaging</b> for speak to users depending the costcenter and territory area ? So idea is show too video .wmv for Principal Direc