Creating a Multiple Use BADI

Hi everyone,
Is it possible to create a new BADI? Not an implementation I want to create a whole new BADI. Can anyone please let me know how to do it.
Thanks,
John

Hi John,
You can use the transaction SE18 to define a new BAdI definition which may be implemented by other developers later. It is not so challenging. Here is the roadmap:
A. BAdI Definition
1. SE18
2. Enter the name for the BAdI to be created in customer namespace and press "Create".
3. Enter a definition for your BAdI and on the interface tab enter a name for the BAdI interface. SAP proposes a name and it is pretty good. Meanwhile a BAdI class is also created which is not in our concern.
e.g for "ZTEST", SAP proposes "ZIF_EX_TEST" for the interface and "ZCL_EX_TEST" for the class.
4. Save your BAdI.
5. Double-click on the interface name. It will pass to a Class Builder session to make you implement your interface. If you are not familiar to the Class Builder; it's a bit like Function Builder and it will be easy to discover its procedure.
6. Save and activate your interface.
B. Calling your BAdI from an application program
1. Declare a reference variable with reference to the Business Add-In interface.
e.g. DATA exit_ref TYPE REF TO zif_ex_test.
2. Call the static method GET_INSTANCE of the service class CL_EXITHANDLER. This returns an instance of the required object.
e.g.
CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
CHANGING instance = exit_ref .
3. After those two steps, you can now call all of the methods of the BAdI where it is required in your program. Make sure you specify the method interfaces correctly.
C. BAdI Implementations
1. SE19
2. Enter the name for the BAdI implementation to be created in customer namespace and press "Create".
3. It will request the BAdI definition name to which this implementation will be tied.
4. Enter a definition for your implementation and on the interface tab enter a name for the implementing class. Again SAP proposes a name and it is pretty good.
e.g for "ZIMPTEST", SAP proposes "ZCL_IM_IMPTEST".
5. Save your implementation.
6. To implement a method, just double-click on the method name and you will be taken to the Class Builder to write the code for it. Here you redefine the BAdI interface methods.
7. You must activate your implementation to make it executable. You can only activate or deactivate an implementation in its original system without modification. The activation or deactivation must be transported into subsequent systems
That's all. For further details, i.e. filter-dependence, multi-usage, menu nehancements etc... you can have a look at course materials of BC425 "Enhancements and Modifications".
Regards
Aneesh.
Source : SDN forum

