SAP Tutorials Blog


 



Fallback class


The BAdI enhancement spot repository object is opened.


Choose the Fallback Class link in the Configuration section.


Walk through the New ABAP Class wizard:


Enter the name ZCL_DEMO_ABAP_CALCULATOR_FB and add a description.

Ensure the interface ZIF_DEMO_ABAP_CALCULATOR is included in the Interfaces list.

Add the following code and activate the class.


CLASS zcl_demo_abap_calculator_fb DEFINITION

  PUBLIC

  FINAL

  CREATE PUBLIC .


  PUBLIC SECTION.


    INTERFACES if_badi_interface .

    INTERFACES zif_demo_abap_calculator .

  PROTECTED SECTION.

  PRIVATE SECTION.

ENDCLASS.




CLASS zcl_demo_abap_calculator_fb IMPLEMENTATION.

  METHOD zif_demo_abap_calculator~calculate.

    result = |{ num1 + num2 }|.

  ENDMETHOD.

ENDCLASS.


Serkan AKKAVAK

Computer Engineer BSc

Head of SAP & Software Department

Contact : serkurumsal@yandex.com