Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom BADI Creation

Former Member
0 Kudos

Hi xperts,

Is it possible to create our own custom badi (not implementation of custom one) and attached to the user exit of the standard code.

If so please let me know the steps and reference.

Thanks.

3 REPLIES 3

Former Member

GauthamV
Active Contributor
0 Kudos

Former Member
0 Kudos

Hi

Yes u can, I don't know if it makes sense but u can.

U can create a your own BADI defination by trx SE18, after creating it the system automatically creates the interface, so u need to implement it.

In the interface u need to defines all elements (methods, attributes,...) of the BADI.

Now u can implement the code to call the BADI in the user-exit, something like this:

* Define the object for the BADI:
DATA: MY_BADI TYPE REF TO Z_IF_EX_ <---- Interface of BADI

* Create the instance for the BADI object:

  CALL METHOD cl_exithandler=>get_instance
      CHANGING instance =  MY_BADI.

* Call the method of BADI u need
  IF NOT MY_BADI IS INITIAL.
    CALL METHOD MY_BADI->MY_METHOD.
  ENDIF.

Max

Edited by: max bianchi on Jun 26, 2008 12:12 PM