Object Oriented etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
Object Oriented etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

14 Şubat 2014 Cuma

Object Oriented - Multiple Inheritance in SAP


You have to use SE24 for  creating multiple Inheritence Object oriented  Class.
Step-1 : Select a name and press "Create" button. 


Step-2: For values, go to "Attribute".
IT_Result -> List of table record.
Gv_MBLNR-> for selecting the record.

Step-2: Go to "Methods". 
For selecting the record of table - SELECT_IT, 
For displaying the record - DISPLAY_IT. 


Step-3: Double click the SELECT_IT and write this code. 


Step-4: Double click the DISPLAY_IT and write this code.

Step-5: Then write a report to call the methods. 


Step-6: This is screen for running report with a parameter 

Final screen is as follows. 

Look at the table, for MJAHR = 2012 




17 Ocak 2014 Cuma

Object Oriented Simple Program

Object Oriented Simple Program 

REPORT ztest1111111.

*----------------------------------------------------------------------*
*       CLASS testclass1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS testclass1 DEFINITION.

  PUBLIC SECTION.
    DATA: lv_answ TYPE char255 VALUE 'This is a variable (lv_answ) defined in testclass1 (class)'.
    METHODS testmethod.

ENDCLASS.                    "testclass1 DEFINITION
*&---------------------------------------------------------------------*
*&       Class (Implementation)  testclass1
*&---------------------------------------------------------------------*
*        Text
*----------------------------------------------------------------------*
CLASS testclass1 IMPLEMENTATION.
  METHOD testmethod.
  WRITE : /'This is written from method (method testclass1 class).'.
  ENDMETHOD.                    "testmethod

ENDCLASS.               "testclass1

START-OF-SELECTION.
data: class1 TYPE REF TO testclass1.
CREATE OBJECT class1.
WRITE: class1->lv_answ.

call METHOD class1->testmethod.


Çıktısı: