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: 

Calling the custom badi from executable program

Former Member
0 Kudos

Hello Friends,

I have created a custom Badi definition ,interface, methods,class in the Enhancement Spot,

i need to call the custom badi in the executable program.

my problem is: while getting the instance of the interface by using

CALL METHOD cl_exithandler=>get_instance

here it goes to dump since there ie no entry in the table sxs_attr what can i do for that.

Thanks in advance.

Arun.

3 REPLIES 3

Former Member
0 Kudos

let me know ur mail id . I will forward you the right document with a sample program which explains the one that you are trying .

Find some extract from the document below. This will explain how to handle

CALL METHOD CL_EXITHANDLER=>get_instance

RB.

***********************

REPORT YSPFLIBADI NO STANDARD PAGE HEADING.

*& UI

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

PARAMETERS : P_CARRID TYPE SPFLI-CARRID.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

PARAMETERS : R1 RADIOBUTTON GROUP RAD,

R2 RADIOBUTTON GROUP RAD,

R3 RADIOBUTTON GROUP RAD.

SELECTION-SCREEN END OF BLOCK B2.

*& DATA DECLARATION

DATA : INSTANCE TYPE REF TO YIF_EX_C_SPFLI_BADI.

DATA : P_CONNID TYPE SPFLI-CONNID,

WA1 TYPE ZSPFLI_STR.

*& INTERNAL TABLE DECLARATION

DATA : JTAB TYPE ZSPFLI_ITAB.

&----


*&APPLICATION LOGIC

&----


*& EVENTS

INITIALIZATION.

CALL METHOD CL_EXITHANDLER=>get_instance

CHANGING

INSTANCE = INSTANCE.

IF INSTANCE IS INITIAL.

MESSAGE E112(0) WITH 'ERROR IN BADI'.

ENDIF.

AT SELECTION-SCREEN.

IF ( R1 NE 'X' ) AND ( R2 NE 'X' ) AND ( R3 NE 'X').

MESSAGE E111(0) WITH 'INVALID SELECTION'.

ENDIF.

START-OF-SELECTION.

IF R1 EQ 'X'.

CALL METHOD INSTANCE->GET_CONNID

EXPORTING CARRID = P_CARRID

IMPORTING CONNID = P_CONNID.

IF NOT P_CONNID IS INITIAL.

WRITE : /20 'CONNID = ', P_CONNID .

ENDIF.

ELSEIF R2 EQ 'X'.

CALL METHOD INSTANCE->GET_SINGLE_RECORD

EXPORTING CARRID = P_CARRID

IMPORTING WA = WA1.

IF NOT WA1 IS INITIAL.

WRITE : /2 'CONNID' .

WRITE : / WA1-CARRID,WA1-CONNID,WA1-CITYFROM,WA1-CITYTO.

ENDIF.

ELSE.

CALL METHOD INSTANCE->GET_MULTIPLE_RECORDS

EXPORTING CARRID = P_CARRID

IMPORTING ITAB = JTAB.

IF NOT JTAB IS INITIAL.

DATA : WA2 LIKE LINE OF JTAB.

ULINE AT :/2(52).

WRITE : /2 'CARRID' COLOR COL_POSITIVE ,

9 'CONNID' COLOR COL_NEGATIVE,

18 'CITYFROM' COLOR COL_GROUP,

38 'CITYTO' COLOR COL_HEADING.

ULINE AT :/2(52).

LOOP AT JTAB INTO WA2.

WRITE : / WA2-CARRID UNDER 'CARRID',

WA2-CONNID UNDER 'CONNID',

WA2-CITYFROM UNDER 'CITYFROM',

WA2-CITYTO UNDER 'CITYTO'.

ULINE AT :/2(52).

ENDLOOP.

ENDIF.

ENDIF.

0 Kudos

hi raj...

im having the same problem , my badi oriented data not available in table SXS_ATTR .

it shows a dump error as :

Short text

Exception condition "DATA_INCONS_IN_EXIT_MANAGEM" raised.

What happened?

The current ABAP/4 program encountered an unexpected

situation.

Error analysis

A RAISE statement in the program "CL_EXITHANDLER================CP" raised the

exception

condition "DATA_INCONS_IN_EXIT_MANAGEM".

Since the exception was not intercepted by a superior

program, processing was terminated.

Short description of exception condition:

For detailed documentation of the exception condition, use

Transaction SE37 (Function Library). You can take the called

function module from the display of active calls.

-

Trigger Location of Runtime Error

Program CL_EXITHANDLER================CP

Include CL_EXITHANDLER================CM001

Row 155

Module type (METHOD)

Module Name GET_INSTANCE

Plz give me the solution ya . or else sent some document to my id get from my business card .

Thanks & Regards

Deepa.

Former Member
0 Kudos

Please send Badi Material to this mail id

Thanks in Advance