Application Development 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: 

STRUCTURE

Former Member
0 Kudos

Hi,

I know structure is table with no data in it that is its a dummy table with fields....

so my question is what is the use of structure and where it is used ?

Thanks.

7 REPLIES 7

Former Member
0 Kudos

hi

<b>Structure is a reusable one , in structure we have characteristics, key figures, calculated KF's , Restricted KF's . if you create a structure in one query means , as it is reusable one , u can use the same strucutre in multiple queries of the same infocube. One infocube is obviously having number of queries, if you create one structure you can use the same for different queries of the same infocube. these are stored in the metadata repository.

I hope this will help u a lot.</b>

FOLLOW THE LINK

http://help.sap.com/saphelp_nw70/helpdata/en/4d/e2bebb41da1d42917100471b364efa/frameset.htm

hope it clears ur doubt

regards

ravish

<b>plz dont forget to reward points if useful</b>

Former Member
0 Kudos

Hi,

when ever we are using the same code repeatedly in

the programm

we store it in a subroutine so that we can use it n number of times

in order to avoiding the writing code so many times

so in the same fashion when ever we use the common structure n number

of times in several programmes we declare that internal table as a structure

so that every one having similar kind of requirements can use the same structure

so reusability is the major advantage of structure and it wont occupy any

memory in the database as it doesnot store data...

reward points if helpful

thanks & regards,

venkatesh

Former Member
0 Kudos

HI

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.

The procedure for creating a structure is almost the same as for creating a transparent table. (Please refer to the procedures for creating a transparent table.) The only differences are the following:

Instead of the Tables radio button, choose the Structures radio button.

The Delivery Class and Tab.Maint.Allowed fields do not appear.

Structures do not have a primary key.

No technical attributes can be specified, such as data class, size category, or buffering.

Structures are used to define the data at the interface of module pools and screens and to define the parameter types of function modules

http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7301b1af11d194f600a0c929b3c3/content.htm

REGARDS

DINESH

Former Member
0 Kudos

Hi

Structure contains data at run time.

Structures are data objects that are made up of components of any data types that are stored one after the other in the memory. The data type of a structure is a structured type or a structure or database table defined in the ABAP dictionary.

In a program, a structured type or a structure is generated with the additions BEGIN OF ... END OF of statements TYPES, DATA etc. As of release 6.40, dynamic generation with methods of the RTTC is also possible.

Depending on the kinds of components, structures are designated as followed:

Flat structures do not contain any deep components.

Flat character-like structures are flat structures that contain only character-like components. These can be used in the same way as elementary character-like data objects. This is not the case particularly for structures that contain strings.

Nested structures contain at least one sub-structure. Whether a nested structure is flat or character-like depends on all the components in it.

Deep structures contain at least one deep component at any nesting level.

Depending on whether a structure contains static or dynamic components, it is formally either a static or dynamic data object.

Regards

Ravish Garg

<b>

Reward if useful</b>

0 Kudos

Hi,

Structure is a way of grouping the ralted information on to one UNIT.

Once you group them you can then use it as a DATA TYPE and create variable of that data type.

So you create strcutre to represent some entity's data like a bank account etc.

So in your program if you want a datatype to represent a bank account then you create a strcutre that will group all the info related to a bank account and then in your program create a variable of that strcutre.

So the use is to represent group of related information and then using it as a data type to create variables.

in ABAP we can create table types to create internal tables whose line type will be this strcutre.

Regards,

Sesh

Former Member
0 Kudos

Hi,

Well, there could be a few reasons why, a structure could be used as a work area. So if you have an internal table, and you read it into a work area to write it out, then you would be using a structure to do so

you could simply use a structure in your program to group like fields together. So that you could maybe clear them all at one shot.

For example, say that you have a structure with fields a - z.

data: begin of structure,

fielda type c,

fieldb type c,

fieldc type c,

.....

fieldz type c,

end of structure.

So in your program, it is now important for you to clear these fields, if you would have defined them one by one without the structure, you would have to list them all in your CLEAR statement, but instead, since you have them in a structure, you can some say.... CLEAR STRUCTURE.

Regards

Former Member
0 Kudos

hi

The <b>differences between a STRUCTURE and a DATABASE TABLE</b>:

1. Structure does not store data whereas Tables can store data.

2. You will have to specify technical settings when you create a table in SE11 Where as you wont while creating a structure.

Technical settings basically contains data class, size category, and buffering type.

3. You can indexes for a table where as there will no indexes for a structure.

4. Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined with their (database-independent) data types and lengths.

When the table is activated, a physical table definition is created in the database for the table definition stored in the ABAP Dictionary. The table definition is translated from the ABAP Dictionary to a definition of the particular database.

Structure does not exist at the underlying data base level. Structure exists as Definition in the Dictionary.

5. In a database table, you can only include flat structures as substructures

The differences between a STRUCTURE defined in a program and an INTERNAL TABLE:

1. Structure can hold only one value at a time whereas internal table can hold multiple records.

2. You can specify table type while defining an internal table but not for a structure.

3. You can use loop statement for an internal table but nor for a structure.

The difference between internal tables and database tables:

  • The basic difference is database tables are stored in DB server and the internal tables are virtual tables these are created run time only

  • Internal tables are created dynamically, the memory of internal tables is not

permant memory, for internal tables the memory will be created in the application server and it is external memory and terminates after the program termination.

There are there types of structure:-

1. Flat structure( elementary fields)

2. Nested structure ( type reference to other structure)

3. deep structure ( type reference to database tables)

<b>reward points for useful ans</b>

Regards

Vivek