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

question on structure

Former Member
0 Likes
1,070

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?

10 REPLIES 10
Read only

Former Member
0 Likes
1,001

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

Read only

anversha_s
Active Contributor
0 Likes
1,001

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>

Read only

Former Member
0 Likes
1,001

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.

Read only

messier31
Active Contributor
0 Likes
1,001

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...

Read only

Former Member
0 Likes
1,001

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

Read only

Former Member
0 Likes
1,001

'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.

Read only

Former Member
0 Likes
1,001

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

Read only

Former Member
0 Likes
1,001

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 ..

Read only

Former Member
0 Likes
1,001

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

Read only

Former Member
0 Likes
1,001

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