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

structure

Former Member
0 Likes
728

Hi,

here i have declared a sructure st_sflight.After execution the structure will b get loaded by position. But i was taught that structure did not have any memory space. Then howcome it contains data.

Data st_sflight type sflight.

Select single carrid connid fldate from sflight into st_sflight.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
622

Hi,

structures will not have memory space means system will not allocate any space in data base.when u use it in program it will allocate some temporary(abap memory) space for that as like other variables.

rgds,

bharat.

5 REPLIES 5
Read only

Former Member
0 Likes
622

Hi ajay,

Here you are defining st_sflight as a <b>data</b>, Hence it tworks as an internal table,use <b>TYPE</b> to declare it as a structure.

Reward if it is useful.

Swati Garg

Read only

Former Member
0 Likes
623

Hi,

structures will not have memory space means system will not allocate any space in data base.when u use it in program it will allocate some temporary(abap memory) space for that as like other variables.

rgds,

bharat.

Read only

Former Member
0 Likes
622

Hi Ajay ,

Structure is just a format , no memory is assigned to it.

But if you declare a varaible with type of that structure then memory is allocated to varaiable which has the all the feilds defined in the structure.

So in your example the statement

Data st_sflight type sflight.

causes memory to be allocated to st_sflight.

Hope this helps.

In case you have nay further queries , please feel free to revert back.

Regards

Arun

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
622

Hi,

You have created a workarea od TYPE sflight.

Workarea will abviously occupy some memory of your program.

It is used to store one RECORD of your table SFLIGHT.

It can be used to read data from table using SELECT or read table from an internal table of type SFLIGH using READ TABLE.

Regards,

Sesh

Read only

Former Member
0 Likes
622

HI,

Structure is used for Group of field memory allocation when u r executing the program. It is used to create a internal table with predefined structure and it is defined in global database we can use any where in program and we can move internal table values one program to another also using same structure.

It is not having any memory area like transperant tabl just global field declaration for set of fields.

Regards,

Nandha

Reward if it helps