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

data dictionary questions

Former Member
0 Likes
1,523

hi all,

please let me know the answer for the following questions.

1.how many primary key can be given for a table.

2.how many structures can be appended to a single table.

3.wat is the use of structures

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,234

1.SAP supports maximum 16 primary keys in a table. The total length of the primary keys should not exceed 120 characters for a table.

2. You can append maximum 9 structures in a table.

Regards,

Jeniphin

7 REPLIES 7
Read only

Former Member
0 Likes
1,234

Hi,

check this link.

[DATA DICTIONARY|http://www.sapbrainsonline.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html]

Regards,

Balakumar.G

Reward Points if helpful.

Read only

Former Member
0 Likes
1,234

Hi Suprith,

1) though many fields could be included in the primary key, there could be only one primary key for a table. When one field can identify a record uniquely for a table it could be called a primary key and hence there is a possibility of only a single primary key for a table. If a combination of many fields together could identify a unique record from a table then that combination is called a composite key.

2) I do not think there is a limit to the number of structures that you could append to a table until there is enough table space.

3) If you maintain structures then we could group identical data together. We could have the structure defnitions even in program to declare the internal tables. Structures could be used as parameters in FM's to send a whole record data together at one shot.

Reward points if this info helps,

Kiran

Read only

Former Member
0 Likes
1,234

hi ,

we cannot say how many ...but depending on the module(sd,mm,pp,hr) and depending on the table fields and relations it will be given..

there is only one strucute for a given table ..ex : mara table had structure mara......ekko table had structure ekko......

it is used to define empty tables(means in defining the itabs)

data:begin of itab occurs 0.

include mara.

data: end of itab.

or

data: it_mara type mara(structute) occurs 0 with header line.

regards,

venkat.

Read only

Former Member
0 Likes
1,234

Hi,

1. A table has one or more primary key fields.

2. An append structure is a structure which is assigned to exactly one table. There can be several append structures for a table. When a table is activated, all the active append structures for the table are found and their fields are appended to the table. If an append structure is created or changed, the table to which it is assigned is also activated and the changes also take effect there when it is activated.

3. The advtge of Structures is for GLOBAL EXISTENCE(these could be used by any other program without creating it again)

A structure is a sequence of any elementary types, reference types, or complex data types.

You use structures in ABAP programs to group work areas that logically belong together. Since the elements of a structure can have any data type, structures can have a large range of uses. For example, you can use a structure with elementary data types to display lines from a database table within a program. You can also use structures containing aggregated elements to include all of the attributes of a screen or control in a single data object.

The following terms are important when we talk about structures:

Nested and non-nested structures

Flat and deep structures

A nested structure is a structure that contains one or more other structures as components. Flat structures contain only elementary data types with a fixed length (no internal tables, reference types, or strings). The term deep structure can apply regardless of whether the structure is nested or not. Nested structures are flat so long as none of the above types is contained in any nesting level.

Any structure that contains at least one internal table, reference type, or string as a component (regardless of nesting) is a deep structure. Accordingly, internal tables, references, and strings are also known as deep data types. The technical difference between deep structures and all others is as follows. When you create a deep structure, the system creates a pointer in memory that points to the real field contents or other administrative information. When you create a flat data type, the actual field contents are stored with the type in memory. Since the field contents are not stored with the field descriptions in the case of deep structures, assignments, offset and length specifications and other operations are handled differently from flat structures.

Reward points if useful.

Regards

Rose

Edited by: Rose Preethi on Mar 25, 2008 1:39 PM

Read only

Former Member
0 Likes
1,234

Hi.

1. A table should have atleast one primary key field to ensure the integrity of information resided regardless of the no of fields to be identified as primary key fields.

2. A structure can contain another structure. In other words, you can nest structures one within another. This can be used to reduce maintenance by grouping fields together into a structure and then including that structure within another structure, or even within a table. One can append a max. of 9 with a table.

3.STRUCTURES :

structures can also be defined in the Data Dictionary. As you might expect, a structure is a series of fields grouped together under a common name. It is very similar to a table. Like a table, it can be used within a program on the tables statement to define a work area.

The differences between a structure and a table are as follows:

A structure doesn't have an associated database table.

A structure doesn't have a primary key.

A structure doesn't have technical attributes.

Structures follow the same naming conventions as transparent tables, and you cannot have a table and structure of the same name.

You would create a structure in the DDIC if you wanted to define the same work area in multiple programs. For example, if you wanted to write records to a sequential file using one ABAP/4 program and then read them in using another, both programs need to know the layout of those records. You would create a structure in the DDIC that defines the record layout, and then name that structure on the tables statement in both programs. This would create an identical work area in both programs.

Read only

Former Member
0 Likes
1,234

total 9 structures you can append in table

reward if you satisfy

Read only

Former Member
0 Likes
1,235

1.SAP supports maximum 16 primary keys in a table. The total length of the primary keys should not exceed 120 characters for a table.

2. You can append maximum 9 structures in a table.

Regards,

Jeniphin