You are on page 1of 2

DATA: V_VBELN TYPE VBAK-VBELN. SELECT-OPTIONS: S_VBELN FOR V_VBELN. CLASS CL_SALES DEFINITION ABSTRACT. PUBLIC SECTION.

METHODS: GET_DATA ABSTRACT IMPORTING VBELN_LOW TYPE VBELN VBELN_HIGH TYPE VBELN, DISPLAY_DATA ABSTRACT. PROTECTED SECTION. TYPES: BEGIN OF TY_FS, VBELN TYPE VBAK-VBELN, ERDAT TYPE VBAK-ERDAT, VBTYP TYPE VBAK-VBTYP, VKORG TYPE VBAK-VKORG, END OF TY_FS. DATA: WA_VBAK TYPE TY_FS, IT_VBAK TYPE STANDARD TABLE OF TY_FS. ENDCLASS. *&---------------------------------------------------------------------* *&---------------------------------------------------------------------* *&---------------------------------------------------------------------* CLASS LC_SALES_ORDER DEFINITION INHERITING FROM CL_SALES. PUBLIC SECTION. METHODS: GET_DATA REDEFINITION, DISPLAY_DATA REDEFINITION. ENDCLASS. CLASS LC_SALES_ORDER IMPLEMENTATION. METHOD GET_DATA. REFRESH IT_VBAK. SELECT VBELN ERDAT VBTYP VKORG FROM VBAK INTO TABLE IT_VBAK WHERE VBELN BETWEEN VBELN_LOW AND VBELN_HIGH . IF SY-SUBRC NE 0. MESSAGE 'No data in Internal Table' type 'I' DISPLAY LIKE 'E'. EXIT. ENDIF.

ENDMETHOD. METHOD DISPLAY_DATA. IF SY-SUBRC = 0. LOOP AT IT_VBAK INTO WA_VBAK . WRITE:/ WA_VBAK-VBELN, WA_VBAK-ERDAT, WA_VBAK-VBTYP, WA_VBAK-VKORG. ENDLOOP. ENDIF. ENDMETHOD. ENDCLASS. DATA: LC_OBJ TYPE REF TO LC_SALES_ORDER. START-OF-SELECTION. CREATE OBJECT LC_OBJ. CALL METHOD LC_OBJ->GET_DATA EXPORTING VBELN_LOW = S_VBELN-LOW VBELN_HIGH = S_VBELN-HIGH. CALL METHOD LC_OBJ->DISPLAY_DATA.