REPORT Z17_012 .
CLASS lcl_employee DEFINITION.
PUBLIC SECTION.
TYPES:
BEGIN OF t_employee,
no TYPE i,
name TYPE string,
END OF t_employee.
METHODS:
constructor
IMPORTING im_employee_no TYPE i
im_employee_name TYPE string,
display_employee.
CLASS-METHODS: display_no_of_employees.
PROTECTED SECTION.
CLASS-DATA: g_no_of_employees TYPE i.
PRIVATE SECTION.
DATA: g_employee TYPE t_employee.
ENDCLASS.
CLASS lcl_employee IMPLEMENTATION.
METHOD constructor.
g_employee-no = im_employee_no.
g_employee-name = im_employee_name.
g_no_of_employees = g_no_of_employees + 1.
ENDMETHOD.
METHOD display_employee.
WRITE:/ 'Employee', g_employee-no, g_employee-name.
ENDMETHOD.
METHOD display_no_of_employees.
WRITE: / 'Number of employees is:', g_no_of_employees.
ENDMETHOD.
ENDCLASS.
DATA: g_employee1 TYPE REF TO lcl_employee,
g_employee2 TYPE REF TO lcl_employee.
START-OF-SELECTION.
CREATE OBJECT g_employee1
EXPORTING im_employee_no = 1
im_employee_name = 'Hong g d'.
CREATE OBJECT g_employee2
EXPORTING im_employee_no = 2
im_employee_name = 'Lim g j'.
CALL METHOD g_employee1->display_employee.
CALL METHOD g_employee2->display_employee.
CALL METHOD g_employee2->display_no_of_employees.
CLASS lcl_employee DEFINITION.
PUBLIC SECTION.
TYPES:
BEGIN OF t_employee,
no TYPE i,
name TYPE string,
END OF t_employee.
METHODS:
constructor
IMPORTING im_employee_no TYPE i
im_employee_name TYPE string,
display_employee.
CLASS-METHODS: display_no_of_employees.
PROTECTED SECTION.
CLASS-DATA: g_no_of_employees TYPE i.
PRIVATE SECTION.
DATA: g_employee TYPE t_employee.
ENDCLASS.
CLASS lcl_employee IMPLEMENTATION.
METHOD constructor.
g_employee-no = im_employee_no.
g_employee-name = im_employee_name.
g_no_of_employees = g_no_of_employees + 1.
ENDMETHOD.
METHOD display_employee.
WRITE:/ 'Employee', g_employee-no, g_employee-name.
ENDMETHOD.
METHOD display_no_of_employees.
WRITE: / 'Number of employees is:', g_no_of_employees.
ENDMETHOD.
ENDCLASS.
DATA: g_employee1 TYPE REF TO lcl_employee,
g_employee2 TYPE REF TO lcl_employee.
START-OF-SELECTION.
CREATE OBJECT g_employee1
EXPORTING im_employee_no = 1
im_employee_name = 'Hong g d'.
CREATE OBJECT g_employee2
EXPORTING im_employee_no = 2
im_employee_name = 'Lim g j'.
CALL METHOD g_employee1->display_employee.
CALL METHOD g_employee2->display_employee.
CALL METHOD g_employee2->display_no_of_employees.
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
71 | Z17_ZSFLIGHT | sapjoy | 2007.02.27 | 2413 |
70 | REPORT Z17_028 | sapjoy | 2007.02.26 | 2940 |
69 | REPORT Z09_013 | sapjoy | 2007.02.24 | 2243 |
68 | REPORT Z17_020. [2] | sapjoy | 2007.02.23 | 2187 |
67 | REPORT z17_025 | sapjoy | 2007.02.23 | 2204 |
66 | REPORT Z17_020 | sapjoy | 2007.02.23 | 2172 |
65 | REPORT Z17_000. | sapjoy | 2007.02.22 | 2419 |
64 | REPORT Z17_022 | sapjoy | 2007.02.22 | 2315 |
63 | REPORT Z17_017 . | sapjoy | 2007.02.15 | 2181 |
62 | REPORT Z17_016 . | sapjoy | 2007.02.14 | 2162 |
61 | REPORT Z17_015 | sapjoy | 2007.02.13 | 2282 |
» | REPORT Z17_012 | sapjoy | 2007.02.13 | 2305 |
59 | INCLUDE Z17_011_CLASS | sapjoy | 2007.02.12 | 2489 |
58 | REPORT Z17_011 | sapjoy | 2007.02.12 | 2287 |
57 | REPORT Z017_007 [3] | sapjoy | 2007.02.12 | 2353 |
56 | REPORT Z17_006 | sapjoy | 2007.02.12 | 2209 |
55 | REPORT Z17_005 | sapjoy | 2007.02.12 | 2174 |
54 | REPORT Z17_003 | sapjoy | 2007.02.09 | 2347 |
53 | REPORT Z17_002 | sapjoy | 2007.02.08 | 2138 |
52 | REPORT Z17_001. | sapjoy | 2007.02.07 | 2147 |