*&---------------------------------------------------------------------*
*& Report Z17_021 *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT Z17_021 .
* INTERFACE status
INTERFACE status.
METHODS write.
DATA cnt TYPE i.
ENDINTERFACE. "status
* CLASS c_counter1 DEFINITION
CLASS c_counter1 DEFINITION.
PUBLIC SECTION.
INTERFACES status.
METHODS increment.
ENDCLASS. "c_counter1 DEFINITION
* CLASS c_counter1 IMPLEMENTATION
CLASS c_counter1 IMPLEMENTATION.
METHOD status~write.
WRITE: / '숫자는', status~cnt.
ENDMETHOD. "status~write
METHOD increment.
ADD 2 TO status~cnt.
ENDMETHOD.
ENDCLASS. "c_counter1 IMPLEMENTATION
* CLASS c_counter2 DEFINITION
CLASS c_counter2 DEFINITION.
PUBLIC SECTION.
INTERFACES status.
ENDCLASS. "c_counter2 DEFINITION
* CLASS c_counter2 IMPLEMENTATION
CLASS c_counter2 IMPLEMENTATION.
METHOD status~write.
WRITE: / '속도는', status~cnt.
ENDMETHOD. "status~write
ENDCLASS. "c_counter2 IMPLEMENTATION
DATA : cref1 TYPE REF TO c_counter1,
cref2 TYPE REF TO c_counter2,
iref TYPE REF TO status.
START-OF-SELECTION.
CREATE OBJECT : cref1, cref2.
CALL METHOD CREF1->INCREMENT.
CALL METHOD cref1->status~write.
iref = cref1.
cref1->status~cnt = 3.
CALL METHOD iref->write.
cref2->status~cnt = 10.
CALL METHOD cref2->status~write.
iref = cref2.
cref2->status~cnt = 20.
CALL METHOD iref->write.
*& Report Z17_021 *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT Z17_021 .
* INTERFACE status
INTERFACE status.
METHODS write.
DATA cnt TYPE i.
ENDINTERFACE. "status
* CLASS c_counter1 DEFINITION
CLASS c_counter1 DEFINITION.
PUBLIC SECTION.
INTERFACES status.
METHODS increment.
ENDCLASS. "c_counter1 DEFINITION
* CLASS c_counter1 IMPLEMENTATION
CLASS c_counter1 IMPLEMENTATION.
METHOD status~write.
WRITE: / '숫자는', status~cnt.
ENDMETHOD. "status~write
METHOD increment.
ADD 2 TO status~cnt.
ENDMETHOD.
ENDCLASS. "c_counter1 IMPLEMENTATION
* CLASS c_counter2 DEFINITION
CLASS c_counter2 DEFINITION.
PUBLIC SECTION.
INTERFACES status.
ENDCLASS. "c_counter2 DEFINITION
* CLASS c_counter2 IMPLEMENTATION
CLASS c_counter2 IMPLEMENTATION.
METHOD status~write.
WRITE: / '속도는', status~cnt.
ENDMETHOD. "status~write
ENDCLASS. "c_counter2 IMPLEMENTATION
DATA : cref1 TYPE REF TO c_counter1,
cref2 TYPE REF TO c_counter2,
iref TYPE REF TO status.
START-OF-SELECTION.
CREATE OBJECT : cref1, cref2.
CALL METHOD CREF1->INCREMENT.
CALL METHOD cref1->status~write.
iref = cref1.
cref1->status~cnt = 3.
CALL METHOD iref->write.
cref2->status~cnt = 10.
CALL METHOD cref2->status~write.
iref = cref2.
cref2->status~cnt = 20.
CALL METHOD iref->write.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 271 | report zunicode_003. | sapjoy | 2008.11.22 | 2251 |
| 270 | report zunicode_002 | sapjoy | 2008.11.22 | 2590 |
| 269 | zunicode_001 | sapjoy | 2008.11.22 | 2426 |
| 268 | REPORT Z07_024 | sapjoy | 2006.12.09 | 2513 |
| 267 | REPORT z18_033 [47] | sapjoy | 2008.10.13 | 9114 |
| 266 | REPORT Z13_021 [1] | sapjoy | 2008.09.29 | 2200 |
| 265 | REPORT Z17_004. | sapjoy | 2007.02.12 | 2538 |
| 264 | REPORT z19_005 [1] | sapjoy | 2007.04.04 | 2965 |
| 263 | REPORT z18_035 | sapjoy | 2007.03.14 | 2474 |
| 262 | REPORT z16_003 [1] | sapjoy | 2008.08.08 | 2597 |
| 261 | REPORT z16_002 | sapjoy | 2008.08.08 | 2680 |
| 260 | REPORT Z04_003 [9] | sapjoy | 2007.05.17 | 2610 |
| 259 | <b>ABAP SOURCE는 교재에 사용된 소스들입니다.</b> [1] | sapjoy | 2006.12.03 | 3669 |
| 258 | REPORT z18_037 [3] | sapjoy | 2008.04.22 | 2779 |
| 257 | REPORT z18_038 [2] | sapjoy | 2008.04.22 | 2679 |
| 256 | REPORT Z07_031 [2] | sapjoy | 2006.12.09 | 2352 |
| 255 | REPORT Z05_001 [3] | sapjoy | 2007.05.22 | 2926 |
| 254 | REPORT Z05_003 | sapjoy | 2007.05.22 | 2436 |
| 253 | REPORT Z15_027 . | sapjoy | 2007.02.01 | 2744 |
| » | REPORT Z17_021 . | sapjoy | 2007.02.21 | 2425 |