Abap Objects Program

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Abap Objects Program as PDF for free.

More details

  • Words: 141
  • Pages: 2
*&--------------------------------------------------------------------* *& Report ZCLASSEXAMPLE *& *&--------------------------------------------------------------------* *& *& *&--------------------------------------------------------------------* REPORT

ZCLASSEXAMPLE.

CLASS lcl_airplane DEFINITION. PUBLIC SECTION. TYPES: name_type(25) type c. CONSTANTS : pos_1 type i VALUE 30. METHODS:set_attributes IMPORTING im_name type name_type im_planetype TYPE saplane-planetype, display_attributes. CLASS-METHODS: display_n_o_airplanes. PRIVATE SECTION. DATA: name type name_type, planetype TYPE saplane-planetype. CLASS-DATA: n_o_airplanes type i. ENDCLASS. CLASS lcl_airplane IMPLEMENTATION. METHOD set_attributes. name = im_name. planetype = im_planetype. n_o_airplanes = n_o_airplanes + 1. ENDMETHOD. METHOD display_attributes. WRITE: /' name of the airplane:'(001) , AT pos_1 name, / ' plane type : '(002) ,AT pos_1 planetype. ENDMETHOD.

METHOD display_n_o_airplanes. WRITE: /,/ ' total number of airplanes:'(ca1), AT pos_1 n_o_airplanes left-JUSTIFIED,/. ENDMETHOD. ENDCLASS.

*REPORT ZOBJECT. INCLUDE ZCLASSEXAMPLE. data: airplane type ref to lcl_airplane. START-OF-SELECTION. call METHOD lcl_airplane=>display_n_o_airplanes. create object airplane. call method airplane->set_attributes EXPORTING im_name = 'LH B ERLIN' IM_PLANETYPE = '747-400'. CALL METHOD AIRPLANE->DISPLAY_ATTRIBUTES. CALL METHOD LCL_AIRPLANE=>DISPLAY_N_O_AIRPLANES.

Related Documents

Abap Objects Program
November 2019 26
Abap Objects
November 2019 52
Introducing Abap Objects
November 2019 28
Exercise 5 - Abap Objects
November 2019 35
Introducing Abap Objects
November 2019 23
Sap Html Viewer Abap Objects
November 2019 26