4-Enumeration in ABAP 7.51

lightEnumeration 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:

1.jpg


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s