Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Clustered Tables

Former Member
0 Likes
733

Hi Experts,

1. Can anyone explain what cluster are ?

2. How to access them using ABAP coding?

Kindly mail any materials (if available) to these mail addresses....

[email protected]

[email protected]

Thanks for the same,

Best Regards,

Aravind

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
670

Hi Experts,

1. Can anyone explain what cluster are ?

2. How to access them using ABAP coding?

Kindly mail any materials (if available) to these mail addresses....

[email protected]

[email protected]

Thanks for the same,

Best Regards,

Aravind

4 REPLIES 4
Read only

Former Member
0 Likes
670

Hi,

1) cluster tables are used to store data related to table changes or

system specific data.

example of cluster table :komv,cdhdr,cdpos.

when any changes are made in transaction relevant tables get updated

this change information is stored in cdhdr,cdpos.

inner join is not possible with cluster tables.

2) select query can be written on cluster tables as any other transparent

tables to fetch data with abap coding.

cluster table performance may be issue as sixe of tale will be huge.

use full key to access cluster table

for material check help.sap.com

Regards

amole

Read only

Former Member
0 Likes
670

dataclusters r nothing but database tables which store raw data.

firstly u need to create a cluster table :

a cluster table has a fixed format as follows ,

If the table contains client-specific information, the first field must have the name MANDT (DD-Typ CLNT) .

The field RELID (Dictionary type CHAR, length 2) contains the area ID.

These are followed by table-specific key fields which must all be of type CHAR. They contain the freely definable key of the data clusters.

The field SRTF2 (Dictionary type INT4) is the last field in the key. Its values are assigned automatically through export/import operations.

This is followed by any number of fields which are not affected by the EXPORT statement. You must assign values to these fields explicitly before an export.

The data part ends with the fields CLUSTR (Dictionary type INT2) and CLUSTD (Dictionary type LRAW). Both fields are assigned values automatically through export/import operations.

now all u need to do is store ur program variables in this table as follows .

gs_variant_key-report = sy-repid.

gs_variant_key-myvariant = 'ZTRYING'.

EXPORT e_a = gv_a

e_b = gv_b

e_c = gv_c

et_tab = gt_tab

TO DATABASE zswapclustertab(s1) ID gs_variant_key .

where 's1' is rel-id and gs_variant_key is my own additional key .

similarly to retrieve these values use the foll code .

import e_a = gv_a

e_b = gv_b

e_c = gv_c

et_tab = gt_tab

from DATABASE zswapclustertab(s1) ID gs_variant_key .

i think this should help u .

if helpful then plz reward points .

Read only

anversha_s
Active Contributor
0 Likes
671
Read only

Former Member
0 Likes
670

Hi aravindakshan,

1. Can anyone explain what cluster are ?

Clusters are nothing but tables.

They store the data in RAW/ENCODED format,

and hence, we cannot understand by directly seeing the records.

(They are used bcos LOTS of data needs to be entered in 1 record,

so the special field RAW/ENCODED is used to store all this data, in the table)

2. How to access them using ABAP coding

For accessing them, we should know in what format

the data was put inside the cluster table.

Then we have to use the IMPORT command to get the data.

regards,

amit m.