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

How to Implement this Badi?

Hi all,

I have a requirement which requires me to Implement the Badi 'DOC_PERSONALIZE_BCS' .

This is a filter dependent Badi.

When I try to Implement this Badi , I am required to give a filter value.

When I give the filter value and try to activate the Badi , I get a message as follows:

"There are already Active Implementations for these Filter types"

I checked and found out that there is already a Standard Implementation for this Badi.

I want my Badi to get activated.

Please tell me how I can activate my Badi for the Filter type.

Kindly reply immediately as this is bit urgent.

Regards,

Vijay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 05:21 PM

    Hello,

    I believe that if you make your implementation of the BADI, 'DOC_PERSONALIZE_BCS

    a 'Multiple use' type of BADI you should be OK.

    Read the help on this checkbox for some advice when making aBADI multiple use.

    Hope this helps

    Regards

    Greg Kern

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 27, 2008 at 05:28 PM

    You can't just change it to multiple use, since SAP especially designed this BAdI to make there is only one active implementation. In some cases it doesn't matter if there are more (for example if you want to do multiple checks), but in this case it probably will give error (inconsistencies or whatever) if there were to be more than one implementation.

    It looks like the standard implementation already uses the same filter. So if this standard implementation doesn't do the trick (whatever that may be) for you, you should deactivate the standard implementation and than activate your implementation. But be careful and make sure this is absolutely necessary and you're not going to lose any functionality when deactivating the standard implementation.

    Good luck.

    Micky.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 05:44 PM

    It looks like the standard implementation already uses the same filter that you are using for your implementation. If this standard implementation does not help you in doing what you wanted to achieve, then you should deactivate the standard implementation and than activate your new implementation. But make sure you dont lose any functionality. So to be on the safer side, copy the code of the standard implementation and put that in your implementation and then add your piece of code.

    Check for any OSS note for deactivating the standard implementation of the BADI. I assume you may need access key to do the same.

    Check the below document for more information on BADI

    DOC_PERSONALIZE_BCS.

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60acb060-fb1b-2a10-8aa8-ddbb40fe7de3

    Hope this helps. <REMOVED BY MODERATOR>

    Thanks,

    Balaji

    Edited by: Alvaro Tejada Galindo on Mar 27, 2008 1:45 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 05:57 PM

    DEFINING THE BADI

    1) execute Tcode SE18.

    2) Specify a definition Name : ZBADI_SPFLI

    3) Press create

    4) Choose the attribute tab. Specify short desc for badi.. and specify the type :

    multiple use.

    5) Choose the interface tab

    6) Specify interface name: ZIF_EX_BADI_SPFLI and save.

    7) Dbl clk on interface name to start class builder . specify a method name (name,

    level, desc).

    Method level desc

    Linese;ection instance methos some desc

    8) place the cursor on the method name desc its parameters to define the interface.

    Parameter type refe field desc

    I_carrid import spfli-carrid some

    I_connid import spefi-connid some

    9) save , check and activate…adapter class proposed by system is

    ZCL_IM_IM_LINESEL is genereated.

    IMPLEMENTATION OF BADI DEFINITION

    1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.

    2) Specify aname for implementation ZIM_LINESEL

    3) Specify short desc.

    4) Choose interface tab. System proposes a name fo the implementation class.

    ZCL_IM_IMLINESEL which is already generarted.

    5) Specify short desc for method

    6) Dbl clk on method to insert code..(check the code in “AAA”).

    7) Save , check and activate the code.

    Some useful URL

    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt

    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf

    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc

    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc

    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf

    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm

    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm

    Now write a sample program to use this badi method..

    Look for “BBB” sample program.

    “AAA”

    data : wa_flights type sflight,

    it_flights type table of sflight.

    format color col_heading.

    write:/ 'Flight info of:', i_carrid, i_connid.

    format color col_normal.

    select * from sflight

    into corresponding fields of table it_flights

    where carrid = i_carrid

    and connid = i_connid.

    loop at it_flights into wa_flights.

    write:/ wa_flights-fldate,

    wa_flights-planetype,

    wa_flights-price currency wa_flights-currency,

    wa_flights-seatsmax,

    wa_flights-seatsocc.

    endloop.

    “BBB”

    &----


    *& Report ZBADI_TEST *

    *& *

    &----


    REPORT ZBADI_TEST .

    tables: spfli.

    data: wa_spfli type spfli,

    it_spfli type table of spfli with key carrid connid.

    *Initialise the object of the interface.

    data: exit_ref type ref to ZCL_IM_IM_LINESEL,

    exit_ref1 type ref to ZIF_EX_BADISPFLI1.

    selection-screen begin of block b1.

    select-options: s_carr for spfli-carrid.

    selection-screen end of block b1.

    start-of-selection.

    select * from spfli into corresponding fields of table it_spfli

    where carrid in s_carr.

    end-of-selection.

    loop at it_spfli into wa_spfli.

    write:/ wa_spfli-carrid,

    wa_spfli-connid,

    wa_spfli-cityfrom,

    wa_spfli-deptime,

    wa_spfli-arrtime.

    hide: wa_spfli-carrid, wa_spfli-connid.

    endloop.

    at line-selection.

    check not wa_spfli-carrid is initial.

    create object exit_ref.

    exit_ref1 = exit_ref.

    call method exit_ref1->lineselection

    EXPORTING

    i_carrid = wa_spfli-carrid

    i_connid = wa_spfli-connid.

    clear wa_spfli.

    u can find BADI's in different ways...

    1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..

    2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..

    There are multiple ways of searching for BADI.

    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE

    • Finding BADI Using SQL Trace (TCODE-ST05).

    • Finding BADI Using Repository Information System (TCODE- SE84).

    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.

    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.

    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.

    2. Start transaction ST05 (Performance Analysis).

    Set flag field "Buffer trace"

    Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)

    Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.

    Push the button "Deactivate Trace".

    Push the button "Display Trace".

    The popup screen "Set Restrictions for Displaying Trace" appears.

    Now, filter the trace on Objects:

    • V_EXT_IMP

    • V_EXT_ACT

    Push button "Multiple selections" button behind field Objects

    Fill: V_EXT_IMP and V_EXT_ACT

    All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.

    So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA

    3. Go to “Maintain Transaction” (TCODE- SE93).

    Enter the Transaction VD02 for which you want to find BADI.

    Click on the Display push buttons.

    Get the Package Name. (Package VS in this case)

    Go to TCode: SE84->Enhancements->Business Add-inns->Definition

    Enter the Package Name and Execute.

    Here you get a list of all the Enhancement BADI’s for the given package MB.

    The simplese way for finding BADI is

    1. chooes Tcode Program & package for that Tcode.

    2. Go to Tcode se18

    3. Press F4

    4. search by package or by program.

    http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm

    and

    http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm

    regards,

    prabhu

    <REMOVED BY MODERATOR>

    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 10:57 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2008 at 02:54 PM

    Hi all,

    Thanks for all your replies.

    Regards,

    Vijay

    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.