14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Features 1.2

Figure 1.16 Extracting a Method: Before and After Comparison

Last, of course, there is a new method implementation (Listing 1.9).

METHOD derive_monster_sanity.

DATA ld_description1 TYPE string.

* Derive Monster Sanity

IF id_monster_madness1 LT 30.

ld_description1 = 'FAIRLY SANE'.

ELSEIF id_monster_madness1 GT 90.

ld_description1 = 'BONKERS'.

ELSE.

ld_description1 = 'AVERAGE SANITY'.

ENDIF.

ENDMETHOD.

Listing 1.9 New Method Implementation

Careful observers will note that the Extraction Wizard is not as clever as all that,

because you really wanted the description as an EXPORTING parameter, and you do

57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!