메뉴 건너뛰기

SAP 한국 커뮤니티

Report Z14_05

전통주막 2025.09.17 21:49 조회 수 : 0

*&---------------------------------------------------------------------*
*& Report Z14_05
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT Z14_05.


CLASS lcl_order DEFINITION.
  PUBLIC SECTION.
    DATA: order_quantity TYPE i.

    METHODS: create_order IMPORTING p_quantity TYPE i.
    EVENTS: order_created EXPORTING VALUE(p_quantity) TYPE i.
ENDCLASS.

CLASS lcl_order IMPLEMENTATION.
  METHOD create_order.
    " 주문 생성 로직
    order_quantity = p_quantity.

    " 주문이 생성되었음을 이벤트로 알림
    RAISE EVENT order_created EXPORTING p_quantity = p_quantity.
  ENDMETHOD.
ENDCLASS.

CLASS lcl_order_handler DEFINITION.
  PUBLIC SECTION.
    METHODS: handle_order_created FOR EVENT order_created OF lcl_order
      IMPORTING p_quantity.
ENDCLASS.

CLASS lcl_order_handler IMPLEMENTATION.
  METHOD handle_order_created.

    " 주문 생성 이벤트가 발생했을 때 처리할 로직
    WRITE: / '주문이 생성되었습니다. 주문 수량: ', p_quantity.
  ENDMETHOD.
ENDCLASS.

PARAMETERS: p_quan TYPE i.

START-OF-SELECTION.
  DATA: lo_order         TYPE REF TO lcl_order,
        lo_order_handler TYPE REF TO lcl_order_handler.

  " 주문 객체 생성
  CREATE OBJECT lo_order.

  " 주문 이벤트 핸들러 생성
  CREATE OBJECT lo_order_handler.

  " 이벤트 핸들러 등록
  SET HANDLER lo_order_handler->handle_order_created FOR lo_order.

  " 주문 생성 메소드 호출
  lo_order->create_order( p_quantity = p_quan ).

번호 제목 글쓴이 날짜 조회 수
363 Report Z14_07 전통주막 2025.09.17 0
362 Report Z14_06 전통주막 2025.09.17 0
» Report Z14_05 전통주막 2025.09.17 0
360 Report Z14_04 전통주막 2025.09.17 0
359 Report Z14_03 전통주막 2025.09.17 0
358 Report Z14_02 전통주막 2025.09.17 0
357 Report Z14_01 전통주막 2025.09.17 3
356 REPORT Z99_48 전통주막 2025.07.28 3
355 REPORT z16_09 sapjoy 2025.07.20 6
354 REPORT Z99_140 전통주막 2024.12.04 4
353 REPORT Z99_139 전통주막 2024.12.04 1
352 REPORT Z99_138 전통주막 2024.12.04 0
351 REPORT Z99_137 전통주막 2024.12.04 0
350 REPORT Z99_136 전통주막 2024.12.04 1
349 REPORT Z99_135 file 전통주막 2024.12.04 2
348 REPORT Z99_134 전통주막 2024.12.04 1
347 REPORT Z99_133 전통주막 2024.12.04 0
346 REPORT Z99_132 전통주막 2024.12.04 1
345 REPORT Z99_131 전통주막 2024.12.04 2
344 REPORT Z99_130 전통주막 2024.12.04 1