메뉴 건너뛰기

SAP 한국 커뮤니티

REPORT z14_19.

sapjoy 2012.08.02 04:54 조회 수 : 974

REPORT  z14_19.

TABLES:sflight.

SELECT-OPTIONS: s_carrid FOR sflight-carrid.

CLASS c1 DEFINITION.
   PUBLIC SECTION.
    TYPES:BEGIN OF t_sflight,
            carrid TYPE sflight-carrid,
           connid TYPE sflight-connid,
                   fldate TYPE sflight-fldate,
    END OF t_sflight.

    DATA :gt_itab TYPE STANDARD TABLE OF t_sflight,
          gs_str TYPE t_sflight.
    EVENTS: e1 .

  METHODS : get_data ,display_data ,no_data
   FOR EVENT e1 OF c1.
ENDCLASS.             "C1 DEFINITION

CLASS c1 IMPLEMENTATION.
   METHOD: get_data .
    SELECT carrid connid fldate FROM sflight
         INTO TABLE gt_itab
    WHERE carrid IN s_carrid.
    IF sy-subrc <> 0.
     RAISE EVENT e1.
    ELSE .
     CALL METHOD display_data .
    ENDIF.
   ENDMETHOD.          "get_data

  METHOD:display_data .
      LOOP AT gt_itab INTO gs_str.
       WRITE:/10 gs_str-carrid.
       WRITE:40 gs_str-connid.
    WRITE:60 gs_str-fldate.
      ENDLOOP.
     ENDMETHOD.   "DISPLAY_DATA

    METHOD no_data .
        WRITE:/10 ' C1: NO DATA FOR SELECTION CRITERIA'.
       ENDMETHOD.          "no_data
    ENDCLASS.                    "c1 IMPLEMENTATION


    DATA :go_obj1 TYPE REF TO c1.

START-OF-SELECTION.
   CREATE OBJECT: go_obj1.

   SET HANDLER go_obj1->no_data FOR: go_obj1.

   CALL METHOD go_obj1->get_data .

번호 제목 글쓴이 날짜 조회 수
591 REPORT Z14_20. sapjoy 2012.08.02 929
» REPORT z14_19. sapjoy 2012.08.02 974
589 REPORT Z14_18. sapjoy 2012.08.02 906
588 REPORT z14_17. sapjoy 2012.08.02 1030
587 REPORT z14_16. [1] sapjoy 2012.08.02 912
586 REPORT z14_15. sapjoy 2012.08.02 1022
585 REPORT z14_14. sapjoy 2012.08.02 1020
584 REPORT z14_13. sapjoy 2012.08.02 804
583 REPORT z14_12. sapjoy 2012.08.02 857
582 REPORT z14_11. sapjoy 2012.08.02 841
581 REPORT z14_10. sapjoy 2012.08.02 852
580 REPORT z14_09. sapjoy 2012.08.02 804
579 REPORT z14_08. [3] sapjoy 2012.08.02 1023
578 REPORT z14_07. sapjoy 2012.08.02 819
577 REPORT z14_06. [1] sapjoy 2012.08.02 1011
576 REPORT z14_05. sapjoy 2012.08.02 862
575 REPORT z14_04. sapjoy 2012.08.02 936
574 REPORT z14_03. sapjoy 2012.08.02 874
573 REPORT Z14_02. sapjoy 2012.08.02 847
572 REPORT Z14_01. sapjoy 2012.08.02 915