Classic BAdI (09-04-2025)
Classic BAdI (09-04-2025)
============================================
=========================
method ZIF_EX_SHAR_CUSTOM_BADI~DISPLAYTABLERECORDS.
SKIP 1.
WRITE: 'implementation 3 reocrds for vbrk'.
SKIP 1.
SELECT from vbrk
FIELDS VBELN,
FKART,
FKTYP,
VBTYP
INTO TABLE @data(lt_vbrk) UP TO 20 ROWS.
ENDLOOP.
endmethod.
method ZIF_EX_SHAR_CUSTOM_BADI~DISPLAYTABLERECORDS.
SKIP 1.
WRITE: 'Implementatio 2- records of vbak'.
SKIP 1.
SELECT FROM VBAK
FIELDS VBELN,
ERDAT,
ERZET,
ERNAM
INTO TABLE @DATA(lt_vbak) UP TO 20 rows.
endmethod.
*&-----------------------------------------------------------------
----*
*& Report ZSHAR_RP_CUSTOM_BADI
*&-----------------------------------------------------------------
----*
*&
*&-----------------------------------------------------------------
----*
REPORT ZSHAR_RP_CUSTOM_BADI.
CHANGING
instance = o_ref "
Instance
EXCEPTIONS
no_reference = 1 " No
Reference
no_interface_reference = 2 " No
Interface Reference
no_exit_interface = 3 " No Exit
Interface Available
class_not_implement_interface = 4 " Exit Class
Does Not Implement Exit Interface
single_exit_multiply_active = 5 " Multiple
Activation with a Single Exit
cast_error = 6 " Cast Error
exit_not_existing = 7 " Exit does
not exist
data_incons_in_exit_managem = 8 " Data
Consistency in Exit Administration
others = 9
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
o_ref->displaytablerecords( ).
2. Create filter BADI?
3. How to find Standard BADI’s? (Try to Explore)
We can use SAP class CL_EXITHANDLER. In this class, we have the
method GET_INSTANCE.
1. Navigate to se24. Provide the name cl_exithandler as object
type.
2. In that select GET_INSTANCE method. Put breakpoint as sy-
subrc value.
Goto-> attributes
3. Se18->select badi name radio button and click f4 -
>information system
->select radio button classic badi->give package name.
Pass the package name of the program in SE84 transaction code
(Enhancements → Business Add-ins → Definition).
4. Difference between user exit, customer exit and BADI?