REPORT ZABAP_OO_01.
PARAMETERS: P_EBELN TYPE EKKO-EBELN.
CLASS A DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF TT,
EBELN TYPE EKKO-EBELN,
BUKRS TYPE EKKO-BUKRS,
BSTYP TYPE EKKO-BSTYP,
END OF TT.
DATA: TI TYPE STANDARD TABLE OF TT.
METHODS: GET_EKKO,
DISPLAY_EKKO.
ENDCLASS.
CLASS A IMPLEMENTATION.
METHOD GET_EKKO.
SELECT EBELN BUKRS BSTYP FROM EKKO INTO TABLE TI WHERE EBELN = P_EBELN.
ENDMETHOD.
METHOD DISPLAY_EKKO.
FIELD-SYMBOLS: <FS> TYPE TT.
LOOP AT TI ASSIGNING <FS>.
WRITE: / <FS>-EBELN,
/ <FS>-BUKRS,
/ <FS>-BSTYP.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: A1 TYPE REF TO A.
CREATE OBJECT A1.
A1->GET_EKKO( ).
A1->DISPLAY_EKKO( ).
No hay comentarios:
Publicar un comentario