‎2007 Jul 04 6:49 AM
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.
‎2007 Jul 04 6:53 AM
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.
‎2007 Jul 04 6:52 AM
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
‎2007 Jul 04 6:53 AM
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.
‎2007 Jul 04 6:53 AM
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
‎2007 Jul 04 6:56 AM
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
‎2007 Jul 04 6:57 AM
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