3-Enumeration in ABAP 7.51

lightEnumeration- Implicit values

 

 


The values of enumeration objects can be accessed by using CONV operator with base type as ‘I’. The values starts from 0 and incremented by +1    .


CODE:
TYPES: BEGIN OF ENUM t_vowels,
                       letter_a,  ” enumeration constant- Value- 0
                       letter_e,  ” enumeration constant- Value- 1
                       letter_i,   ” enumeration constant- Value- 2
                       letter_o,  ” enumeration constant- Value- 3
                       letter_u,  ” enumeration constant- Value- 4
                END OF ENUM t_vowels.

WRITE:/ letter_a,
               / letter_e,
               / letter_i,
                / letter_o,
                / letter_u.
ULINE. 

DATA: lv_vowel_val type i.
lv_vowel_val = CONV i( letter_a ).
WRITE:/ lv_vowel_val.
WRITE:/ CONV i( letter_e ).
WRITE:/ CONV i( letter_i ).
WRITE:/ CONV i( letter_o ).
WRITE:/ CONV i( letter_u ).


1


Output:

2


 

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