Working with Polymorphism

....Previous

Select select _ method then press the REDEFINE button.

Then screen would like this.

Provide the logic.

Then save it .

Go to Attributes.

Then provide the Variables.

Go back to the methods.

Then provide another method.

 

Double click on the method then provide the logic

 

Click on SAVE  , CHECK  , and ACTIVATE

Then provide the code in the T-Code SE38.

Provide the logic.

 *Provide Object for Sub Class

DATA: OBJ1 TYPE REF TO ZCL_POLYMORPHISM_SUB.
*Provide Parameters
PARAMETERS: V_VBELN TYPE VBAP-VBELN.
*Provide Data Objects
DATA: WA_VBAP TYPE VBAP,
      IT_VBAP TYPE Z_VBAP.
*Create the Object
CREATE OBJECT OBJ1.
*Call the Redefine Select Method
CALL METHOD OBJ1->SELECT_METHOD
  EXPORTING
    P_VBELN = V_VBELN
*  IMPORTING
*    WA_VBAK =.
*Provide the IT_VBAP Values
IT_VBAP = OBJ1->IT_VBAP.
LOOP AT IT_VBAP INTO WA_VBAP.
  WRITE:/ WA_VBAP-VBELN,
          WA_VBAP-POSNR,
          WA_VBAP-MATNR.
ENDLOOP.

Click On  SAVE , CHECK , ACTIVATE  and  EXECUTE  it. 

Output :- 

 

The output data display in the list. 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image