Global interface with example using parameters.

* Interface is the collection of methods which are defined & not implemented.

* In interface all methods are public by default.

* In interface all methods are abstract methods.


Steps to create global interface in SE24.

1. Goto T-code SE24.

2. Give name and click on create, select interface and press enter.

3. Give description, Press enter.





4. Give method name, level, description. 



5. Save and activate.

6. Click on parameters and give parameters.



7. Save and activate and go back.

8. Create a sub class.

    * Goto T-code SE24.

    * Give name, Press enter, select class and press enter.

    * Give description and press enter.



   
 Goto Interface and give interface name and press enter.

    * Goto methods double click on method and write logic.

            METHOD zab_if_sale_delivery~display.

        SELECT SINGLE erzet
                      erdat
                      vbtyp
                      ernam
                      FROM vbak
                      INTO perzet,perdatpvbtyppernam )
                      WHERE vbeln EQ pvbeln.
      ENDMETHOD.
  * Check and activate.
  * Execute.
    
  * Input
    * Click on edit interface view.


  * Output


9. Create another sub class for delivery.
    * Repeat step 8.
    * Write logic.
    METHOD zab_if_sale_delivery~display.
        SELECT SINGLE erzet
                      erdat
                      vbtyp
                      ernam
                      FROM likp
                      INTO perzet,perdatpvbtyppernam )
                      WHERE vbeln EQ pvbeln.
    ENDMETHOD.
    
    * Input

   * Output
    


*********************Thank you*******************

Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).