PROGRAMMAZIONE OOP NR. 1
Programma che crea una classe
contatore che utilizza 3 metodi pubblici: SET, INCREMENT e GET
REPORT zclass1.
CLASS counter DEFINITION.
PUBLIC SECTION.
METHODS: set IMPORTING value(set_value) TYPE i,
increment,
get EXPORTING value(get_value) TYPE i.
PRIVATE SECTION.
DATA count TYPE i.
ENDCLASS. "counter DEFINITION
CLASS counter IMPLEMENTATION.
METHOD set.
count = set_value.
ENDMETHOD. "set
METHOD increment.
ADD 1 TO count.
ENDMETHOD. "increment
METHOD get.
get_value = count.
ENDMETHOD. "get
ENDCLASS. "counter IMPLEMENTATION
DATA number TYPE i VALUE 5.
DATA cnt TYPE REF TO counter.
START-OF-SELECTION.
CREATE OBJECT cnt.
cnt->set( number ).
DO 3 TIMES.
cnt->increment( ).
cnt->get( IMPORTING get_value = number ).
WRITE:/ number.
ENDDO.
CLASS counter DEFINITION.
PUBLIC SECTION.
METHODS: set IMPORTING value(set_value) TYPE i,
increment,
get EXPORTING value(get_value) TYPE i.
PRIVATE SECTION.
DATA count TYPE i.
ENDCLASS. "counter DEFINITION
CLASS counter IMPLEMENTATION.
METHOD set.
count = set_value.
ENDMETHOD. "set
METHOD increment.
ADD 1 TO count.
ENDMETHOD. "increment
METHOD get.
get_value = count.
ENDMETHOD. "get
ENDCLASS. "counter IMPLEMENTATION
DATA number TYPE i VALUE 5.
DATA cnt TYPE REF TO counter.
START-OF-SELECTION.
CREATE OBJECT cnt.
cnt->set( number ).
DO 3 TIMES.
cnt->increment( ).
cnt->get( IMPORTING get_value = number ).
WRITE:/ number.
ENDDO.
EBOOK: le mie guide sono visualizzabili cliccando sui link:
1. SAP EWM (Extended Warehouse Management)
3. SAP VIM (Vendor Invoice Management)
1. SAP EWM (Extended Warehouse Management)
3. SAP VIM (Vendor Invoice Management)
SE MI CONTATTATE IN PRIVATO, PAGATE LA META' DEL PREZZO DI AMAZON, E POTETE SCEGLIERE IL FORMATO WORD o PDF.
>>> RECENSIONI DEI LIBRI su Amazon Kindle <<<
Ebook: SAP CDS: https://www.amazon.it/dp/B0B9BD1RN3#customerReviews
Ebook: SAP MM: https://www.amazon.it/dp/B0C3MKD9BR#customerReviews
Ebook: SAP MII: https://www.amazon.it/dp/B0C4392MY9#customerReviews
Ebook: SAP VIM: https://www.amazon.it/dp/B0C6FBK8QN#customerReviews
Ebook: SAP MM: https://www.amazon.it/dp/B0C3MKD9BR#customerReviews
Ebook: SAP MII: https://www.amazon.it/dp/B0C4392MY9#customerReviews
Ebook: SAP VIM: https://www.amazon.it/dp/B0C6FBK8QN#customerReviews
Ebook: SAP EWM: https://www.amazon.it/dp/B0CL6TXP1V#customerReviews
Nessun commento:
Posta un commento