‎2006 Nov 03 9:58 AM
dear friends
Its a very simple question i am confused with why we create structures with types where we can create structures with data as well :
Types: begin of stru
....
end of stru.
Data: begin of stru
...
end of stru...
regards
Naim
‎2006 Nov 03 10:03 AM
Hi naim,
1. For practical purpose, we can directly create using data, and no need of using types.
2. Types is generally used for oo programming.
regards,
amit m.
‎2006 Nov 03 10:03 AM
for example ur requirement is create 10 tables with same structure then it is wise to create one type and refer to it n also if in future u want to change some thing with str u change the type and then every thing will change.
santhosh
‎2006 Nov 03 10:03 AM
Hi naim,
1. For practical purpose, we can directly create using data, and no need of using types.
2. Types is generally used for oo programming.
regards,
amit m.
‎2006 Nov 03 10:04 AM
‎2006 Nov 03 10:06 AM
To construct a new structured data type struc_typein a program, you use several TYPES statements:
TYPES BEGIN OF struc_type.
...
{TYPES dtype ...} | {INCLUDE {TYPE|STRUCTURE} ...}.
...
TYPES END OF struc_type.
The syntax for directly declaring a variable as a structure is the same as you would use to define a structured data type using the TYPES statement:
DATA BEGIN OF struc.
...
{DATA comp ...} | {INCLUDE {TYPE|STRUCTURE} ...}.
..
DATA END OF struc.
The individual components of a structure are addressed in the program with the structure component selector between the structure name and component name as follows: struc_comp.
Have a look at below link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3364358411d1829f0000e829fbfe/content.htm
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers