Application Development and Automation 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: 
Read only

Error while calling badi using class cl_exithandler with getInstance

Former Member
0 Likes
1,233

hi experts...we are using SAP ECC 6.0 version

I have created BADI Def and Implementation using se18 and se19 with some interface methods..

Problem:

I'm writing a report to call that using class CL_EXITHANDLER but it shows an Exception..

" Exception condition "DATA_INCONS_IN_EXIT_MANAGEM" raised."



Report example:

 DATA: CL_EXIT  TYPE REF TO CL_EXITHANDLER,
      IF_USER_INSTANCE TYPE REF TO ZIF_EX_USER_MAILID1.

CALL METHOD cl_exithandler=>get_instance
  EXPORTING
   EXIT_NAME                       = 'ZBADI_USERMAIL_DEF'
*    NULL_INSTANCE_ACCEPTED        = SEEX_FALSE
*  IMPORTING
*    ACT_IMP_EXISTING              =
  CHANGING
    instance                       = IF_USER_INSTANCE
*  EXCEPTIONS
*    NO_REFERENCE                  = 1
*    NO_INTERFACE_REFERENCE        = 2
*    NO_EXIT_INTERFACE             = 3
*    CLASS_NOT_IMPLEMENT_INTERFACE = 4
*    SINGLE_EXIT_MULTIPLY_ACTIVE   = 5
*    CAST_ERROR                    = 6
*    EXIT_NOT_EXISTING             = 7
*    DATA_INCONS_IN_EXIT_MANAGEM   = 8
*    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.

so i found that all EXITs are in the Table " SXS_ATTR"

but what i have created BADI has not exist in that Table so that it gets an Exception(while i'm debugging found this)

so kindly tel me whats problem my BADI "ZBADI_USERMAIL_DEF" not maintained that Database table

but in Implentation class its working fine..

5 REPLIES 5
Read only

Former Member
0 Likes
946

hai did u created badi with enhancement point , if yes then use get badi and call badi

get instance is for classical badis

m.a

Read only

0 Likes
946

yes i have created badi in Enhancement spot so regarding what u told i'm using GET BADI and CALL BADI


DATA:W_HANDLE TYPE REF TO ZBADI_USERMAIL_DEF.


GET BADI W_HANDLE.

CALL BADI w_handle->get_user_mailid
  EXPORTING
    uname  = UNAME
  changing
    mailid = W_EMAIL
    .

WRITE: / 'UNAME:',UNAME.

WRITE: / 'EMAIL ID',W_EMAIL.

CALL BADI w_handle->get_user_address_data
  EXPORTING
    uname    = UNAME
  changing
    addrdata = W_ADDRDATA
    .
IF W_ADDRDATA IS NOT INITIAL.
  WRITE: / W_ADDRDATA-BNAME,W_ADDRDATA-NAME1,W_ADDRDATA-NAME2,W_ADDRDATA-TELPR,W_ADDRDATA-TELNR,W_ADDRDATA-TEL01.
ENDIF.

but here BADI are not called

Interface implementation class methods not executed so kindly tel me whats problem here.

Thanks in Advance

sivakumar

Read only

0 Likes
946

Hi Mahammad sir...

I have Created Classical BADI and have problem as an Exception "CAST ERROR:"

While I'm using CL_EXITHANDLER=>getInstance method for that Cutom BADI.

So kindly tel me whats problem

Tanks in Advance.

siva

Read only

0 Likes
946

hai shiva,

cast error is may be due to casting problem , u delete ur badi definition and re do once again

first give the badu definition and in that give the interface and create and give the methods and attributes and activate

in ur program

create a data type ref to ur badi and then use call exit handler

m.a

Read only

0 Likes
946

10q u ALL

Regards

sivakumar