Similar Messages

  • Multiple use Badi implementation

    Dear Experts,
    I have created a custom BADI definition of multiple use type and one implementation for it n it is working fine but now i want to create multiple implementations for it.
    But when im trying to use method of second implementation in my program its raising an error that this method is not defined.
    Hope u understand my query.Plz explain me with an example that how to implement multiple use BADI's.
    Thanx in advance.

    Hi,
    You can implement several BADIs based on the same definition if FILTER option or MULTIPLE USE option are active.
    In this way you can have (implement) the same method does different actions according to the BADI where it's defined.
    So you can use the FILTER to decide which method (BADI) has to work.
    If the FILTER isn't active a definition of a BADI can use once, so it can implement only ones.
    But if the flag MULTIPLY USE is active it can use the same BADI for several implematations.
    In this case every BADIs'll works because there isn't a filter.
    So you can implement several actions.
    See this Weblogs,
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    See here:
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/cs/user/view/cs_msg/9494
    http://www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    Regards,
    Padmam.

  • Multiple use BADIs

    Hi ABAP Gurus,
    Can someone brief a scenario in which multiple use BADI was used or will be helpful.
    Thanks,
    Soorya

    Hello Soorya
    Example of multiple-used BAdIs (ca. 850 in ECC 5.0) are:
    - BADI_MATERIAL_CHECK (Enhanced checks for material master table)
    - BADI_SD_BILLING (Billing Enhancements)
    - BUPA_PCARD_CHECK (Additional Checks for Payment Cards)
    Many, if not most, of these BAdIs are used for checking or validating data. The active implementations of such a BAdI must be independent meaning they must not rely on a specific calling order (see SAP documentation below).
    <b>Multiple Usability for BADI Definitions</b>                                                                               
    Definition                                                                               
    Multiple use for BADI definitions  means that there can be several     
        active BADI implementations. When there is a call, they are all called 
        up - however, in an unpredictable sequence.                                                                               
    If you have multiple-use BADI definitions, the sequence must not play  
        any role therefore. A typical example is the execution of checks before
        a save.
    Regards
      Uwe

  • Create Virtual Keyfigure using BADI

    Hi All,
    I Am tring to implement a virtual keyfigure using BADI, here is what i did created a Enhancement for BADI RSR_OLAP_BADI but i am not sure how to write the code for methods DEFINE and COMPUTE, i am just trying to populate value 100 for Virtual Keyfigure ZVIRT (Just testing) and i am using this keyfigure in my ODS.
    here is the define method i have:
    METHOD IF_EX_RSR_OLAP_BADI~DEFINE .
      DATA: l_s_chanm   TYPE rrke_s_chanm,
            l_kyfnm     TYPE rsd_kyfnm,
            l_s_chanm_used TYPE rschanm.
      FIELD-SYMBOLS:
            <l_s_chanm> TYPE rrke_s_chanm,
    CASE i_s_rkb1d-infocube.
    WHEN 'CUBEXYZ'.
    ENDCASE.
    ENDMETHOD.
    Compute Method:
    METHOD IF_EX_RSR_OLAP_BADI~COMPUTE .
    ENDMETHOD.

    found this code in other post thought this would be helpful for others, this works.
    The coding for DEFINE is
    DATA: l_s_chanm TYPE rrke_s_chanm,
    l_kyfnm TYPE rsd_kyfnm.
    FIELD-SYMBOLS:
    <l_s_chanm> TYPE rrke_s_chanm.
    CASE i_s_rkb1d-infocube.
    WHEN 'MYCUBE'.
    characteristic
    l_s_chanm-chanm = 'ZVIRTUAL'.
    l_s_chanm-mode = rrke_c_mode-no_selection.
    APPEND l_s_chanm TO c_t_chanm.
    l_s_chanm-chanm = 'ZPMORDER'.
    l_s_chanm-mode = rrke_c_mode-read.
    APPEND l_s_chanm TO c_t_chanm.
    The coding for compute is:
    field-symbols: <f_virt> type /bic/oizvirtual,
    <f_ord> type /bic/oizpmorder.
    if P_CHA_zvirtual > 0.
    assign component P_CHA_zvirtual of structure C_S_DATA to <f_virt>.
    if P_CHA_zpmorder > 0.
    assign component P_CHA_zpmorder of structure C_S_DATA to <f_ord>.
    <f_virt> = <f_ord>+2(3).
    else.
    clear <f_virt>.
    endif.
    else.
    clear <f_virt>.
    endif.

  • Multiple Use BADI help

    Hi
    do you think it is appropriate to give as example calculation of shape (square, rectangle, triangle)
    as an example to BADI Multiple use?
    can you give me a tips on how i can start

    Hi,
    Pls go through the following links
    BADI's
    BADI's
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    http://www.esnips.com/web/BAdI
    http://www.allsaplinks.com/badi.html
    New to Badi
    Thanks,
    Reward If Helpful.

  • Multiple use badi

    hi guru,
    i am new in  abap,
    if we have 20 badi's using multiple implimentation.which one trigger first.it is necessary to deactive all badi before running new badi name of some single use ,multiple,filter dependent badi in crm.

    Hi,
    As per my understanding, your query is this - for a single BAdI there might be multiple implementation and which one will be triggered first.
    As per SAP, there is no guarantee of the order of the call of the BAdI Implementation, but only thing that can be guaranteed is that all the active implementation will be called. You don't need to deactivate any Badi before implementing your BAdI.
    I hope this answers your question.
    Some important BadI's of SAP CRM are - ORDER_SAVE, COM_PARTNER_BADI, etc.
    Thanks,
    Samantak

  • Creation of "New Badi" with Multiple Use

    Hi,
    I am trying to create New badi within enhancement spot which is multiple use, problem here is the badi interface method has got some exporting parameters.
    when i try to activate badi definition it is showing the error this type of interface which is having exporting or returning parameters cannot be used, however if i remove export parameters in the interface method, then i am able to activate the BADI definition.
    Please suggest me, is it not possible to have badi interface method with exporting or returning parameters if it is Multiple Use Badi???
    Thanks,
    Kranthi.

    Answered my self.
    it is the restriction. below is SAP documentations that explains the same
    http://help.sap.com/saphelp_nw70/helpdata/en/e4/5c3642eca5033be10000000a1550b0/frameset.htm

  • Multiple-Use in BADI

    Hi Friends,
                 Could any one you please let me know the purpose of Multiple-Use Atrribute in BADI.
    Awaiting for a qick response.
    Thanks in Advance
    Regards
    Tina

    Hi,
    check this sap Help..
    Multiple Usability for BADI Definitions
    Multiple use for BADI definitions means that there can be several active BADI implementations. When there is a call, they are all called up - however, in an unpredictable sequence.
    If you have multiple-use BADI definitions, the sequence must not play any role therefore. A typical example is the execution of checks before a save.
    Regards
    vijay

  • I'm asked to deselect the GR indicator for ZNPP purchase orders using BADI.

    Hi Experts,
    I'm asked to deselect the GR indicator against ZNPP purchase orders created from SRM using BADIs
    BAdI BBP_CREATE_BE_PO_NEW ,BBP_CREATE_BE_RQ_NEW  and FILL_PO_INTERFACE1  and FILL_RQ_INTERFACE  methods respectively.
    Can you please give me idea what I can do with this..
    Im unable to find the field name(WEPOS) for GR indicator.
    Please help me out..today is the deadline for me.

    These BADI's are in SRM not in ECC. Check the interface parameters of those badi methods. you will find some option to pass. if not you have to do it in ECC only.

  • Ques on Single use Badi

    Hi Frds,
    I search a lot but could not found much except defination of Singel Use Badi.
    Few Ques i have, Please share you though.
    Example : Calculating Net value in Badi.
    1) After the single use BAdi called, can we change this value at run rime.
    2)  Name few single use BAdi in SAP CRM.
    3) Some of the example/requirement where single use Badi used.
    Thanks
    Imran

    Hi Deva,
    It is up to functional requirements. In multiple use BADI you can implement a BADI many times depending on filter value. Think the scenario you are workin in an international company and there is a requirement to calculate tax for each country and there is a BADI. If country key is defined as filter value you can implement same BADI for each different country and differemt implementation will run in all different countries.
    But as you can see it is not always necessary. Functionally you may not need to implement your BADI more than one times. It can be enough to use only one implementation.
    Regards,

  • Difference between multiple use and filter depend in BADis

    Dear Experts,
    Can u plz tell me the major difference between <b>MULTIPLE USE</b> and<b> FILTER DEPEND</b> types in badi definition.Is it possible to create a BAdi definition without selecting none of them
    Thanks & regards,
    vineel

    You can differentiate between single-use and multiple use Business Add-Ins. The distinction is based on the procedure or event character of an enhancement. In the first case, the program waits for the enhancement to return something, usually a return code. A typical example could be a benefit calculation in HR. Depending on the implementation, alternative calculations can be executed. With multiple use add-ins, an event that may be of interest to other components is processed in program flow. Any number of components could use this event as a “hook” to hang their own additional actions on to.
    Business Add-Ins may be implemented on the basis of a filter value. If an enhancement for country-specific versions is provided for in the standard version, it is likely that different partners will want to implement this enhancement. The individual countries can create and activate their own implementation.
    Enter a filter type when defining your enhancement (a country or industry sector, for example). All methods created in the enhancement's interface have filter value FLT_VAL as their importing parameter. The application program provides the filter value for the enhancement method. The method then selects the active implementation for that value.
    http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf4940e11d295df0000e82de14a/frameset.htm

  • Unable to check multiple use check box for BADI

    Hi,
    In ECC 6.0, when I am trying to activate the multiple use check box ( For multiple implementation of BADI ) , it is not allowed me the same.
    Throwing the error as - interface IF_EX_TAX1_XTXIT_SET can not be used.
    BADI name - BADI_TAX1_XTXIT_SET
    Can anyone pls help me how to do this.
    Thanks,
    Shakti

    Hello Sakti,
    I am also in ECC6.0 & if i see the definition of the BAdI BADI_TAX1_XTXIT_SET, "Multiple Use" checkbox is checked! What are you trying to do - trying to create an implementation?
    @Prabhu: Although the BAdI is "multiple-use", but there is not filter applied to it. Next time do your checks properly before replying
    BR,
    Suhas

  • About BAdI's Atribute: Multiple-Use

    Hi all,
    I found a BAdI that may be very useful for me. But its attribute "Mutiple Use" is not selected. When I create an implementation,I find it can not be activated.   Could you tell me why?  And Can I use this BAdI ?

    Hello Alex
    Since the flag "Multiple Use" is not marked you can have only a single active BAdI implementation.
    There is another standard or customer implementation which is already active (check in SE18 menu ... -> Overview: here you see all current implementations, active and inactive ones).
    You need to check if you can inactivate the current active implementation without any harm to the affected processes. Afterwards you can activate your implementation.
    Regards
      Uwe

  • How many implmentation allowed of BAdi with multiple use option???

    Dear all ,
                        I have doubt in BAdi implementation -
    Case 1 -  I have create a z badi with multiple use option enabled . than i create two implementation of that BAdi . when i call it from my z program than it will call only one which was created 1st  so what is use of 2nd implementation and when it will call ???
    Case 2 - Same case for tcode VD02 their is badi CUSTOMER_ADD_DATA which is also multiple option enable Badi
                  for this also i have created 2 implementation but in this case when i create 2nd implementation it asked for migration of implementation why ???
    Thanks

    Dear deepak ,
                            i have check it both implementation showing yellow color please check my z program and tell me what is wrong in this .
    REPORT  Y_BADI_EXP1.
    CLASS cl_exithandler DEFINITION LOAD.
    DATA : l_badi TYPE REF TO ZIF_EX_MYBADI,
           email TYPE AD_SMTPADR,
           email1 TYPE AD_SMTPADR..
    PARAMETERS : p_user TYPE sy-uname.
    START-OF-SELECTION.
    CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
    EXPORTING
      EXIT_NAME                     = 'ZMYBADI'
    NULL_INSTANCE_ACCEPTED        = 'X'
    CHANGING
      INSTANCE                      = l_badi               " here it will return 2 implementation  ZMYBADI_IM1 , ZMYBADI_IM2
    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.
    ENDIF.
    CALL METHOD l_badi->GET_USER_EMAILID
    EXPORTING
      uname = p_user
    CHANGING
      emaill = email.
    WRITE : /5 email.       " when o/p comes it shows only 1st implementation .
    i placed break point in methods of both  implementation but as usual it stop only at first method ???

  • Can Single Use standard BADI be converted to Multiple Use

    Is it possible to make standard BADI a Multiple Use when it is single use?
    I hope it is not.
    Please confirm.
    Thanks,
    Arshad

    Hello Arshad
    If a BAdI is defined as single-use (SE18) then you can have only a single active implementation within the system. Thus, the answer to your question is: No, it is not possible.
    However, there may be the reverse situation where you have a BAdI defined as single-use but would like to have multiple implementations. In this case you have to adjust the single active implementation and instantiate other implementations if certain conditions are fulfilled, e.g.:
    <b>Active</b> implementation of a BAdI should be: ZCL_MY_BADIIMPL_01
    You create a second implementation (<b>not active</b>): ZCL_MY_BADIIMPL_02
    Within the methods of ZCL_MY_BADIIMPL_01 you could code:
      DATA:
        lo_badi2    TYPE REF TO <BAdI interface>.
      IF ( <condition is fulfilled> ).
        CREATE OBJECT lo_badi2 TYPE ('ZCL_MY_BADIIMPL_02').
    *   Call methods of second BAdI implementation
      ENDIF.
    Regards
      Uwe

