Constructors

 *&---------------------------------------------------------------------*
*& Report  Z1807SAPBC401_AIRS_MAIN_B
*&
*&---------------------------------------------------------------------*
*&
*&Constructors
*&---------------------------------------------------------------------*

REPORT  Z1807SAPBC401_AIRS_MAIN_B.

TYPE-POOLS ICON.
*------------------------------------------------------------------*
* CLASS lcl_airplane DEFINITION *
*------------------------------------------------------------------*
CLASS LCL_AIRPLANE DEFINITION.
  PUBLIC SECTION.
    "--------------------------------
    CONSTANTS: POS_1 TYPE I VALUE 30.
    METHODS: CONSTRUCTOR IMPORTING
    IM_NAME TYPE STRING
    IM_PLANETYPE TYPE SAPLANE-PLANETYPE,
    DISPLAY_ATTRIBUTES.
    CLASS-METHODS: DISPLAY_N_O_AIRPLANES.
  PRIVATE SECTION.
    "----------------------------------
    DATA: NAME TYPE STRING,
    PLANETYPE TYPE SAPLANE-PLANETYPE.
    CLASS-DATA: N_O_AIRPLANES TYPE I.
ENDCLASS. "lcl_airplane DEFINITION
*------------------------------------------------------------------*
* CLASS lcl_airplane IMPLEMENTATION *
*------------------------------------------------------------------*
CLASS LCL_AIRPLANE IMPLEMENTATION.
  METHOD CONSTRUCTOR.
    NAME = IM_NAME.
    PLANETYPE = IM_PLANETYPE.
    N_O_AIRPLANES = N_O_AIRPLANES + 1.
  ENDMETHOD. "constructor
  METHOD DISPLAY_ATTRIBUTES.

    WRITE: / ICON_WS_PLANE AS ICON,
    / 'NAME DES FLUGZEUGS:'(001),AT POS_1 NAME,
    / 'FLUGZEUGTYP'(002),AT POS_1 PLANETYPE.
  ENDMETHOD. "display_attributes

  METHOD DISPLAY_N_O_AIRPLANES.

    WRITE:/ 'Gesamtzahl der Flugzeuge',
       AT POS_1 N_O_AIRPLANES LEFT-JUSTIFIED.

  ENDMETHOD. "display_n_o_airplanes

ENDCLASS. "lcl_airplane IMPLEMENTATION

 


DATA: R_PLANE TYPE REF TO LCL_AIRPLANE,
PLANE_LIST TYPE TABLE OF REF TO LCL_AIRPLANE.

START-OF-SELECTION.
*##############################
  LCL_AIRPLANE=>DISPLAY_N_O_AIRPLANES( ).

  CREATE OBJECT R_PLANE EXPORTING IM_NAME = 'LH BERLIN'
                                  IM_PLANETYPE = 'A321'.
  APPEND R_PLANE TO PLANE_LIST.
  R_PLANE->DISPLAY_ATTRIBUTES( ).
  CREATE OBJECT R_PLANE EXPORTING IM_NAME = 'AA NEW YORK'
                                IM_PLANETYPE = '747-400'.
  APPEND R_PLANE TO PLANE_LIST.
  R_PLANE->DISPLAY_ATTRIBUTES( ).
  CREATE OBJECT R_PLANE EXPORTING IM_NAME = 'US HERCULES'
                              IM_PLANETYPE = '747-500'.
  APPEND R_PLANE TO PLANE_LIST.

  R_PLANE->DISPLAY_ATTRIBUTES( ).
  LCL_AIRPLANE=>DISPLAY_N_O_AIRPLANES( ).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值