Enumeration with structure addition
If sometimes it is required to have two same enumeration types in the same program context, then you have to assign different structure names to each enumeration type and accessing the enum fields with the structure name.
CODE:
TYPES: BEGIN OF ENUM t1_vowels STRUCTURE one,”base type – i
a, ” enumeration constant- Value- 0
e, ” enumeration constant- Value- 1
i, ” enumeration constant- Value- 2
o, ” enumeration constant- Value- 3
u, ” enumeration constant- Value- 4
END OF ENUM t1_vowels STRUCTURE one.
TYPES: BEGIN OF ENUM t2_vowels STRUCTURE two,”base type – i
a, ” enumeration constant- Value- 0
e, ” enumeration constant- Value- 1
i, ” enumeration constant- Value- 2
o, ” enumeration constant- Value- 3
u, ” enumeration constant- Value- 4
END OF ENUM t2_vowels STRUCTURE two.
WRITE: / one-a,
/ one-e,
/ one-i,
/ one-o,
/ one-u.
ULINE.
WRITE: / two-a,
/ two-e,
/ two-i,
/ two-o,
/ two-u.
OUTPUT: