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

Diff b/w Structure and work area

Former Member
0 Likes
2,148

can u tell me the difference between structure and work area?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,819

hi senthil,

if u want know difference between wa and structure you first learn about those two then you can able to find the diff. I hope this is usefull.

11 REPLIES 11
Read only

Former Member
0 Likes
1,819

Hi Senthil,

STRUCTURE:

Structures contains group of fields under a common name. It is similar to database table but it does not have the contents, primary keys and technical attributes.

WORKAREA:

WorkArea can store one record at a time.

Structure does not contain any data.

work area contains only single record of that structure.

types : being of ty_tab,

matnr type mara-matnr,

ernam type mara-ernam,

end of ty_tab.

data : it_tab type standard table of ty_tab initial size 0. (this is internal table of type ty_tab

data : is_tab type ty_tab. ( this is work area for the structure ty_tab)

Regards,

Priyanka.

Read only

0 Likes
1,819

Hi priyanka,

Thnks for ur reply, i have one doubt that we can store one record in structure also right..

ty_tab-matnr = value.

ty_tab-ernam= value.

thats what i am getting confused.. is there any memory will be alotted to structure or what can u make it clear?

Read only

0 Likes
1,819

Hi Senthil,

As per the auestion I understood that u wanted to ask whether there is any memory allocated for a structure.

So the answer is that the Memory is allocated for the structure only at the runtime.

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

0 Likes
1,819

sorry i am not enough clear what you are telling the memory by

ty_tab-matnr = value.

but though structure is in database you cannot insert any value to it structure is only containing one set of value at run time (it may be from your screen or any thing and you have to only assign the value). so it is not like table and every time it will run it may contain different value (as you will ssign to it)..

regards

shiba dutta

Read only

0 Likes
1,819

Structure can be globally declared in SE11.

Create work areas locally in your programs.

Read only

0 Likes
1,819

Hi Azeem,

we can also declare structure in our program na..

Read only

Former Member
0 Likes
1,819

At the outset, there cannot be a comparision made between structure and workarea as the Structure is used to define a work area.

Talking about how they are defined and work, Structure is the Data Dictionary element and Workarea is what u define in the program (this is the only difference i can see.). Also Workareas are called INTERNAL DATA OBJECTS and Structures are EXTERNAL DATA OBJECTS defined in the data dictionary.

Workareas are intended to store one record at anytime and structures are just Skeletons based on which workareas are defined

Read only

Former Member
0 Likes
1,819

hi

A structure is a user-defined sequence of data types. It fully defines the data object. You can either access the entire data object, or its individual components. ABAP has no predefined structures. You therefore need to define your own structures, either in the ABAP program in which you want to use it, or in the ABAP Dictionary.

You use structures in ABAP programs to group work areas that logically belong together. Since the individual elements within a structure can be of any type, and can also themselves be structures or internal tables, the possible uses of structures are very wide-ranging. 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.

Read only

Former Member
0 Likes
1,820

hi senthil,

if u want know difference between wa and structure you first learn about those two then you can able to find the diff. I hope this is usefull.

Read only

Former Member
0 Likes
1,819

<b>structure and work area both holds only one row at time.</b>

But structure does this only at runtime......so we can say that memory allocation

for structure is done at runtime.

Read only

Former Member
0 Likes
1,819

Structure defines the skeletal form of how u want ur table to look like. it cannot be used to store values as u have asked hence it does not occupy memory as such. if u want to assign values define a table or workarea( a single record defined using the structure) and store the values . hope this clears u doubt.