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: 

Runtime error "DATA_INCONS_IN_EXIT_MANAGEM" while executing a BADI

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

can i know the complete functionality of ur requirement as well as complete code?

0 Kudos

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.

0 Kudos

have u defined class 'zif_ex_gkr_matnrdata'?? in se24

0 Kudos

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