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


 

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 )

Facebook photo

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

Connecting to %s