12-21-2007 10:32 AM
Hi Experts,
I am trying to use a BADI in my report Program.
But it is throwing a runtime error "DATA_INCONS_IN_EXIT_MANAGEM".
I debugged the program and found that the call to the GET_INSTANCE method of Class CL_EXITHANDLER is raising this error.
It is because the instance parameter is Initial.
Can you please let me know, what is the mistake i am doing.
My report code is as follows:
&----
*& Report Z_GKR_BADI_01
*&
&----
*&
*&
&----
REPORT z_gkr_badi_01.
CLASS cl_exithandler DEFINITION LOAD.
DATA: l_badi_instance TYPE REF TO zif_ex_gkr_matnrdata, "BADI Interface
mara LIKE mara.
PARAMETERS: p_matnr LIKE mara-matnr OBLIGATORY.
START-OF-SELECTION.
CALL METHOD cl_exithandler=>get_instance
EXPORTING
exit_name = 'ZGKR_MATNRDATA' "BADI Definition Name
null_instance_accepted = 'X'
CHANGING
instance = l_badi_instance.
CALL METHOD l_badi_instance->get_materials
EXPORTING
matnr = p_matnr
IMPORTING
mara = mara.
WRITE: /5 mara-matnr,
mara-matkl,
mara-meins.
Cheers
Gaurav Raghav
12-21-2007 3:12 PM
the interface 'zif_ex_gkr_matnrdata' and exit name 'ZGKR_MATNRDATA' does not exists in the table sxs_inter.
the reason is this interface is not there in the sxs_inter. maintain entry there.
12-21-2007 3:12 PM
the interface 'zif_ex_gkr_matnrdata' and exit name 'ZGKR_MATNRDATA' does not exists in the table sxs_inter.
the reason is this interface is not there in the sxs_inter. maintain entry there.
12-24-2007 9:06 AM
Hi lakshmi,
Can i maintain entries in a SAP table???
I doubt we can change entries in SAP Table directly.
Can you please guide me how to go about it.
Thanking you.
Cheers
Gaurav Raghav
12-26-2007 3:22 PM
can i know the complete functionality of ur requirement as well as complete code?
12-26-2007 3:33 PM
Hi lakshmi,
I am new to BADI and i am doing a tutorial.
The Complete Code is given with at the thread starting.
In the Interface method i am retreiving Material details from the table MARA based on MATNR.
The code is as follows:
&----
*& Report Z_GKR_BADI_01
*&
&----
*&
*&
&----
REPORT z_gkr_badi_01.
CLASS cl_exithandler DEFINITION LOAD.
DATA: l_badi_instance TYPE REF TO zif_ex_gkr_matnrdata,
mara LIKE mara.
PARAMETERS: p_matnr LIKE mara-matnr OBLIGATORY.
START-OF-SELECTION.
CALL METHOD cl_exithandler=>get_instance
EXPORTING
exit_name = 'ZGKR_MATNRDATA'
null_instance_accepted = 'X'
CHANGING
instance = l_badi_instance.
CALL METHOD l_badi_instance->get_materials
EXPORTING
matnr = p_matnr
IMPORTING
mara = mara.
WRITE: /5 mara-matnr,
mara-matkl,
mara-meins.
******************************************************************************************************************************************************************************************************************
Interface Method Implementaion in BADI
METHOD zif_ex_gkr_matnrdata~get_materials.
IF NOT matnr IS INITIAL.
SELECT SINGLE *
FROM mara
INTO mara
WHERE matnr = matnr.
ENDIF.
ENDMETHOD.
I checked and i didn't find the entry in the table mentioned by you.
But isnt the entry supposed to come automatically once i define the BADI.
The BADI Definition name is ZGKR_MATNRDATA.
Please help me regarding the same.
12-28-2007 1:52 PM
have u defined class 'zif_ex_gkr_matnrdata'?? in se24
12-28-2007 1:59 PM
Hi lakshmi,
I am really sorry for the trouble caused to you.
Actually i made a stupid mistake of using the Classic BADI transactions while calling the BADI, when i had defined the NEW BADI.
I have got the error resolved in both ways now.
That is , i used both classic BADI and New BADI to complete the tutorial.
Sorry again.
Cheers
Gaurav Raghav