I had asked this once and they deleted it with the reason of FAQ but I looked through the FAQ and did not see anything in there that answered this question so I will ask again but shorten it up. TO ANY MODERATORS THAT FEEL THIS SHOULD BE DELETED: If I am wrong and this is in an FAQ somewhere, please oblige me and point me to the FAQ that answers this question before you delete it..
Consider the following statement from the Help files when looking at the help for DATA:
The most important difference compared with the statement TYPES is that a data type defined using DATA (and not derived from an existing type) is available only as a property of the declared data object and is not independent. This kind
of data type is bound to its data object.
I am looking for a plain explanation on why there are two ways to create a structure, TYPES and DATA. Why not just one way? Now consider the following pieces of code:
Example 1:
TYPES: BEGIN OF My_Stuff,
Field1(15),
Field2(15),
END OF My_Stuff.
Example 2:
DATA: BEGIN OF My_Stuff,
Field1(15),
Field2(15),
END OF My_Stuff.
Can someone fill in the blank on either of the two following statements:
If you create the structure using example 1, you would be able to _________________ but would not be able to ___________________.
OR
If you create the structure using example 2, you would be able to _________________ but would not be able to ___________________.
Also, I know things defined with the DATA statement I understand are created in memory but why do I care about this? I can still reference fields in either one so why would this be a benefit or not? Just for performance?