Skip to Content
author's profile photo Former Member
Former Member

Calling the custom badi from executable program

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2008 at 01:55 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 06:33 AM

    Please send Badi Material to this mail id

    Thanks in Advance

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.