Tu'u i le polokalame ABAP

Vasega a1 UIGA.
 VAEGA A LE MALO.
 FA'AMATALAGA: NUM1 ITIGA i TAUA 100.
 METOGA:m1.
 FA'AI'UGA.
 Vasega a1 FAATINOGA.
 METOTIA m1.
 TUSI: 'a1:',num1.
 FAAMATALAGA.
 FA'AI'UGA.
 Vasega b1 FAAMATALAGA O TOFI MAI a1.
 VAEGA A LE MALO.
 METOFAGA:m2, m1 TOE FA'AIGA.
 FA'AI'UGA.
 Vasega b1 FAATINOGA.
 METOTIA m1.
 numera1 = numera1 .
 TUSI: 'b1:',num1.
 FAAMATALAGA.
 METOTIA m2.
 TUSI: 'M2 ile vasega b1'.
 FAAMATALAGA.
 FA'AI'UGA.
 AMATA-O-FILIFILIGA.
 FA'AMATALAGA: a TUSIAGA FA'AALIGA I a1.
 FA'AMATALAGA: b Ituaiga FA'AALIGA I le b1.
 *fa'amatalaga: c ituaiga REF TO c1.
 ***************************************************** ************** FAIA MEA E.
 a = b.  "Upcasting VALAAU METOGA a->m1( ).
 *valaau METHOD a->m2( ).  "E le mafai ona matou mauaina ia lava metotia vasega e faʻaaoga ai le super class ref.
 LAINA FOU.
 b ?= a.  "tu'u i lalo METOTIA VALAGI b->m1( ).
 LAINA FOU.
 VALAAU METOTIA b->m2( ).
 ***************************************************** *************** " sese null ref fatu OBJECT a.
 b ?= a.  "Tu'u i lalo o lo'o tu'u pea lona tu'u tu'u fa'alaua'i METHOD b->m1( ).
 ***************************************************** ************* FAIA MEA a.
 TOFOTO.
 b ?= a.  "Sa e taumafai e faʻaaoga se mea 'NULL' mea e faʻailoa ai le lafoaʻi CATCH cx_sy_move_cast_error.
 VALAAU METOTIA b->m1( ).
 FA'ATAU.
 ***************************************************** ************* FAIA MEA a.
 FAIA MEA E.
 TOFOTO.
 b ?= a.
 PU'E cx_sy_move_cast_error.
 VALAAU METOTIA b->m1( ).
 valaau METHOD b->m2( ).
 FA'ATAU.
 Vasega lcl_shape FAAMATALAGA.
 VAEGA A LE MALO.
 METOFIGA tusi.
 FA'AI'UGA.
 VASEGA lcl_circle FA'AU'UGA TOFI MAI lcl_shape.
 VAEGA A LE MALO.
 METOFAGA: tusi REDEFINITION, calc_area.
 FA'AI'UGA.
 Vasega lcl_shape FAATINOGA.
 METOFAGA tusi.
 TUSI :/ 'Ataina so'o se Fa'atusa'.
 FAAMATALAGA.
 FA'AI'UGA.
 Vasega lcl_circle FAATINOGA.
 METOFAGA tusi.
 TUSI :/ 'Tuku foliga patino: Li'o'.
 FAAMATALAGA.
 METHOD calc_area.
 TUSI :/ 'Area Of Crcle = 2iiR'.
 FAAMATALAGA.
 FA'AI'UGA.
 AMATA-O-FILIFILIGA.
 FA'AMATALAGA: o_cir ITIGA FA'AALI'I I lcl_circle.
 FAITAU MEA O_cir.
 VALAAU METOTIA o_cir->draw( ).  " vala'au subclass Draw() method CALL METHOD o_cir->calc_area( ).
 ULINE.
 "--------- Narrow cast(Upcast) ------------" FA'AMATALAGA : o_shp ITU FA'AALIGA I lcl_shape.
 o_shp = o_cir.  " Narrow cast(Upcast) CALL METHOD o_shp->draw( ).  " vala'au i lalo vasega Draw() metotia "valaau METHOD o_shp->calc_area().  " mea sese ULINE.
 "---------- Fa'alaua'iteleina Cast(Downcast) -----------" FA'AMATALAGA : o_cir1 ITU FA'AALIGA I lcl_circle.
 "o_cir1 = o_shp.  " mea sese o_cir1 ?= o_shp.  " Fa'ateteleina Cast(Downcast) VALA'IGA METHOD o_cir1->draw( ).  " vala'au le vasega laiti Draw() method CALL METHOD o_cir1->calc_area( ).
 Vasega a1 UIGA.
 VAEGA A LE MALO.
 FA'AMATALAGA: NUM1 ITIGA i TAUA 100.
 METOGA:m1.
 FA'AI'UGA.
 Vasega a1 FAATINOGA.
 METOTIA m1.
 TUSI: 'a1:',num1.
 FAAMATALAGA.
 FA'AI'UGA.
 Vasega b1 FAAMATALAGA O TOFI MAI a1.
 VAEGA A LE MALO.
 METOFAGA:m2, m1 TOE FA'AIGA.
 FA'AI'UGA.
 Vasega b1 FAATINOGA.
 METOTIA m1.
 numera1 = numera1 .
 TUSI: 'b1:',num1.
 FAAMATALAGA.
 METOTIA m2.
 TUSI: 'M2 ile vasega b1'.
 FAAMATALAGA.
 FA'AI'UGA.
 AMATA-O-FILIFILIGA.
 FA'AMATALAGA: MATUA IUIGA FA'AALI I a1.
 FA'AMATALAGA: tamaititi ITIGA FA'AALI I LE b1.
 *fa'amatalaga: c ituaiga REF TO c1.
 ***************************************************** ************* FAIA OBJECT tama.
 matua = tama.  "upcasting VALAAU METHOD matua->m1( ).
 VALAAU METOTIA tama->m1( ).
 VALAAU METOTIA tama->m2( ).
 *valaau METHOD a->m2( ).  "E le mafai ona matou mauaina ia lava metotia vasega e faʻaaoga ai le super class ref.
 LAINA FOU.
 tama ?= matua.  " lafo ifo i lalo METOGA VALAʻI tama->m1( ).
 LAINA FOU.
 VALAAU METOTIA tama->m2( ).
 ***************************************************** ***************** *" sese null ref *faia OBJECT a.
 *b ?= a.  "Tu'u i lalo o lo'o lafoa'i pea lona lafoa'i * vala'au METHOD b->m1( ).
 ***************************************************** ***************** * FAIA MEA a.
 TOFOTO.
 b ?= a.  "Sa e taumafai e faʻaaoga se mea 'NULL' mea e faʻailoa ai le lafoaʻi CATCH cx_sy_move_cast_error.
 VALAAU METOTIA b->m1( ).
 FA'ATAU.
 ***************************************************** ***************** * FAIA MEA a.
 FAIA MEA E.
 TOFOTO.
 b ?= a.
 PU'E cx_sy_move_cast_error.
 VALAAU METOTIA b->m1( ).
 valaau METHOD b->m2( ).
 FA'ATAU.
 ******** Tulaga Tulaga Fa'apitoa****************** FA'AMATALAGA : lv_string TYPE manoa, lv_string2 TYPE manoa, lv_string_final TYPE manoa.
 ITIGA: AMATA LE ty_data, auth TYPE c, END OF ty_data.
 FA'AMATALAGA: ls_user TYPE ty_data, ls_user2 TYPE ty_data, lt_user2 ITULAFONO LA'U TYPE OF ty_data, lt_user TYPE TABLE OF ty_data.
 lv_ manoa = 'a,b,c,a'.
 lv_string2 = 'd,b,c,a'.
 VAEGA lv_ manoa I ',' I LE LA'AU lt_user.
 VAVAE lv_string2 I ',' I LE LA'AU lt_user2.
 VA'AI I LE lt_user2 FA'ATA'I FA'A'IGA-FA'ATU( ).
 FA'ATU I totonu o le laulau lt_user.
 ENDLOOP.
 SORT lt_user BY auth.
 AVE'E TUSI FA'ATA'ITA'I MAI lt_user FA'ATA'IGA auth.
 AFAI sy-subrc = 0.
 VA'AI I LE lt_user FA'ATA'I FA'A'IGA-FA'ailoga( ).
 AFAI lv_string_final O LE MATAMATA.
 lv_ manoa_muli = -auth.
 ISI.
 CONCATENATE lv_string_final -auth INTO lv_string_final VAEGA E ','.
 ENDIF.
 ENDLOOP.
 ENDIF.

 

Tuua se faamatalaga

O lenei 'upega tafaʻilagi e faʻaaogaina le Akismet e faʻaitiitia le spam. Aoao pe faapefea ona faʻasoa lau faʻamatalaga faʻamatalaga.