Maybe you are looking for

  • Nokia pro cam for lumia 920

    Hi I have a nokia Lumia 920, I updated it to amber using nokia software updated for retail. At that time I was able to install nokia pro cam, but I had to reinstall amber because of minor problems and when I tried re installing pro cam it said "this

  • Is it possible to change date format in Web Dynpro?

    Hi, I have an input field that is mapped to a context data type of date.  It is showing me the data in the format of "mm/dd/yyyy". Is it possible for me to change this format to "dd/mm/yyyy"? I know it is possible to alter the Regional Setting in a W

  • Sync Problem - "There is a problem with this drive. Scan the drive now and fix it".

    Have new desktop computer with Windows 8.When I connect my iPod to my computer to sync, I get the message – "There is a problem with this drive. Scan the drive now and fix it". It is identifying the drive on the iPod as the problem. iPod works fine o

  • Acquiring and analysing signals from a wave (.wav)

    Hello everybody, I would like to acquire the two signals from a stereo (.wav) file and perform a Cross-Correlation between them. Where can I find similar examples? I'm an absolute beginner in Lab-VIEW 7.1 and would appreciate any help. Thank you

  • RAW Files problems with 5DMarkIII

    I recently started shooting RAW in my new 5DMarkIII but everytime I try to transfer those files to Aperture 3 it crashes and no file can be transfered to my computer. I have the app up to date and the firmware of the camera is the last one. I have no