‎2007 Mar 15 6:22 AM
can u tell me the difference between structure and work area?
‎2007 Mar 15 6:34 AM
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.
‎2007 Mar 15 6:24 AM
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.
‎2007 Mar 15 6:41 AM
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?
‎2007 Mar 15 6:48 AM
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
‎2007 Mar 15 6:57 AM
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
‎2007 Mar 15 7:03 AM
Structure can be globally declared in SE11.
Create work areas locally in your programs.
‎2007 Mar 15 7:23 AM
‎2007 Mar 15 6:26 AM
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
‎2007 Mar 15 6:32 AM
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.
‎2007 Mar 15 6:34 AM
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.
‎2007 Mar 15 6:55 AM
<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.
‎2007 Mar 15 7:23 AM
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.