‎2006 Nov 18 8:08 AM
all v aacept tht tables contain data bt it contains in runtime only so structure also contains data at runtime so van v say struvture contains data?
‎2006 Nov 18 8:16 AM
You are right that structure might contain data at run time, however that is not persisted data, that means a structure might contain data in memory but not in the database.
Regards,
Ravi
Note - Please mark the helpful answers
‎2006 Nov 18 10:09 AM
Hi,
The structure that we create in program are workareas where we can store the data from internal tables. They are similar to headerline of the internalt table. We declare structure using data statement.
data : begin of itab,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
end of itab.Or we can declare a type.
types : begin of ttab,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
end of ttab.
data : itab type ttab.Or the header lines of the table can be used as workarea which are structure which have the same type and same name as that of table.
data : itab type ttab with header-line.So during run time the structure contain data.
Regards
Anver
<b><i>if helped pls mark points</i></b>
‎2006 Nov 18 11:24 AM
Yes structure contains data but is not persistent.
we cannot see the data in a structure once transaction is completed.
but data in table is persistent. we can see and do the changes.
‎2006 Nov 18 11:29 AM
Hi Ramesh,
For each table deifned in R/3 DDIC there is underlying table associated with it in database.
But for structue there is no database table associated with it.. IT has its declaration only in R/3 DDIC...
‎2006 Nov 18 11:30 AM
Hi Ramesh,
Take for example CAUFVD - is a structure for Order Headers and Items.
But in the Module Pool program SAPLCOIH (IW31,IW31, IW33 Transactions) you can find the declarations of the include LCOIHTOP as
*----- Tabellen -
*
TABLES: CAUFVD. "Dialog Table Struktur Header
This is the reason that the structures contain data at run time.
By default your structure cannot hold data as the normal database table do.
Hope this is what you are expecting.
Regards
Kathirvel
‎2006 Nov 27 5:04 AM
'Structures' are nothing but user-defined data types.They are created to hold related data viz.. STUDENT INFO ( name,id,age...) .As we dont expect data be in
the data types(variables) apart from runtime , data in the structures will not be there except at runtimes.
Where as Tables are created to hold data so any changes to data are persistent (i.e. reflected on the database) even if u leave the Program also.
regards,
Bhanu.
‎2006 Nov 27 5:22 AM
Hi Ramesh
To keep it simple:
Tables: Data is stored in database.
Structure: Doesnt store any data.
Though data can be populated in both via programs at runtime.
Hope this simplies ...
Kind Regards
Eswar
‎2006 Nov 27 8:31 AM
Hi,
As per ur question about structures containig data during runtime..
Structure of course can contain data during runtime as we populate it in the program ...But generally structure is just a skeleton and does not have any data in the underlying database as trasparent tables do..
for example ,
in HR -- ABAP..
We use the P-structures in the program which will have data during runtime ...Bute the pxxxx structure does not contain any data in the database ..where in the data is populated to the data structure pxxxx during run time from the PAxxxx table ...using a get<node> or other variants..
Hope this gives a clear idea ..
‎2006 Nov 27 1:57 PM
Hi,
Structures infact can contain data but that data is not stored in the data base table as there is no underlying table corresponding to a structure in Data dictionary.Normally all structure fields are populated and then updates in various data base tables using various insert/modify/update statements.
Rajesh Sahal
‎2006 Nov 28 5:05 AM
Hi,
DB tables contain permanent data, i.e. they write to your Hard rive in Database server. On the other hand, strucure contains data during runtime, only if you want it to contain data... Little explaination on this... Imagine that you are forming an internal table using structure, it can contain data only if you assign something to it, after the program is run, as internal table data is freed, so is the data in structure. For the same reason, structures do not contain key fields also. You can think of structure as a skeleton and tables as complete with flesh blood and skeleton.
Reward if useful.
Kiran