메뉴 건너뛰기

SAP 한국 커뮤니티

REPORT Z17_004.

sapjoy 2007.02.12 06:21 조회 수 : 2508 추천:1

REPORT  Z17_004.

CLASS counter DEFINITION.
  PUBLIC SECTION.
*    PROTECTED SECTION.
    DATA count TYPE i.
ENDCLASS.

CLASS counter2 DEFINITION INHERITING FROM counter.
  PUBLIC SECTION.
    METHODS: set IMPORTING set_value type i,
             increment,
             get EXPORTING get_value type i.
    PRIVATE SECTION.
*    PROTECTED SECTION.
*    DATA count TYPE i.
ENDCLASS.

CLASS counter2 IMPLEMENTATION.
  METHOD set.
    count = set_value.
  ENDMETHOD.
  METHOD increment.
    ADD 1 TO count.
  ENDMETHOD.
  METHOD get.
    get_value = count.
  ENDMETHOD.
ENDCLASS.

DATA : CREF1 TYPE REF TO COUNTER2,
       L_imp   TYPE I.
START-OF-SELECTION.
CREATE OBJECT CREF1.

CALL METHOD CREF1->SET( exporting set_value = 3 ).

CALL METHOD CREF1->increment.

CALL METHOD CREF1->GET( IMPORTING get_value = l_imp ).
WRITE : / 'GET METHOD :' , l_imp.
번호 제목 글쓴이 날짜 조회 수
271 report zunicode_003. sapjoy 2008.11.22 2202
270 report zunicode_002 sapjoy 2008.11.22 2563
269 zunicode_001 sapjoy 2008.11.22 2397
268 REPORT Z07_024 sapjoy 2006.12.09 2474
267 REPORT z18_033 [47] sapjoy 2008.10.13 9044
266 REPORT Z13_021 [1] sapjoy 2008.09.29 2156
» REPORT Z17_004. sapjoy 2007.02.12 2508
264 REPORT z19_005 [1] sapjoy 2007.04.04 2927
263 REPORT z18_035 sapjoy 2007.03.14 2450
262 REPORT z16_003 [1] sapjoy 2008.08.08 2551
261 REPORT z16_002 sapjoy 2008.08.08 2649
260 REPORT Z04_003 [9] sapjoy 2007.05.17 2561
259 <b>ABAP SOURCE는 교재에 사용된 소스들입니다.</b> [1] sapjoy 2006.12.03 3619
258 REPORT z18_037 [3] sapjoy 2008.04.22 2728
257 REPORT z18_038 [2] sapjoy 2008.04.22 2636
256 REPORT Z07_031 [2] sapjoy 2006.12.09 2309
255 REPORT Z05_001 [3] sapjoy 2007.05.22 2881
254 REPORT Z05_003 sapjoy 2007.05.22 2406
253 REPORT Z15_027 . sapjoy 2007.02.01 2718
252 REPORT Z17_021 . sapjoy 2007.02.21 2388