2009 Aug 07 10:22 AM
Hi All,
I have one doubt - Suppose I ahve created one customize BADI inse 18 and implement in SE19.But how can I use it in standard transaction or any other transaction.
Could you please guide me.
Thanks in advance...
Amar
2009 Aug 07 10:33 AM
Hi
If you've created a custom BADI, the system has generated the interface, in the program where u need to use the BADI, u need to define a variable like the interface.
DATA: MY_BADI TYPE REF TO <Z interface>.
Then u need to place in a strategic point of the program the calls of the methods of your BADI:
CALL METHOD MY_BADY->MY_METHOD
Now before calling a method of the BADI u need to make sure the BADI is implemented and the instance is created, u need to use the method GET_INSTANCE of class CL_EXITHANDLER to do it:
CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
EXPORTING
EXIT_NAME = <BADI name>
NULL_INSTANCE_ACCEPTED = NULL_INSTANCE_ACCEPTED
IMPORTING
ACT_IMP_EXISTING = ACT_IMP_EXISTING
CHANGING
INSTANCE = MY_BADI
EXCEPTIONS
OTHERS = 1.Max
Hi
If you've created a custom BADI, the system has generated the interface, in the program where u need to use the BADI, u need to define a variable like the interface.
DATA: MY_BADI TYPE REF TO <Z interface>.
Then u need to place in a strategic point of the program the calls of the methods of your BADI:
CALL METHOD MY_BADY->MY_METHOD
Now before calling a method of the BADI u need to make sure the BADI is implemented and the instance is created, u need to use the method GET_INSTANCE of class CL_EXITHANDLER to do it:
CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
EXPORTING
EXIT_NAME = <BADI name>
NULL_INSTANCE_ACCEPTED = NULL_INSTANCE_ACCEPTED
IMPORTING
ACT_IMP_EXISTING = ACT_IMP_EXISTING
CHANGING
INSTANCE = MY_BADI
EXCEPTIONS
OTHERS = 1.Max
2009 Aug 07 10:31 AM
Any BADI, should get triggered by the class, CL_EXITHANDLER and method get_instance. Here exit name should be your BADi name.
CALL METHOD cl_exithandler=>get_class_name_by_interface
EXPORTING
instance = instance
IMPORTING
class_name = class_name
CHANGING
exit_name = Should be your BADI Name
EXCEPTIONS
no_reference = 1
no_interface_reference = 2
no_exit_interface = 3
data_incons_in_exit_managem = 4
class_not_implement_interface = 5
OTHERS = 6.
Kuntal
2009 Aug 07 10:33 AM
Hi
If you've created a custom BADI, the system has generated the interface, in the program where u need to use the BADI, u need to define a variable like the interface.
DATA: MY_BADI TYPE REF TO <Z interface>.
Then u need to place in a strategic point of the program the calls of the methods of your BADI:
CALL METHOD MY_BADY->MY_METHOD
Now before calling a method of the BADI u need to make sure the BADI is implemented and the instance is created, u need to use the method GET_INSTANCE of class CL_EXITHANDLER to do it:
CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
EXPORTING
EXIT_NAME = <BADI name>
NULL_INSTANCE_ACCEPTED = NULL_INSTANCE_ACCEPTED
IMPORTING
ACT_IMP_EXISTING = ACT_IMP_EXISTING
CHANGING
INSTANCE = MY_BADI
EXCEPTIONS
OTHERS = 1.Max
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |