Abap

Páginas: 4 (811 palabras) Publicado: 1 de septiembre de 2011
Exercise 2: Local Classes
Exercise Duration: 45 Minutes
Exercise Objectives
After completing this exercise, you will be able to:
. Declare local classes
. Define attributes
. Define andimplement methods
Business Example
You are a developer for an airline corporation that owns several airline carriers. Start
to develop an object-oriented program that can manage the airline carriers andtheir
airlines.
Task 1:
Create a new program.
1. Create an executable program without a TOP include.
Program name: ZBC401_##_MAIN
(where ## is your two-digit group number). )
2. Create aninclude program and include it in your ZBC401_##_MAIN main
program.
Program name: ZBC401_##_AIRPLANE
(where ## is your two-digit group number). )
Task 2:
Declare a class for airplanes.
1. Withinyour include program, declare the local class LCL_AIRPLANE.
2. Define the two private instance attributes
NAME (name of airplane), data type STRING
PLANETYPE (type of airplane), data typeSAPLANE-PLANETYPE
and the private static attribute
N_O_AIRPLANES (instance counter), data type I.
3. Define the public instance method SET_ATTRIBUTES for setting the private
instance attributes.
Yoursignature should consist of two suitable import parameters that are defined
as compatible with the two attributes.
Implement the method in such a way that the two instance attributes are set.
4.Define the public instance method DISPLAY_ATTRIBUTES for displaying
the private instance attributes.
Implement the method in such a way that the values of the two instance attributes
are output as anABAP list. You can also output icons if the ICON type group is
loaded.
Hint: To do this, use the statement
TYPE-POOLS icon.
.
Note: Strictly speaking, to adhere to the delegation principle, thereading
of the attribute values and their output should not be implemented in the
same method. However, do it here anyway because of time constraints.
5. Define the public static method...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Abap
  • Abap
  • ABAP
  • Transacciones Abap
  • La progra abap
  • Abap Oo
  • Sap abap
  • examen ABAP

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS