HI Antonia,
Please find the rectified CODE.
First get clear Idea about OOPS concept.
You need to declare Start of selection:
In an ABAP report, non declarative statements that are not assigned to a processing block are never executed. These statements are assigned to the default event START-OF-SELECTION.
*-------------Definizione Classe veicolo <-------------------
CLASS veicolo DEFINITION.
PUBLIC SECTION.
METHODS: set_veicolo IMPORTING im_marca TYPE string.
METHODS: get_veicolo EXPORTING new_marca TYPE string.
PRIVATE SECTION.
METHODS: inizializza.
DATA: marca TYPE string,
tipo_marca TYPE string.
CLASS-DATA: num_veicolo TYPE i.
ENDCLASS. "veicolo DEFINITION
*--> Implementazione Marca
CLASS veicolo IMPLEMENTATION.
METHOD inizializza.
marca = 'nessuna marca'.
ENDMETHOD. "inizializza
METHOD set_veicolo.
marca = im_marca.
ENDMETHOD. "set_veicolo
*
METHOD get_veicolo.
new_marca = marca.
ENDMETHOD. "get_veicolo
ENDCLASS. "veicolo IMPLEMENTATION
START-OF-SELECTION.
*--> Definizione riferimento ad oggetto
DATA: ref_veicolo TYPE REF TO veicolo,
new_marca TYPE string.
*CREATE OBJECT ref_veicolo.
CALL METHOD ref_veicolo->set_veicolo( new_marca ).
END-OF-SELECTION.
Message was edited by: Vijay Vikram